Skip to content

Commit

Permalink
Merge pull request #398 from uw-it-aca/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jlaney authored Oct 11, 2023
2 parents ef45ff4 + 0d4a14f commit 3959749
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
python -m pip install --upgrade pip coverage coveralls==2.2.0
python -m pip install --upgrade pip coverage coveralls==3.3.1
coverage combine
coveralls
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG DJANGO_CONTAINER_VERSION=1.4.1

FROM gcr.io/uwit-mci-axdd/django-container:${DJANGO_CONTAINER_VERSION} as app-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-container:${DJANGO_CONTAINER_VERSION} as app-container

USER root

RUN apt-get update && apt-get install mysql-client libmysqlclient-dev -y
RUN apt-get update && apt-get install libpq-dev -y

USER acait

Expand All @@ -14,15 +14,15 @@ ADD --chown=acait:acait docker/app_start.sh /scripts
RUN chmod u+x /scripts/app_start.sh

RUN /app/bin/pip install -r requirements.txt
RUN /app/bin/pip install mysqlclient
RUN /app/bin/pip install psycopg2

RUN . /app/bin/activate && pip install nodeenv && nodeenv -p &&\
npm install -g npm && ./bin/npm install less -g

RUN . /app/bin/activate && python manage.py collectstatic --noinput &&\
python manage.py compress -f

FROM gcr.io/uwit-mci-axdd/django-test-container:${DJANGO_CONTAINER_VERSION} as app-test-container
FROM us-docker.pkg.dev/uwit-mci-axdd/containers/django-test-container:${DJANGO_CONTAINER_VERSION} as app-test-container

COPY --from=app-container /app/ /app/
COPY --from=app-container /static/ /static/
42 changes: 42 additions & 0 deletions course_grader/migrations/0009_auto_20231009_1656.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Generated by Django 3.2.22 on 2023-10-09 23:56

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('course_grader', '0008_auto_20211103_1911'),
]

operations = [
migrations.AlterField(
model_name='gradeimport',
name='source',
field=models.CharField(choices=[('canvas', 'Canvas Gradebook'), ('catalyst', 'Catalyst Gradebook'), ('csv', 'CSV File')], max_length=20),
),
migrations.AddIndex(
model_name='grade',
index=models.Index(fields=['section_id', 'modified_by'], name='course_grad_section_fdf9ae_idx'),
),
migrations.AddIndex(
model_name='gradeimport',
index=models.Index(fields=['term_id'], name='course_grad_term_id_dd39ee_idx'),
),
migrations.AddIndex(
model_name='submittedgraderoster',
index=models.Index(fields=['secondary_section_id'], name='course_grad_seconda_c11485_idx'),
),
migrations.AddIndex(
model_name='submittedgraderoster',
index=models.Index(fields=['section_id'], name='course_grad_section_3de2a4_idx'),
),
migrations.AddIndex(
model_name='submittedgraderoster',
index=models.Index(fields=['term_id'], name='course_grad_term_id_b59da5_idx'),
),
migrations.AddIndex(
model_name='submittedgraderoster',
index=models.Index(fields=['accepted_date'], name='course_grad_accepte_536d57_idx'),
),
]
16 changes: 16 additions & 0 deletions course_grader/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ class SubmittedGradeRoster(models.Model):

objects = SubmittedGradeRosterManager()

class Meta:
indexes = [
models.Index(fields=["secondary_section_id"]),
models.Index(fields=["section_id"]),
models.Index(fields=["term_id"]),
models.Index(fields=["accepted_date"]),
]

def submission_id(self):
if self.secondary_section_id is not None:
return self.secondary_section_id.split("/")[-1]
Expand Down Expand Up @@ -151,6 +159,9 @@ def json_data(self):
class Meta:
unique_together = ("section_id", "student_reg_id", "duplicate_code",
"modified_by")
indexes = [
models.Index(fields=["section_id", "modified_by"]),
]


class ImportConversion(models.Model):
Expand Down Expand Up @@ -288,6 +299,11 @@ class GradeImport(models.Model):

objects = GradeImportManager()

class Meta:
indexes = [
models.Index(fields=["term_id"]),
]

def grades_for_section(self, section, instructor, fileobj=None):
module = self._IMPORT_CLASSES[self.source]
module_name, class_name = module.rsplit(".", 1)
Expand Down
6 changes: 3 additions & 3 deletions docker/prod-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ externalService:
enabled: true
name: gradepage-db-service
type: ClusterIP
serviceAddress: 172.18.0.16
servicePort: 3306
serviceAddress: 172.18.1.70
servicePort: 5432
database:
engine: mysql
engine: postgres
name: gradepage_prod
hostname: gradepage-db-service
secretName: gradepage.uw.edu-sql-secrets
Expand Down
6 changes: 3 additions & 3 deletions docker/test-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ externalService:
enabled: true
name: gradepage-db-service
type: ClusterIP
serviceAddress: 172.18.0.16
servicePort: 3306
serviceAddress: 172.18.1.70
servicePort: 5432
database:
engine: mysql
engine: postgres
name: gradepage_test
hostname: gradepage-db-service
secretName: test.gradepage.uw.edu-sql-secrets
Expand Down

0 comments on commit 3959749

Please sign in to comment.