-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add Native Docker config #3575
Add Native Docker config #3575
Conversation
93bae51
to
d5a7d3f
Compare
@mphilbrick211 This is still in progress and I will get back to it once we prioritize it. |
@rgraber SRE team told me that you might be working on making course-discovery deployable using the in-repo |
3c98c0b
to
3ed3da9
Compare
|
||
########################################################### | ||
# Define k8s target | ||
FROM app as kubernetes | ||
FROM prod as kubernetes |
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.
Using prod image as base here instead of app since our newer app image doesn't contain any code files or requirements. Previously the app image was using prod requirements hence I have used the production image as base image for k8s target.
docker_auth: | ||
echo "$$DOCKERHUB_PASSWORD" | docker login -u "$$DOCKERHUB_USERNAME" --password-stdin | ||
|
||
docker_push: docker_tag docker_auth ## push to docker hub |
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 couldn't find any usage of these images. For devstack image hosted on edxops
is used. As far as I know we started pushing these images for decentralized devstack
but that project wasn't completed and these targets have remained here since then.
0cda65b
to
7a11a7b
Compare
Seems like I can't even tag reviewers on the PR 🥲 |
|
Hi @aht007! Would you mind rebasing this to resolve the branch item? It's out-of-date with the base branch. Also, tagging @ansabgillani here to take a look at your comment re: the failing test and to review once the PR is rebased. Thanks! |
d4aea69
to
678e11a
Compare
I have rebased the PR and now the check |
Hi @aht007 and @ansabgillani! Friendly ping on this :) |
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 elaborate on the testing instruction? Where does the image go after it has been built by this command and where exactly do we need to update the devstack docker-compose file? Thanks.
# The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get | ||
# suitable images for smaller prod environments. | ||
# - name: Build and push prod Docker image | ||
# uses: docker/build-push-action@v1 | ||
# with: | ||
# push: true | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
# target: prod | ||
# repository: edxops/discovery-prod | ||
# tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} |
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.
Hmmm, the above comment is understandable but why not remove this piece of code for now?
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.
Just added it so it serves as a reminder to anyone working on this. Also this is supposed to work but we don't just yet want to enable the push because we don't have bandwidth currently for testing and supporting these images just yet.
@Ali-D-Akbar You can build the image using the instructions that I have mentioned in the description of the PR. Once that is done you can checkout to the branch in this PR openedx-unsupported/devstack#994. It has everything setup for you but you will need to change the image name on this line with the image name that you have built locally using this PR. After that you have to run provisions for the discovery service and start your service as you would do it normally on devstack |
with: | ||
script: | | ||
const releasePrefix = 'refs/tags/open-release/'; | ||
const tagName = context.ref.split(releasePrefix)[1] || 'latest'; |
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.
curious: what does context.ref imply?
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.
GitHub context contains information about the workflow run and the event that triggered the run.
In this case we are extracting the ref variable from it which contains the Github branch that triggered the run. If that branch is an open-release branch we extract its release name e.g. maple or nutmeg else we know that it was run from master branch and hence use the latest tag.
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 not tested this locally yet. Will this effect the discovery k8s event bus deployment?
@DawoudSheraz In theory it shouldn't effect the k8s deployment. But for being on safe side I already requested a review from @rgraber. |
I'm in the process of testing this locally |
I was able to deploy a course discovery worker locally with minikube. |
@rgraber In my view there shouldn't be any issues since the build stages are the same and I can also see the commands for building the image and everything looks fine to me. I will still check with an SRE team member for confirmation on this and will get back to you. |
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.
@nadeemshahzad clarified this for me. Looks good and worked locally.
Hi @aht007! Looks like you'll need to rebase to fix the branch date alert. Then it should be OK to merge. CC: @ansabgillani for merging |
79b971c
to
48e97a7
Compare
@openedx/incident-management I would need help with merging and monitoring this PR. For now this PR will not affect |
5ce22a6
to
6fef84d
Compare
6fef84d
to
2aabb09
Compare
ISSUE: openedx-unsupported/devstack#960
This PR is part of effort aimed at removing Ansible based configurations and replacing them with
Dockerfile
. Currently Devstack Docker images are built usingAnsible based configurations
in theconfigurations
repository. Through this effort we will make sure that the Repo has its ownDockerfile
which has all the necessary configurations to setup small production and dev environments.Steps to run this Image with Devstack:
dev
i.e.docker build -t image-name-of-choice --target dev .
docker compose
file ofdevstack
and replace the existingdiscovery
image with the one that you built without changing any other configurations there.make dev.up.discovery
in the terminal while in the devstack directory.discovery