-
Notifications
You must be signed in to change notification settings - Fork 8
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
Decoupling the image build process from the flow #221
Decoupling the image build process from the flow #221
Conversation
Tested and deployed on prod env. the web page is up and running. |
Dockerfile
Outdated
WORKDIR /code | ||
COPY . . | ||
RUN pip3 install -r requirements.txt | ||
FROM quay.io/redhat-beyond/beyond | ||
EXPOSE 5000 | ||
|
||
ENTRYPOINT python3 app.py runserver > web-application.log |
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.
Where is this Dockerfile used?
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.
Dockerfile is used by docker-compose in both of the following cases:
- In the github flow, it is being invoked from here:
.github/workflows/main.yml
- name: Build the docker-compose stack
run: docker-compose up -d
- In the Vagrant flow (dev, stage, prod) it is being invoked from here:
Vagrantfile
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true, run: "always",
compose_version: "1.28.2"
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 don't understand the code. There seems to be a circle dependency. docker-compose is building the same images as the parent 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.
You Are right. I was confused.
There is no need for 'Docker' file anymore. Because the 'beyond' image is now being pulled from quayi.
I am removing the Docker file.
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 happens if you want to update the image? Is it going to be done manually?
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.
well, I assume that this is going to be a different flow for building and pushing the image...
Can you suggest how should I start this flow?
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.
Can you please google a bit? Take a look at my other comments please.
Dockerfile
Outdated
WORKDIR /code | ||
COPY . . | ||
RUN pip3 install -r requirements.txt | ||
FROM quay.io/redhat-beyond/beyond | ||
EXPOSE 5000 | ||
|
||
ENTRYPOINT python3 app.py runserver > web-application.log |
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 don't understand the code. There seems to be a circle dependency. docker-compose is building the same images as the parent image.
@@ -1,7 +1,7 @@ | |||
version: '3.9' | |||
services: | |||
beyond: | |||
build: . |
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.
Why was the build key removed?
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.
Because the image build stage is now removed from this flow.
The image is ready and being hosted on quayei already. We just need to pull it and thats it.
From $ vagrant up stage --provider=aws
:
.
.
.
==> stage: Pulling beyond (quay.io/redhat-beyond/beyond:)...
stage: latest: Pulling from redhat-beyond/beyond
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.
Something is wrong with this concept. An automatic build should happen when a code change lands in master.
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 agree, there should be a different flow for building and pushing the image. lets discuss this in my reply on your comment from above (to avoid duplicated messages)
9cb5ff5
to
214a25a
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.
Please read my last comments. The whole approach is wrong.
Can you please put your concept in writing? Let's agree on the concept BEFORE the implementation.
Why it is all wrong? We said to decouple, so i decoupled the flow. Now it only pulls the ready image. |
4221dbd
to
5e0afa5
Compare
@lioramilbaum Could you please add 'GitHub Secrets' to your 'https://github.com/beyond-io/beyond/' project? I am following this example i found to integrate the github image build into the github actions: In the example, there is a 'build image' + 'push image' to quay when 'commit' was found on the github repo. |
I have elevated your permissions to Admin. You should be able to add secrets from now on and going forward. I didn't take the time to review the approach you are driving. I still think that dumping the suggested approach into a doc/issue and agreeing on the direction would save you and I time. Please consider that. I do not know if I would want to invest another review cycle on a wrong approach. |
3e782b2
to
cbb44eb
Compare
26d6131
to
247ff57
Compare
247ff57
to
7ebde5a
Compare
Need to test 'push' action for the new build push pipeline. will revert it afterwards
fix #211