Skip to content

Commit

Permalink
Merge branch 'release/v2.6' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Thornton committed May 23, 2022
2 parents c2927b1 + daa221b commit 35d4059
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ parameters.*
.vscode/
# for pyenv local
.python-version

# files generated via `runserver_plus` CLI command
*.crt
*.key
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# syntax=docker/dockerfile:experimental

FROM 482956169056.dkr.ecr.us-east-1.amazonaws.com/uw/python-postgres-build:v0.5 as build
FROM 482956169056.dkr.ecr.us-east-1.amazonaws.com/uw/python-postgres-build:v3.10 as build
COPY canvas_manage_course/requirements/*.txt /code/
RUN --mount=type=ssh,id=build_ssh_key ./python_venv/bin/pip3 install wheel gunicorn && ./python_venv/bin/pip3 install -r aws.txt
RUN --mount=type=ssh,id=build_ssh_key ./python_venv/bin/pip install wheel gunicorn && ./python_venv/bin/pip install -r aws.txt
COPY . /code/
RUN chmod a+x /code/docker-entrypoint.sh

FROM 482956169056.dkr.ecr.us-east-1.amazonaws.com/uw/python-postgres-base:v0.5
FROM 482956169056.dkr.ecr.us-east-1.amazonaws.com/uw/python-postgres-base:v3.10
COPY --from=build /code /code/
ENV PYTHONUNBUFFERED 1
WORKDIR /code
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Particular difficulties are sometimes found when installing the following direct

Run, and ensure the ENV environment var will be able to point the django-ssm-parameter-store library to appropriate SSM params (either locally, via a file, or on SSM, in which case ensure your local default AWS profile is authenticated to the correct environment and that you're on VPN so you can connect to non-local databases and caches).

Note that the django-sslserver default server and port is 127.0.0.1:8000. If your LTI configuration was set up with a different port, e.g. 8443, you'll need to specify it as in the snippet below.
Note that the runserver_plus default server and port is 127.0.0.1:8000. If your LTI configuration was set up with a different port, e.g. 8443, you'll need to specify it as in the snippet below.

```sh
export ENV=dev
export DJANGO_SETTINGS_MODULE=canvas_manage_course.settings.local
# ensure you're connected to VPN
python manage.py runsslserver
python manage.py runserver_plus --cert-file cert.crt
# to use a different port:
# python manage.py runsslserver 127.0.0.1:8443
python manage.py runserver_plus 127.0.0.1:8443 --cert-file cert.crt
```

Access at https://local.tlt.harvard.edu:(port)/.
Expand Down
36 changes: 18 additions & 18 deletions canvas_manage_course/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
boto3==1.21.35
Django==2.2.27
cx-Oracle==7.2.2
django-allow-cidr==0.3.1
boto3==1.22.5
Django==3.2.13
cx-Oracle==8.3.0
django-allow-cidr==0.4.0
django-cached-authentication-middleware==0.2.2
django-redis-cache==2.0.0
hiredis==1.0.0
kitchen==1.2.4
redis==3.3.8
psycopg2==2.8.6
django-redis-cache==3.0.1
hiredis==2.0.0
kitchen==1.2.6
redis==3.5.3
psycopg2==2.9.3
requests==2.27.1
django-storages==1.7.1
django_rq==2.1.0
django-watchman==1.2.0
splunk_handler==2.2.0
python-json-logger==0.1.11
django-storages==1.12.3
django_rq==2.5.1
django-watchman==1.3.0
splunk_handler==3.0.0
python-json-logger==2.0.2


git+ssh://[email protected]/penzance/[email protected]#egg=canvas-python-sdk==1.2.0
git+ssh://[email protected]/Harvard-University-iCommons/django-auth-lti.git@v2.0.4#egg=django-auth-lti==2.0.4
git+ssh://[email protected]/Harvard-University-iCommons/django-auth-lti.git@v2.1.0#egg=django-auth-lti==2.1.0

git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-common.git@v2.5#egg=django-icommons-common==2.5
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-ui.git@v2.0#egg=django-icommons-ui==2.0
git+ssh://[email protected]/Harvard-University-iCommons/django-canvas-lti-school-permissions@v1.0#egg=django-canvas-lti-school-permissions==1.0
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-common.git@v2.6#egg=django-icommons-common==2.6
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-ui.git@v2.1#egg=django-icommons-ui==2.1
git+ssh://[email protected]/Harvard-University-iCommons/django-canvas-lti-school-permissions@v2.0#egg=django-canvas-lti-school-permissions==2.0
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-ssm-parameter-store==0.6
18 changes: 11 additions & 7 deletions canvas_manage_course/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

# below are requirements specific to the local environment

ddt==1.1.1
django-debug-toolbar==3.2.1
django-sslserver==0.21
ddt==1.4.4
django-debug-toolbar==3.4.0


mock==2.0.0
pyvirtualdisplay==0.2.1
requests-oauthlib==0.8.0
selenium==2.53.2
xlrd==1.0.0
PyVirtualDisplay==3.0
requests-oauthlib==1.3.1
selenium==4.1.5
xlrd==2.0.1

# django-extensions + dependencies for `runserver_plus` local dev server
django-extensions==3.1.5
Werkzeug==2.0.3
pyOpenSSL==22.0.0

git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=selenium-common==1.4.3
2 changes: 1 addition & 1 deletion canvas_manage_course/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

INSTALLED_APPS += ['debug_toolbar', 'sslserver']
INSTALLED_APPS += ['debug_toolbar', 'django_extensions']
MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware']

# For Django Debug Toolbar:
Expand Down
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

./python_venv/bin/python3 manage.py migrate # Apply database migrations
./python_venv/bin/python3 manage.py collectstatic --noinput # Collect static files
./python_venv/bin/python manage.py migrate # Apply database migrations
./python_venv/bin/python manage.py collectstatic --noinput # Collect static files

# Start Gunicorn processes
echo Starting Gunicorn.
Expand Down
2 changes: 0 additions & 2 deletions manage_people/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ def get_enrollments_added_through_tool(sis_course_id):
# Canvas role labels for the enrollments
canvas_roles_by_role_id = get_roles_for_account_id('self')

logger.debug(f'canvas_roles_by_role_id: {canvas_roles_by_role_id}')

# Further filter users to remove users who may not yet be be in canvas.
# For the moment we are treating COURSEMANAGER as the single source of truth
# for who should be enrolled in a course, but we also need to get Canvas
Expand Down

0 comments on commit 35d4059

Please sign in to comment.