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

refactor: deprecate devstack from registrar IDA #39

Closed
wants to merge 22 commits into from

Conversation

huniafatima-arbi
Copy link
Member

@huniafatima-arbi huniafatima-arbi commented Sep 2, 2024

Description

This PR adds registrar devstack config and image build to devstack repo.

@huniafatima-arbi huniafatima-arbi marked this pull request as draft September 2, 2024 07:21
@huniafatima-arbi huniafatima-arbi changed the title refactor: add dockerfile for registrar refactor: deprecate devstack from registrar IDE Sep 4, 2024
@huniafatima-arbi huniafatima-arbi force-pushed the huniafatima/migrate-dockerfile-setup branch from d0ed02b to c9e1c25 Compare September 4, 2024 11:32
@huniafatima-arbi huniafatima-arbi self-assigned this Sep 4, 2024
@huniafatima-arbi huniafatima-arbi force-pushed the huniafatima/migrate-dockerfile-setup branch from c9e1c25 to a416375 Compare September 4, 2024 11:34
@huniafatima-arbi huniafatima-arbi marked this pull request as ready for review September 4, 2024 11:34
@huniafatima-arbi huniafatima-arbi changed the title refactor: deprecate devstack from registrar IDE refactor: deprecate devstack from registrar IDA Sep 9, 2024
workflow_dispatch:

schedule:
- cron: "0 4 * * *"
Copy link
Member

Choose a reason for hiding this comment

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

Let's schedule it to run only on the weekdays and mention the default time zone which will be used i.e. UTC

Suggested change
- cron: "0 4 * * *"
- cron: "0 4 * * 1-5" # UTC Time

result-encoding: string

- name: Build and push Dev Docker image
uses: docker/build-push-action@v1
Copy link
Member

Choose a reason for hiding this comment

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

Let's try using the latest available v6 version.

Suggested change
uses: docker/build-push-action@v1
uses: docker/build-push-action@v6

username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
target: dev
repository: edxops/registrar-devstack-dev
Copy link
Member

Choose a reason for hiding this comment

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

As the dev environment is solely used within the devstack setup, there is no need to add a redundant identifier. Simply specifying registrar-dev will suffice. Since we will be updating the image, there's no need to distinguish it from previous versions.

Suggested change
repository: edxops/registrar-devstack-dev
repository: edxops/registrar-dev

@@ -535,7 +535,7 @@ services:
CELERY_BROKER_PASSWORD: password
DJANGO_WATCHMAN_TIMEOUT: 30
ANALYTICS_DASHBOARD_CFG: /edx/etc/registrar.yml
image: edxops/registrar-dev:${OPENEDX_RELEASE:-latest}
image: edxops/registrar-devstack-dev:${OPENEDX_RELEASE:-latest}
Copy link
Member

Choose a reason for hiding this comment

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

This change can be skipped if we decide to use registrar-dev.

Suggested change
image: edxops/registrar-devstack-dev:${OPENEDX_RELEASE:-latest}
image: edxops/registrar-dev:${OPENEDX_RELEASE:-latest}


# System requirements.
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -qy \
Copy link
Member

Choose a reason for hiding this comment

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

we've already defined the flag above so it is not needed here.

Suggested change
RUN DEBIAN_FRONTEND=noninteractive apt-get install -qy \
RUN apt-get install -qy \


# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified.
CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "registrar.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 extra lines from end of file.

ENV DJANGO_SETTINGS_MODULE registrar.settings.production

# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified.
CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "registrar.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.

We're currently using gunicorn==23.0.0 in production.txt so the comment can be removed, and the command can be simplified as following:

Suggested change
CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--log-file", "-", "--max-requests=1000", "registrar.wsgi:application"]
CMD ["gunicorn", "--workers=2", "--name", "registrar", "-c", "/edx/app/registrar/registrar/docker_gunicorn_configuration.py", "--max-requests=1000", "registrar.wsgi:application"]

@huniafatima-arbi
Copy link
Member Author

Closing this as this PR will now be created in public-dockerfiles repo

@huniafatima-arbi huniafatima-arbi deleted the huniafatima/migrate-dockerfile-setup branch October 2, 2024 12:18
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.

2 participants