-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(docker): Adds a cloudbuild file to publish the docker image #34
Conversation
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.
I have two concerns:
- I don't understand why we don extend the existing
cloudbuild.yaml
file instead of introducing a new one (and adding new triggers). - I don't think the testing we do here is efficient or useful as we should be running unit tests on GitHub Actions anyway, right?
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.
Thanks, will address the comment soon
I don't understand why we don extend the existing cloudbuild.yaml file instead of introducing a new one (and adding new triggers).
To my knowledge if I extend the existing one and then call it from two triggers (one is the one we use today to generate the internal image (this repo was used to be private) and the other would be a new one on the public repo), The private one would try to publish the image on the public repo. I don't think that would work.
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.
To my knowledge if I extend the existing one and then call it from two triggers (one is the one we use today to generate the internal image (this repo was used to be private) and the other would be a new one on the public repo), The private one would try to publish the image on the public repo. I don't think that would work.
Not sure if I fully grasp what you have in mind here so will do a Slack sync before doing another pass on this PR. Thanks a lot for all the updates and providing additional context!
I tested the cloudbuild file and plugged it whenever a PR is updated and a commit on master happens. Also removed the build step of the cdc image from the e2e test. Now it uses the same image we are going to push to the registry even to execute the test script. |
'SOURCE_COMMIT=$COMMIT_SHA', | ||
'--destination=us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA', | ||
'-f', './Dockerfile', | ||
'--target=application' |
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.
I guess this is obsolete now as we use the same image for testing and just install pytest
at container start?
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.
Actually no, this is still needed for the CI github actions
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.
I'd really like to remove the multi-stage Docker file, at least for testing image.
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.
Ok, I can split it into two files. What's the reasoning for preferring two files too a multi stage Dockerfile? I thought multi stage was meant for use cases like this.
This adds a new cloudbuild file to create the docker image and publish it on the public repo.
Specifically: