[merged] Refactor Pull, Update, Install, Run#825
[merged] Refactor Pull, Update, Install, Run#825baude wants to merge 1 commit intoprojectatomic:masterfrom
Conversation
|
@giuseppe would you mind peeking at the system_container test failure? Maybe you can hint me on whats wrong there and I can fix it. |
|
The tests are failing due to the "secret" value that was set for "$RECEIVER" during install was not set, so $RECEIVER took the default value of "world". From a glance "self.args.setvalues" (which contained the secret value) was overridden at some point before it reached _do_checkout in syscontainers.py |
Atomic/backends/_docker.py
Outdated
| insecure = True if util.is_insecure_registry(self.d.info()['RegistryConfig'], util.strip_port(registry)) else False | ||
| trust = Trust() | ||
| trust.set_args(pull_args) | ||
| #trust.set_args(pull_args) |
There was a problem hiding this comment.
Aaron and I speculated that these are no longer needed. I commented it out to test it. Just need to delete them. Will do now.
Atomic/backends/_docker.py
Outdated
| def update(self, name, force=False): | ||
| def update(self, name, force=False, **kwargs): | ||
| debug = kwargs.get('debug', False) | ||
| # Only delete containers if a new image is actually pulled. |
There was a problem hiding this comment.
Not sure what this comment means?
There was a problem hiding this comment.
The comment was misplaced a little. I have moved it down. If you use update with --force, existing containers based on the old image are deleted. So in the case that a new image is not pulled, the containers should not be deleted.
|
Tests are failing |
|
@giuseppe PTAL |
|
I agree with @yuqi-zhang on this, could you please verify why the args are not passed correctly? Also, it is a huge patch, I think it will make sense to split it in one for each refactored command. It will make easier to spot the problem. |
Atomic/objects/image.py
Outdated
| def __eq__(self, other): | ||
| if self.long_version == other.long_version: | ||
| if self.long_version == other.long_version \ | ||
| and not any([True for x in [self.long_version, other.long_version] if x is None]) \ |
There was a problem hiding this comment.
is this None not in [self.long_version, other.long_version] ?
Atomic/objects/image.py
Outdated
| if self.long_version == other.long_version: | ||
| if self.long_version == other.long_version \ | ||
| and not any([True for x in [self.long_version, other.long_version] if x is None]) \ | ||
| and not any([True for x in [self.long_version, other.long_version] if x is '']): |
There was a problem hiding this comment.
and this '' not in [self.long_version, other.long_version] ?
|
Im looking into the tests. Because all of these commands are so linked, it does not work well to split up frankly. I would prefer to keep them together. if that is going to keep it from being merged, Ill see what I can do. |
97f802c to
f9a6999
Compare
Refactor several of the atomic verbs and subverbs to take advantage of object refactoring. Also, do not pull images with skopeo if the local image is already at the latest. $ sudo python ./atomic --debug pull busybox Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='busybox', reg_type=None, storage='docker') Latest version of busybox already present.
|
If |
|
The user gets different errors when trying to pull an image that does not exist and choosing the different storage backend |
|
Not sure how this should work, but it looks off... When using I would suggest changing the output to indicate that the container is already running or otherwise notifying the user that the new container ID is not going to be used. |
|
Yes the second atomic run on the same container will just exec into the container if it is already running. So it should indicate that it is joining the existing container. |
f9a6999 to
ffd28c9
Compare
|
📌 Commit ffd28c9 has been approved by |
|
☀️ Test successful - status-atomicjenkins |
|
make PYTHON=python3 install is blowing up. |
|
@rhatdan Im not able to replicate that. Is it rawhide maybe? |
|
What version of python3-pylint do you have? |
Refactor several of the atomic verbs and subverbs to take advantage
of object refactoring.
Also, do not pull images with skopeo if the local image is already
at the latest.
$ sudo python ./atomic --debug pull busybox
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='busybox', reg_type=None, storage='docker')
Latest version of busybox already present.