-
Notifications
You must be signed in to change notification settings - Fork 771
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
Added support for build key in v3 #846
Conversation
@surajnarwade Tests would be good too! |
Resolves kubernetes#636 This PR will add support for `build` in docker compose v3. As docker/cli#481 got merged now
Hey @surajnarwade I don't see why there is an issue with this. You are only updating Version 3 of Docker Compose which uses I also see that What issues are you running into? Please investigate and let me know! |
Also the error is just a simple renaming of
|
After the rename it seems to work:
|
@cdrage after renaming it works locally but not in CI |
Hey @surajnarwade
See my previous comment up-above. You don't need to update libcompose to make this work. Only docker/cli, as that's where my commit upstream was merged in for build support. No need to edit / mess around with libcompose vendoring.
Version 3 only deals with docker/cli, it doesn't touch docker/libcompose.
|
@@ -24,15 +24,15 @@ import: | |||
|
|||
# We use libcompose to parse v1 and v2 of Docker Compose | |||
- package: github.com/docker/libcompose | |||
version: 4a647d664afbe05c41455c9d534d8239671eb46a | |||
version: 57bd716502dcbe1799f026148016022b0f3b989c |
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.
don't update libcompose, you don't need to.
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.
Sirupsen :(
To give an update of what's happening after talking to @surajnarwade To update docker/cli we had to update vendoring. To update vendoring with the logrus errors, we had to update libcompose. To update libcompose, we had to update OpenShift vendoring due to conflicts, now we have to update and somehow migrate from 1.4 of OpenShift to 3.2 (I believe) in order to get all of this to work. 👍 |
aab81ae
to
e8e5a10
Compare
@surajnarwade Can you please provide details on what you did? Was it a PR that updated docker/distribution? Did you manually edit the vendoring files? Have you updated Makefile to sed replace Sirupsen to sirupsen, or anything else for that matter? |
487008b
to
e6bc23d
Compare
@cdrage @kadel ,To give brief idea about this PR, I have Updated these changes comes with after fixing To tackle this situation, I updated I also added this thing to Makefile with |
Awesome 👍 thanks for the detailed explanation! One last thing, could you put the |
@cdrage gotcha |
87aab39
to
9018fe8
Compare
@cdrage now you can easily review it :) |
@surajnarwade Your makefile commit is messy: c4044b5 Seems like you included some vendor (libcompose) files and there are some code that you're modifying in So to go into detail: Remember when you do all this to also update the commit descriptions / titles! |
Updated `sirupsen`, `docker/cli`, `docker/libcompose` in `glide`, Also changed `Sirupsen` with `sirupsen` in all kompose packages as well as in `docker/distribution` packages
c4bb0a3
to
34bddc5
Compare
@cdrage , Updated commits, review needed |
34bddc5
to
224da0c
Compare
EDIT: Code / commits LGTM so far, awesome job! 👍 Just need to make CI pass now. |
224da0c
to
90cd6eb
Compare
@cdrage all green :) |
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.
Few things, I get an error when using the example with just kompose up
:
test/fixtures/nginx-node-redis pr_846 ✗ 2d ◒
▶ kompose up -f docker-compose-v3.yml
FATA Error while deploying application: k.Transform failed: image key required within build parameters in order to build and push service 'nginx'
This is because I'm trying to build this locally.
You are right however... I don't think we are able to test this very well since we're unable to push to Docker Hub without docker login
.
test/fixtures/nginx-node-redis pr_846 ✗ 2d ⚑ ◒
▶ kompose up -f docker-compose-v3.yml
INFO Build key detected. Attempting to build and push image 'cdrage/test-nginx'
INFO Building image 'cdrage/test-nginx' from directory 'nginx'
INFO Image 'cdrage/test-nginx' from directory 'nginx' built successfully
INFO Pushing image 'cdrage/test-nginx:latest' to registry 'docker.io'
INFO Attempting authentication credentials 'https://index.docker.io/v1/
Above works when I changed it to my username.
Otherwise, LGTM.
script/test/cmd/tests.sh
Outdated
# Test BuildConfig v3 | ||
cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/docker-compose-v3.yml convert --stdout -j --build build-config" | ||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" -e "s;%URI%;$uri;g" -e "s;%REF%;$branch;g" $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/output-os-template-v3.json > /tmp/output-os.json | ||
convert::expect_success_and_warning "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/nginx-node-redis/docker-compose-v3.yml convert --stdout -j --build build-config" "/tmp/output-os.json" "$warning" |
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.
There should be another test added for Kubernetes.
Code / implementation LGTM, works on my side perfectly. After merging, can you please update the documentation (conversion.md document) as well as open an issue that we need to add a test for testing Kubernetes docker image building. |
90cd6eb
to
ada8af2
Compare
Thanks @cdrage :) Added test for kubernetes as well |
Phew. Thanks A LOT for your contribution @surajnarwade that was a lot of trouble-shooting. Merging in! |
✓ for build v3 support since we merged in kubernetes#846
Thanks @cdrage |
✓ for build v3 support since we merged in kubernetes#846
✓ for build v3 support since we merged in kubernetes#846
Resolves #636
This PR will add support for
build
in docker compose v3, as docker/cli#481 got merged now.also this will update
sirupsen
,docker/cli
,docker/libcompose
inglide
,Also changed
Sirupsen
withsirupsen
in all kompose packages as well as indocker/distribution
packages