Skip to content
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

Convert ansible to dockerfile #1727

Merged
merged 2 commits into from
Oct 7, 2022
Merged

Convert ansible to dockerfile #1727

merged 2 commits into from
Oct 7, 2022

Conversation

mumarkhan999
Copy link
Member

@mumarkhan999 mumarkhan999 commented Aug 24, 2022

ISSUE: openedx-unsupported/devstack#962

This PR is part of effort aimed at removing Ansible based configurations and replacing them with Dockerfile. Currently Devstack Docker images are built using Ansible based configurations in the configurations repository. Through this effort we will make sure that the Repo has its own Dockerfile which has all the necessary configurations to setup small production and dev environments.

Steps to run this Image with Devstack:

  • Build the Image locally first using the target dev i.e. docker build -t image-name-of-choice --target dev .
  • After the image is built successfully go to the docker compose file of devstack and replace the existing registrar image with the one that you built without changing any other configurations there.
  • Run make dev.up.credentials in the terminal while in the devstack directory.

@mumarkhan999 mumarkhan999 force-pushed the umar/ansible-to-docker branch 6 times, most recently from 72e8b77 to 49523c9 Compare August 29, 2022 12:52
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# Ansible managed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this line should be removed

RUN chown credentials:credentials "$CREDENTIALS_APP_DIR/devstack.sh" && chmod a+x "$CREDENTIALS_APP_DIR/devstack.sh"

# placeholder file for the time being unless devstack provisioning scripts need it.
RUN touch ${CREDENTIALS_APP_DIR}/credentials_env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be moved to the dev target

Dockerfile Outdated

COPY scripts/credentials.sh "$CREDENTIALS_APP_DIR/credentials.sh"

#CMD ["gunicorn", "--workers=2", "--name", "credentials", "-c", "/edx/app/credentials/credentials/credentials/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "credentials.wsgi:application"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Remove the old comments from the file

RUN adduser --disabled-login --disabled-password credentials --ingroup credentials


RUN mkdir -p "$CREDENTIALS_APP_DIR"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to explicitly call the mkdir command here as specifying WORKDIR ${CREDENTIALS_CODE_DIR} would make all the directories that precede the code dir path

@hurtstotouchfire
Copy link
Member

FYI, we will take a look a this next week.

@hurtstotouchfire
Copy link
Member

FYI @mumarkhan999 we have a ticket in our sprint starting Monday to review this.

@justinhynes justinhynes removed their assignment Oct 4, 2022
@Tj-Tracy
Copy link
Contributor

Tj-Tracy commented Oct 7, 2022

LGTM, I'll merge 👍

@Tj-Tracy Tj-Tracy merged commit bc50e9c into master Oct 7, 2022
@Tj-Tracy Tj-Tracy deleted the umar/ansible-to-docker branch October 7, 2022 17:13
Tj-Tracy added a commit that referenced this pull request Oct 7, 2022
Tj-Tracy added a commit that referenced this pull request Oct 7, 2022
@mumarkhan999 mumarkhan999 restored the umar/ansible-to-docker branch October 10, 2022 11:06
@mumarkhan999
Copy link
Member Author

mumarkhan999 commented Oct 10, 2022

Hi @hurtstotouchfire @Tj-Tracy ,

The epic related to this PR is still in discovery work and we are getting a lot of input from SRE and Arch side, hence this wasn’t supposed to be merged right now. According to the input we received we need to do some changes:

  • Move configuration files from this repo to devstack
  • Remove supervisor related stuff from dockerfile
  • Update CI/CD flow of pushing docker image

This PR failed on the master branch as we didn’t have a build target in our new dockerfile but CI workflow was trying to push the build target.

Now I've created a new PR #1782
Once the above-mentioned things have been done, we'll let you know to review it.

@Tj-Tracy
Copy link
Contributor

@mumarkhan999 appreciate the followup 👍 sorry for the early merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants