-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow re-use of Docker image (reopen #319) #341
Allow re-use of Docker image (reopen #319) #341
Conversation
Not sure why Travis CI didn't grab this. Close-reopening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is ready for merge.
- Please fix the travis config
- Update documentation (from Expose COMMIT_IMAGE to user #319)
29e0364
to
e1d9873
Compare
@ipa-mdl Thank you for the review #341 (review). Hopefully updated commit addressed all comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and documentation are alright (just a minor glitch left).
But please update rerun_ci
accordingly.
e1d9873
to
0ac50ba
Compare
Addressing https://github.com/ros-industrial/industrial_ci/pull/319/files#r220267620 [feat:commit_img] Add a section to readme. [feat:commit_img] Remove 'COMMIT_IMAGE' variable. Add a test. Address https://github.com/ros-industrial/industrial_ci/pull/319/files#r222089723 [feat:commit_img] Adding a test for DOCKER_COMMIT_IMAGE. [feat:commit_img] Simplify 'docker commit' variable names. Revert change in rerun_ci (address a review commnet ros-industrial#319 (review)). Rename the variables to clarify they are related to Docker. Addressing https://github.com/ros-industrial/industrial_ci/pull/319/files#r220267620 expose COMMIT_IMAGE variable to user. Updates related documentation and variables. [feat:commit_img] Remove 'COMMIT_IMAGE' variable. Add a test. Address https://github.com/ros-industrial/industrial_ci/pull/319/files#r222089723 [feat:commit_img] Simplify 'docker commit' variable names. Revert change in rerun_ci (address a review commnet ros-industrial#319 (review)). [doc] Remove unused, obsolete var name (address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591444) [doc] Remove unused var (address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591088). [feat:commit_img] Simplified test (attempting to address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591026) [feat:commit_img] Simplify test logic (based on suggestion AustinDeric#3 (comment)). [feat:commit_img] Removed obsolete logic (address ros-industrial#319 (comment)). [feat:commit_img] address review comments (ros-industrial#319 (review)) [docker.sh] Indentation (ros-industrial#341 (comment)).
Addressing https://github.com/ros-industrial/industrial_ci/pull/319/files#r220267620 [feat:commit_img] Add a section to readme. [feat:commit_img] Remove 'COMMIT_IMAGE' variable. Add a test. Address https://github.com/ros-industrial/industrial_ci/pull/319/files#r222089723 [feat:commit_img] Adding a test for DOCKER_COMMIT_IMAGE. [feat:commit_img] Simplify 'docker commit' variable names. Revert change in rerun_ci (address a review commnet ros-industrial#319 (review)). Rename the variables to clarify they are related to Docker. Addressing https://github.com/ros-industrial/industrial_ci/pull/319/files#r220267620 expose COMMIT_IMAGE variable to user. Updates related documentation and variables. [feat:commit_img] Remove 'COMMIT_IMAGE' variable. Add a test. Address https://github.com/ros-industrial/industrial_ci/pull/319/files#r222089723 [feat:commit_img] Simplify 'docker commit' variable names. Revert change in rerun_ci (address a review commnet ros-industrial#319 (review)). [doc] Remove unused, obsolete var name (address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591444) [doc] Remove unused var (address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591088). [feat:commit_img] Simplified test (attempting to address https://github.com/ros-industrial/industrial_ci/pull/319/files#r230591026) [feat:commit_img] Simplify test logic (based on suggestion AustinDeric#3 (comment)). [feat:commit_img] Removed obsolete logic (address ros-industrial#319 (comment)). [feat:commit_img] address review comments (ros-industrial#319 (review)) [docker.sh] Indentation (ros-industrial#341 (comment)).
0ac50ba
to
277a7c7
Compare
Commit updated. Locally I tested
UPDATE: Figured it out the reason why the specified image isn't committed #341 (comment). rerun_ci looks for environment variables while I only specified the command args. Will update. |
277a7c7
to
4b96fc0
Compare
Please re-review @ipa-mdl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally I tested rerun_ci, which seems to work fine without DOCKER_COMMIT defined (i.e. I see a temporary Docker image commited), but with the arg the behavior is still the same as no arg.
Yes, this is how rerun_ci
works, it commits the image and run further tests in the new images.
That's why I implemented _DOCKER_COMMIT
in the first place.
industrial_ci/scripts/rerun_ci
Outdated
_COMMIT_IMAGE_MSG="$repo_dir $*" | ||
env_hash=($(sha256sum <<< "$_COMMIT_IMAGE_MSG")) | ||
_COMMIT_IMAGE="industrial-ci/rerun_ci/$(basename "$repo_dir"):${env_hash:0:12}" | ||
if [ -z $DOCKER_COMMIT_MSG ]; then DOCKER_COMMIT_MSG="$repo_dir $*"; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCKER_COMMIT_MSG
and DOCKER_COMMIT
should not get overwritten from the outside, they are crucial to the argument hashing.
Please remove these if clauses.
TLDR; @ipa-mdl Could you elaborate how you want us to update
In this PR |
Just remove the if clauses and overwrite
No. |
4b96fc0
to
58d9577
Compare
Ok. In that case I don't see a point in updating the variable names ( Also updated the document, as I think the new feature added in this PR doesn't work for rerun (I tested it locally. Not sure if that's what's supposed to be though). |
Thanks!
It is crucial to rename the variables everywhere.
I don't see the need for an "exception", but we could add a note that I did not make it public in the first place, because the resulting images are not well-formed.
It could even be pushed to a registry and reused as |
566c4ef
to
7963ecd
Compare
7963ecd
to
892c4e9
Compare
Updated to address your comment @ipa-mdl.
Ha, my team has been happilly doing so for a few months :P Indeed built Docker images currently need some manual update (which I'll open tickets about once this PR finishes) but overall being able to automate Docker build as part of normal CI pipeline w/o maintaining Dockerfiles etc. is very helpful for our usecase. |
That's great to hear :) |
aaeee7e
to
892c4e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What does this PR change
Re-opening #319 using the commits from the requester there.
This adds a feature to run
docker commit
from industrial_ci, so that the users can access the built docker image for later usage.Review comments up to this point #319 (review) are hopefully addressed.
Maturity of the suggested feature
At the time of opening this PR, the feature is experimental. We've been actively using on our (private) repos, and I found there are still some basic issues that need to be fixed in order for this feature to be integrated into a full-automated cycle. That said, we've been able to use this feature in semi-automated situation where small manual change to the built image makes the image usable.
Instead of trying to fix all of those issues in a single initial PR, I'd suggest to move on, claiming experimental, merge, open tickets, and keep iterating.
Review items