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

Feature/eval me #253

Merged
merged 121 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
32e8d30
comment out auth and deprecated tests
David-Strupinski Mar 29, 2023
3b502f8
disable auth
David-Strupinski Mar 29, 2023
cb2ea85
fully remove auth
David-Strupinski Mar 29, 2023
673b58c
update to django 2.0.*
David-Strupinski Apr 4, 2023
a5bda63
fix ForeignKey fields in models
David-Strupinski Apr 4, 2023
983b4dd
update url patterns to new syntax
David-Strupinski Apr 4, 2023
f59ada0
remove django prometheus
David-Strupinski Apr 4, 2023
0be54bf
upgrade to django 2.2.*
David-Strupinski Apr 4, 2023
5141543
add django-oauth-toolkit auth, tests don't pass
David-Strupinski Apr 6, 2023
95707bd
add migrations back, problem with new Client persists
David-Strupinski Apr 6, 2023
3c8c3db
fix migration problem, tests still don't pass
David-Strupinski Apr 6, 2023
36758cf
remove Favorites
David-Strupinski Apr 7, 2023
e3bd137
remove reviews, ratings
David-Strupinski Apr 7, 2023
aa590c9
remove shared spaces
David-Strupinski Apr 7, 2023
a7f1acd
apply migrations
David-Strupinski Apr 7, 2023
c9fb3be
Seeing if this will even run on ubuntu 20.04
abztrakt Apr 11, 2023
98a8be0
update copyright year
David-Strupinski Apr 11, 2023
7c79a81
update copyright on non-checked files
David-Strupinski Apr 11, 2023
41b347e
Ubuntu 18 does not work anymore
abztrakt Apr 11, 2023
25ce5b4
Load spottypes
abztrakt Apr 11, 2023
1d54a48
Merge branch 'django-upgrade' into task/oauth-change
David-Strupinski Apr 13, 2023
b2541db
merge migrations
David-Strupinski Apr 13, 2023
761c355
comment out last of old auth, passes testts
David-Strupinski Apr 13, 2023
6444cf1
remove user_auth_required comments
David-Strupinski Apr 18, 2023
3d8fefa
update dummy fixture to use new client
David-Strupinski Apr 18, 2023
ecf9299
ignore vscode files
David-Strupinski Apr 20, 2023
fcc63b5
move admin site out of debug
David-Strupinski Apr 20, 2023
8f8c668
remove old comment
David-Strupinski Apr 20, 2023
e5ec3a5
update client
David-Strupinski Apr 20, 2023
0eb6d4b
lowercase all REST calls
David-Strupinski Apr 20, 2023
7005c13
add oauth2 endpoint views
David-Strupinski Apr 20, 2023
44bb481
pin django-cors-headers version
David-Strupinski May 8, 2023
cec1be9
remove access token field from Client model
David-Strupinski May 8, 2023
6a3e3d2
add register application command
David-Strupinski May 8, 2023
a992dce
add scoped oauth to views
David-Strupinski May 8, 2023
a7fe613
cleanup unused imports
David-Strupinski May 8, 2023
0789e60
update Dockerfile container version
David-Strupinski Jun 9, 2023
0560ab6
add option to show credential when registering app
David-Strupinski Jun 15, 2023
9532a23
fix scope checking
David-Strupinski Jun 21, 2023
3cb9b5a
remove unnecessary setting
David-Strupinski Jun 21, 2023
6e9b16c
make scope be validated only when oauth enabled
David-Strupinski Jun 21, 2023
8d7419c
fix old GET calls
David-Strupinski Jun 21, 2023
40f2cd3
remove unnecessary code from spot_put tests
David-Strupinski Jun 22, 2023
2c3a2a9
fix spot item put tests
David-Strupinski Jun 22, 2023
0813923
remove unused imports
David-Strupinski Jun 26, 2023
8120048
move resources folder
David-Strupinski Jun 26, 2023
a4d5cab
fix create sample spots
David-Strupinski Jun 26, 2023
037dbeb
fix allowed origins
David-Strupinski Jul 5, 2023
9edc812
remove old auth files, move oauth test file
David-Strupinski Jun 27, 2023
8dedb1f
fix create_consumer for new auth
David-Strupinski Jun 27, 2023
c4facc4
remove old auth tests
David-Strupinski Jun 27, 2023
c8e5747
change spotseeker oauth setting
David-Strupinski Jun 27, 2023
0b61f79
convert oauth override in tests
David-Strupinski Jun 27, 2023
a9fbd6a
remove unicode method
David-Strupinski Jun 27, 2023
1732caa
add expired token check in dispatch
David-Strupinski Jun 29, 2023
78cb4a9
remove unnecessary default
David-Strupinski Jun 29, 2023
f9dc67e
add doc to get_client_credentials()
David-Strupinski Jun 29, 2023
c8ded8d
fix oauth test
David-Strupinski Jun 29, 2023
272c463
remove unnecessary oauth test
David-Strupinski Jun 29, 2023
c5a41fc
remove OAUTH_ENABLED as an ENV var
David-Strupinski Jun 30, 2023
74b15de
remove TrustedOAuthClient
David-Strupinski Jun 29, 2023
c63e19d
remove old model from fixture
David-Strupinski Jun 29, 2023
8292a11
allow oauth to be enabled on debug
David-Strupinski Aug 2, 2023
5af250a
make a sample spot a study spot
David-Strupinski Aug 8, 2023
8dda308
allow spots to be updated to study spots
David-Strupinski Aug 8, 2023
71327e3
Merge pull request #217 from uw-it-aca/develop
abztrakt Aug 15, 2023
267b378
Merge pull request #213 from uw-it-aca/task/oauth-change
abztrakt Aug 15, 2023
89e2c15
Add extensions so we can do a sqldiff
abztrakt Oct 10, 2023
fdacfc7
add extra techloan office to sample spots
David-Strupinski Nov 14, 2023
001aa64
add on_delete=models.CASCADE to all foreign keys
David-Strupinski Nov 21, 2023
5910de8
squash migrations
David-Strupinski Nov 21, 2023
7319e65
Restore dev-values.yml
abztrakt Nov 21, 2023
2a00741
Merge pull request #228 from uw-it-aca/task/prep-upgrade
abztrakt Nov 21, 2023
7965fdd
Re-add (again) dev-values and update cicd to use it
abztrakt Nov 21, 2023
b41422b
Merge pull request #231 from uw-it-aca/task/prep-upgrade
abztrakt Nov 21, 2023
ffc54bd
Merge branch 'feature/eval-me' into django-upgrade
abztrakt Nov 21, 2023
7648be1
Remove bad squashed migration
abztrakt Nov 21, 2023
4a4862f
Revert "Merge branch 'feature/eval-me' into django-upgrade"
David-Strupinski Nov 21, 2023
bc82cb2
Merge pull request #232 from uw-it-aca/django-upgrade
abztrakt Nov 21, 2023
015d573
Add these guys again?!
abztrakt Nov 21, 2023
9e0bd76
Fix prometheus 404s again?
abztrakt Nov 22, 2023
9b679af
Base settings have important stuff
abztrakt Nov 22, 2023
0666a10
Merge pull request #233 from uw-it-aca/feature/eval-me
abztrakt Nov 28, 2023
a37a584
set secret refresh interval lower on dev
abztrakt Feb 5, 2024
a2d306c
update UW copyright year
David-Strupinski Feb 5, 2024
1d70f65
refresh interval on the external, not environment secrets
abztrakt Feb 5, 2024
10b6121
refresh interval on the external secret
abztrakt Feb 5, 2024
d93840e
Back to default refresh interval
abztrakt Feb 6, 2024
6af6f45
update license headers
David-Strupinski Mar 1, 2024
bf7f464
fix migrations to let 6-8 work on develop
David-Strupinski Mar 4, 2024
4f4c8f6
simplify migrations
David-Strupinski Mar 4, 2024
d5debda
remove unused imports
David-Strupinski Mar 4, 2024
cf1ec49
Merge pull request #239 from uw-it-aca/fix-migrations
abztrakt Apr 2, 2024
a486f8e
update license headers and remove unneeded files
David-Strupinski Mar 1, 2024
a21b1a3
Merge branch 'temp-develop' into django-upgrade
abztrakt Apr 2, 2024
3abb7b5
use modified django-oauth-plus
David-Strupinski Apr 18, 2024
dc46f45
Merge branch 'develop' into django-upgrade-new
David-Strupinski Apr 18, 2024
34612e9
String instead of bool
abztrakt May 1, 2024
87a54e5
try to fix migration issues, fully remove old oauth_provider
David-Strupinski May 3, 2024
7604441
fix style :(
David-Strupinski May 3, 2024
f89f528
Merge pull request #245 from uw-it-aca/django-upgrade-new-2
abztrakt May 3, 2024
98d56a5
Move to scout-v2
abztrakt Feb 11, 2025
cbeb8b8
Use django container 1.4.2
abztrakt Feb 11, 2025
5d8ca38
A couple of PEP8 fixes
abztrakt Feb 11, 2025
bb3e594
isinstance() over ==, per pycodestyle
abztrakt Feb 11, 2025
05f4106
Update django-container version to latest
abztrakt Feb 11, 2025
aeff017
Update github action
abztrakt Feb 11, 2025
b16f1a4
Appease the GitHub warning
abztrakt Feb 11, 2025
c490026
Merge pull request #246 from uw-it-aca/postgres
abztrakt Feb 11, 2025
fbe7e52
Update to use postgres client
abztrakt Feb 12, 2025
fa80507
psychopg2 was needed after all
abztrakt Feb 12, 2025
d24430f
Merge branch 'feature/eval-me' into mysql-to-postgresv2
abztrakt Feb 12, 2025
875bd99
Merge pull request #248 from uw-it-aca/mysql-to-postgresv2
abztrakt Feb 12, 2025
bd28d49
Really just a commit to trigger github action run
abztrakt Feb 12, 2025
f44e822
Revert "Really just a commit to trigger github action run"
abztrakt Feb 13, 2025
f01e021
Internal IP
abztrakt Feb 13, 2025
1638f8e
Use the correct VPC
abztrakt Feb 13, 2025
03ecb81
Start with fresh migration
abztrakt Feb 21, 2025
1ba06fc
Merge pull request #250 from uw-it-aca/new-migration
abztrakt Feb 21, 2025
ef034ee
Update test values for postgres db
abztrakt Mar 7, 2025
aec8dbe
Merge pull request #251 from uw-it-aca/django-upgrade
abztrakt Mar 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ on:

jobs:
context:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

outputs:
commit_hash: ${{ steps.context.outputs.commit_hash }}
Expand All @@ -62,18 +62,18 @@ jobs:
release_name: ${{ env.RELEASE_NAME }}

build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

needs: context

steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.6
python-version: '3.10'

# This repo can't use the standard pycodestyle / license checker because
# of code contributed from other institutions
Expand Down Expand Up @@ -107,19 +107,20 @@ jobs:
# fi

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-$(echo ${{ hashFiles('Dockerfile') }} | head -c 16)
restore-keys: |
${{ runner.os }}-buildx-

- name: Build App Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
target: app-container
tags: ${{ needs.context.outputs.image_tag }}
push: false
Expand All @@ -128,7 +129,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Build Test Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
target: app-test-container
tags: app-test-container
Expand All @@ -151,7 +152,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 All @@ -170,11 +171,11 @@ jobs:
outputs:
context: ${{ steps.context.outputs.context }}

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Deployment Pipeline
if: >-
Expand All @@ -195,19 +196,19 @@ jobs:
commit_hash: ${{ needs.context.outputs.commit_hash }}
git_repo_branch: ${{ needs.context.outputs.git_repo_branch }}
gh_auth_token: ${{ secrets.GH_AUTH_TOKEN }}
app_instance: eval
app_instance: dev

- name: 'Surface context from executed build step'
id: context
shell: bash
run: echo "::set-output name=context::$(< ${CONTEXT_FILENAME})"
run: echo "context=$(< ${CONTEXT_FILENAME})" >> $GITHUB_OUTPUT

housekeeping:
if: github.event_name == 'push'

needs: [context, build, deploy]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: House Keeping
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spotseeker_web
# IDE files
.idea/

# vscode files
.vscode/

# pipenv
Pipfile
Pipfile.lock
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG DJANGO_CONTAINER_VERSION=1.3.8
ARG DJANGO_CONTAINER_VERSION=2.0.8

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

ADD --chown=acait:acait setup.py /app/
Expand All @@ -18,7 +18,7 @@ COPY --chown=acait:acait docker/test_settings.py project/test_settings.py
ADD --chown=acait:acait docker/app_start.sh /scripts
RUN chmod u+x /scripts/app_start.sh

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=0 /app/ /app/
COPY --from=0 /static/ /static/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "${PORT:-8000}:8000"
environment:
ENV: localdev
AUTH_MODULE: ${AUTH_MODULE:-all_ok}
SPOTSEEKER_OAUTH_ENABLED: ${SPOTSEEKER_OAUTH_ENABLED}
SPOTSEEKER_AUTH_ADMINS: ${SPOTSEEKER_AUTH_ADMINS}
SPOTSEEKER_WEB_SERVER_HOST: ${SPOTSEEKER_WEB_SERVER_HOST}
SPOTSEEKER_WEB_OAUTH_KEY: ${SPOTSEEKER_WEB_OAUTH_KEY}
Expand Down
8 changes: 3 additions & 5 deletions docker/app_start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash

if [ "$ENV" = "localdev" ]
then
if [ "$ENV" = "localdev" ]; then

python manage.py migrate
python manage.py loaddata uw.json
python manage.py loaddata dummy_oauth.json
python manage.py migrate
python manage.py loaddata uw.json

fi
156 changes: 156 additions & 0 deletions docker/dev-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 1
ingress:
enabled: true
tls:
spotseeker:
secretName: dev.api.scout.uw.edu-ingress-cert
hosts:
- dev.api.scout.uw.edu
hosts:
spotseeker:
host: dev.api.scout.uw.edu
paths:
- "/"
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/client-body-buffer-size: "16K"
nginx.ingress.kubernetes.io/proxy-body-size: "20m"
nginx.ingress.kubernetes.io/proxy-read-timeout: "500"
nginx.ingress.kubernetes.io/ssl-ciphers: "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256"
lifecycle:
enabled: true
preStop:
enabled: true
affinity:
podsSpanNodes: true
readiness:
enabled: true
securityPolicy:
enabled: true
externalService:
enabled: true
name: spotseeker-dev-db-service
type: ClusterIP
serviceAddress: 172.18.0.4
servicePort: 5432
database:
engine: postgres
name: api_dev
hostname: spotseeker-dev-db-service
secretName: dev.api.scout.uw.edu-sql-secrets
repo: spotseeker
instance: dev
image:
repository: gcr.io/uwit-mci-axdd/spotseeker
tag: IMAGE_TAG
memcached:
enabled: true
replicaCount: 1
updateStrategy:
type: RollingUpdate
gcsCredentials:
mounted: true
secretName: dev.api.scout.uw.edu-gc-service-credentials
cronjob:
enabled: false
jobs:
- name: sync-techloan
schedule: "0,15,30,45 * * * *"
command: ["/scripts/management_command.sh"]
args: ["sync_techloan"]
daemon:
enabled: false # cronjob is probably more appropriate
daemons:
- name: sync-techloan
replicaCount: 1
command: ["/scripts/management_daemon.sh"]
args: ["--delay", "300", "sync_techloan"]
environmentVariables:
- name: AUTH_MODULE
value: oauth
- name: CLUSTER_CNAME
value: dev.api.scout.uw.edu
- name: ENV
value: dev
- name: WEBSERVER
value: nginx
- name: CACHE_MAX_ENTRIES
value: "1000"
- name: CACHE_TIMEOUT
value: "86400"
externalSecrets:
enabled: true
secrets:
- name: dev.api.scout.uw.edu-secrets
externalKey: axdd/kv/data/scout/dev-api/secrets
data:
- name: django-secret
property: django-secret
- name: spotseeker-auth-admins
property: spotseeker-auth-admins
- name: storage-bucket-name
property: storage-bucket-name
- name: storage-project-id
property: storage-project-id
- name: spotseeker-techloan-url
property: spotseeker-techloan-url
- name: spotseeker-web-server-host
property: spotseeker-web-server-host
- name: spotseeker-web-oauth-key
property: spotseeker-web-oauth-key
- name: spotseeker-web-oauth-secret
property: spotseeker-web-oauth-secret
- name: spotseeker-web-oauth-user
property: spotseeker-web-oauth-user
- name: dev.api.scout.uw.edu-sql-secrets
externalKey: axdd/kv/data/scout/common/sql-secrets
data:
- name: username
property: username
- name: password
property: password
- name: dev.api.scout.uw.edu-gc-service-credentials
externalKey: axdd/kv/data/scout/common/gc-service-credentials
data:
- name: credentials.json
property: credentials.json
environmentVariablesSecrets:
djangoSecret:
name: DJANGO_SECRET
secretName: dev.api.scout.uw.edu-secrets
secretKey: django-secret
spotseekerAuthAdmins:
name: SPOTSEEKER_AUTH_ADMINS
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-auth-admins
storageBucketName:
name: STORAGE_BUCKET_NAME
secretName: dev.api.scout.uw.edu-secrets
secretKey: storage-bucket-name
storageProjectId:
name: STORAGE_PROJECT_ID
secretName: dev.api.scout.uw.edu-secrets
secretKey: storage-project-id
spotseekerTechloanUrl:
name: SPOTSEEKER_TECHLOAN_URL
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-techloan-url
spotseekerWebServerHost:
name: SPOTSEEKER_WEB_SERVER_HOST
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-web-server-host
spotseekerWebOauthKey:
name: SPOTSEEKER_WEB_OAUTH_KEY
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-web-oauth-key
spotseekerWebOauthSecret:
name: SPOTSEEKER_WEB_OAUTH_SECRET
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-web-oauth-secret
spotseekerWebOauthUser:
name: SPOTSEEKER_WEB_OAUTH_USER
secretName: dev.api.scout.uw.edu-secrets
secretKey: spotseeker-web-oauth-user
4 changes: 2 additions & 2 deletions docker/prod-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ daemon:
command: ["/scripts/management_daemon.sh"]
args: ["--delay", "300", "sync_techloan"]
environmentVariables:
- name: AUTH_MODULE
value: oauth
- name: SPOTSEEKER_OAUTH_ENABLED
value: true
- name: CLUSTER_CNAME
value: api.scout.uw.edu
- name: ENV
Expand Down
Loading