Skip to content

cephadm: remove injected_args#39619

Merged
sebastian-philipp merged 5 commits intoceph:masterfrom
sebastian-philipp:rm_injected_argv
Mar 10, 2021
Merged

cephadm: remove injected_args#39619
sebastian-philipp merged 5 commits intoceph:masterfrom
sebastian-philipp:rm_injected_argv

Conversation

@sebastian-philipp
Copy link
Contributor

@sebastian-philipp sebastian-philipp commented Feb 22, 2021

This PR is based on #39141 and will contain those commits, unit it is merged

Avoid copying cephadm all the time.

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@sebastian-philipp
Copy link
Contributor Author

replaces #37495

@liewegas
Copy link
Member

jenkins test make check

Comment on lines +6580 to +6727
path = os.path.realpath(__file__)
assert os.path.isfile(path)
return path
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebastian-philipp
Copy link
Contributor Author

>       assert exporter.binary_path == "/var/lib/ceph/foobar/cephadm"
E       AssertionError: assert '/home/jenkin...phadm/cephadm' == '/var/lib/ceph/foobar/cephadm'
E         - /var/lib/ceph/foobar/cephadm
E         + /home/jenkins-build/build/workspace/ceph-pull-requests/src/cephadm/cephadm

@sebastian-philipp
Copy link
Contributor Author

changelog: fix cephadm tox

['mkdir', '-p', f'/var/lib/ceph/{self.mgr._cluster_fsid}'])
if code:
msg = f"Unable to deploy the cephadm binary to {host}: {_err}"
self.log.warning(msg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this kind of situations and the consequences deserves an "error" instead of a "warning"

Copy link
Member

@jmolmo jmolmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works.!

Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! .. mostly nits around readability of the remoto connection handling, but the code is correct

Comment on lines +996 to +1004
out, err, code = remoto.process.check(
conn,
[python, self.mgr.cephadm_binary_path] + final_args,
stdin=stdin.encode('utf-8') if stdin is not None else None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) the remoto.process logic and the logic above are duplicates .. move into a helper func?

if code == 2:
out_ls, err_ls, code_ls = remoto.process.check(
conn, ['ls', self.mgr.cephadm_binary_path])
if code_ls == 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if code_ls == 2:
if code_ls != 0:

(nit) similar, but maybe any non-zero errcode?

Might also be good to extract this into a dedicated cephadm_binary_exists function?

stdin=script.encode('utf-8'))
[python, self.mgr.cephadm_binary_path] + final_args,
stdin=stdin.encode('utf-8') if stdin is not None else None)
if code == 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if code == 2:
if code == errno.ENOENT:

(nit) I was somewhat confused why retval 2, but it's file not found from python.

@github-actions
Copy link

github-actions bot commented Mar 4, 2021

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

right now, an upgrade might overwrite the existing
binary which would force us to have the CLI stable.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Removed the injected_argv parameter and the injection of code in the cephadm
script we send to hosts.
Now the script is copied and after that we execute the cephadm command.
I would like to copy it only one time (when adding new hosts) but this will be
part of a future PR, together with other prs to:

- Introduce cephadm version
- Get rid of packaged/root mode
- Use pex or eggs

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Avoid copying cephadm all the time.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Because we now always have a script on the remote hosts.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
@sebastian-philipp
Copy link
Contributor Author

@sebastian-philipp
Copy link
Contributor Author

jenkins test make check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants