Conversation
|
Looks like there's a test failure: |
|
For my own clarity. This PR does the following: Every time we execute a command from mgr/cephadm, we no longer execute it by directly feeding it to python's stdin but rather save it to We also mount Do we do anything with the mounted cephadm_path inside the container? Is that correct @jmolmo ? |
2e8a3f0 to
a898367
Compare
By the context it seems that something happened to the destination host when trying to copy cephadm to it .... By the error message we can think that maybe it has been a network error.... Can you pass the link to the log file in order to see if i can get more information? |
a898367 to
0bf7b2b
Compare
yes. You're right. The goal here is to avoid "inject" code in execution time. We are copying the script and after that execute the commands.
No!. Good catch!! (this was part of my "source" PR where i had more things ... ) Removed!
Everything correct @jschmid1 |
Click on |
Indeed it's easier to review and judge smaller portions of code. Looking forward to future PRs |
src/pybind/mgr/cephadm/module.py
Outdated
| cephadm_dest = '/var/lib/ceph/%s/cephadm/%s' % (self._cluster_fsid, self.get_mgr_id()) | ||
| self._copy_cephadm(conn, cephadm_dest) | ||
|
|
||
| self.log.info("Tying to execute : %s" % (['sudo', 'python', cephadm_dest] + final_args)) |
|
It seems there is a test failing because I reuse the remoto connection object ... as we can read in the test: "A mocked connection class that only allows the use of the connection once. If you attempt to use it again via a _check, it'll explode (go boom!)." Somebody knows why to reuse a remoto connection object is not a good idea? |
Yes. Nothing like read the code ... We are reusing connections all the time ... not needed to do it explicitly :-) |
0bf7b2b to
f880d2a
Compare
|
I have modified the unit test because the previous one tries to test the "refresh" of the connection indirectly using higher level calls (check_host).
The modification in unit test, now test directly only the function where "reuse connection or reconnect" is implemented. |
c651b7e to
1fbb837
Compare
|
jenkins test make check |
1fbb837 to
8f81f81
Compare
8f81f81 to
0a25e21
Compare
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>
Added container image hash to cephadm binary location. Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
0a25e21 to
4482488
Compare
sebastian-philipp
left a comment
There was a problem hiding this comment.
minor nit and then I think we're good to go
| mgrd = self.cache.get_daemon("mgr.%s" % self.get_mgr_id()) | ||
| cephadm_dest = '/var/lib/ceph/%s/cephadm/%s/%s/cephadm' % ( | ||
| self._cluster_fsid, self.get_mgr_id(), mgrd.container_image_id) |
There was a problem hiding this comment.
this looks already good. There is just one problem: in a vstart cluster, there is no
containerized MGR. Therefore I think we can simplify this to:
| mgrd = self.cache.get_daemon("mgr.%s" % self.get_mgr_id()) | |
| cephadm_dest = '/var/lib/ceph/%s/cephadm/%s/%s/cephadm' % ( | |
| self._cluster_fsid, self.get_mgr_id(), mgrd.container_image_id) | |
| cephadm_hash = sha256(self._read_cephadm_script()) | |
| cephadm_dest = f'/var/lib/ceph/{self._cluster_fsid}/cephadm-{cephadm_hash}/cephadm' |
There was a problem hiding this comment.
ping. Needs rebase: now you also need to fix
ceph/src/pybind/mgr/cephadm/module.py
Lines 1930 to 1939 in fd1c8dd
to contain the hash.
| mgrd = self.cache.get_daemon("mgr.%s" % self.get_mgr_id()) | ||
| cephadm_dest = '/var/lib/ceph/%s/cephadm/%s/%s/cephadm' % ( | ||
| self._cluster_fsid, self.get_mgr_id(), mgrd.container_image_id) |
There was a problem hiding this comment.
ping. Needs rebase: now you also need to fix
ceph/src/pybind/mgr/cephadm/module.py
Lines 1930 to 1939 in fd1c8dd
to contain the hash.
|
Is the goal to eliminate |
Both: ceph/src/pybind/mgr/cephadm/serve.py Lines 1018 to 1027 in 39fd806 why not use it, if it is there already. |
|
just created #39141 to fix the unsafe cephadm daemon path |
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:
Signed-off-by: Juan Miguel Olmo Martínez jolmomar@redhat.com
Note:
To test this is a bit tricky .. because the cephadm binary is by default obtained from "/usr/sbin" folder in the mgr container.
The new cephadm binary included in this pr is the one to test, so in order to do it properly: