Skip to content

Commit

Permalink
Rename 'comptest' to 'frx_challenges'
Browse files Browse the repository at this point in the history
- Centralize all 'workingDir' declarations into the docker image

Ref 2i2c-org#98
  • Loading branch information
yuvipanda committed Oct 29, 2024
1 parent 1b4cfb1 commit 112146b
Show file tree
Hide file tree
Showing 78 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: ^helm-chart/templates/.*|^comptest/web/templates/.*
exclude: ^helm-chart/templates/.*|^frx_challenges/web/templates/.*

# Autoformat and lint: HTML
- repo: https://github.com/Riverside-Healthcare/djLint
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ python3 manage.py runserver

In order to access the admin interface at `/admin`, your user needs to be a Django superuser.

Because we use GitHub external login we cannot use the existing `manage.py createsuperuser` command, so a separate [promote command](https://github.com/2i2c-org/frx-challenges/blob/main/comptest/web/management/commands/promote.py) was created to promote an existing user (created via GiHub login) into a superuser.
Because we use GitHub external login we cannot use the existing `manage.py createsuperuser` command, so a separate [promote command](https://github.com/2i2c-org/frx-challenges/blob/main/frx_challenges/web/management/commands/promote.py) was created to promote an existing user (created via GiHub login) into a superuser.

Steps to access the admin interface:

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ RUN mkdir /opt/frx-challenges

COPY . /opt/frx-challenges

WORKDIR /opt/frx-challenges
WORKDIR /opt/frx-challenges/frx_challenges

RUN pip3 install -r requirements.txt
RUN pip3 install -r ../requirements.txt
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
ASGI config for comptest project.
ASGI config for frx_challenges project.
It exposes the ASGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "comptest.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "frx_challenges.settings")

application = get_asgi_application()
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for comptest project.
Django settings for frx_challenges project.
Generated by 'django-admin startproject' using Django 5.0.7.
Expand Down Expand Up @@ -63,7 +63,7 @@
"allauth.account.middleware.AccountMiddleware",
]

ROOT_URLCONF = "comptest.urls"
ROOT_URLCONF = "frx_challenges.urls"

TEMPLATES = [
{
Expand All @@ -83,7 +83,7 @@
},
]

WSGI_APPLICATION = "comptest.wsgi.application"
WSGI_APPLICATION = "frx_challenges.wsgi.application"


# Database
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
WSGI config for comptest project.
WSGI config for frx_challenges project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "comptest.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "frx_challenges.settings")

application = get_wsgi_application()
2 changes: 1 addition & 1 deletion comptest/manage.py → frx_challenges/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "comptest.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "frx_challenges.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion helm-chart/templates/configmap-yamlconf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ kind: ConfigMap
metadata:
name: {{ include "frx-challenges.fullname" . }}-django-yamlconf
data:
comptest.yaml: |
frx_challenges.yaml: |
{{ mustToJson .Values.yamlSettings.overrides }}
27 changes: 11 additions & 16 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ spec:
- name: db-migrate
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: /opt/frx-challenges/comptest
command:
- python
- manage.py
Expand All @@ -39,12 +38,11 @@ spec:
- name: storage
mountPath: /opt/state
- name: django-yamlconf
mountPath: /opt/frx-challenges/comptest/comptest.yaml
subPath: comptest.yaml
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
- name: collect-static
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: /opt/frx-challenges/comptest
command:
- python
- manage.py
Expand All @@ -54,14 +52,13 @@ spec:
runAsUser: 0
volumeMounts:
- name: django-yamlconf
mountPath: /opt/frx-challenges/comptest/comptest.yaml
subPath: comptest.yaml
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
- name: staticfiles
mountPath: /opt/staticfiles
- name: admin-add
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: /opt/frx-challenges/comptest
command:
{{- if .Values.adminUsers }}
- python
Expand All @@ -80,8 +77,8 @@ spec:
- name: storage
mountPath: /opt/state
- name: django-yamlconf
mountPath: /opt/frx-challenges/comptest/comptest.yaml
subPath: comptest.yaml
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
{{ with .Values.extraInitContainers }}
{{ $extraInitContainers := . }}
{{ $sortedKeys := keys $extraInitContainers | sortAlpha }}
Expand All @@ -93,21 +90,20 @@ spec:
- name: django
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: /opt/frx-challenges/comptest
command:
- gunicorn
- --bind
- 127.0.0.1:8000
- comptest.wsgi
- frx_challenges.wsgi
securityContext:
runAsUser: 0
resources: {{ toJson .Values.resources }}
volumeMounts:
- name: storage
mountPath: /opt/state
- name: django-yamlconf
mountPath: /opt/frx-challenges/comptest/comptest.yaml
subPath: comptest.yaml
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
- name: dind
image: {{ .Values.dind.image.repository }}:{{ .Values.dind.image.tag }}
command:
Expand All @@ -128,7 +124,6 @@ spec:
- name: evaluator
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
workingDir: /opt/frx-challenges/comptest
command:
- python
- manage.py
Expand All @@ -139,8 +134,8 @@ spec:
- name: storage
mountPath: /opt/state
- name: django-yamlconf
mountPath: /opt/frx-challenges/comptest/comptest.yaml
subPath: comptest.yaml
mountPath: /opt/frx-challenges/frx_challenges/frx_challenges.yaml
subPath: frx_challenges.yaml
env:
- name: DOCKER_HOST
value: tcp://127.0.0.1:2376
Expand Down

0 comments on commit 112146b

Please sign in to comment.