diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 61ebfd5b..e364671c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -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 }} @@ -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 @@ -107,10 +107,10 @@ 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) @@ -118,8 +118,9 @@ jobs: ${{ 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 @@ -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 @@ -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 @@ -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: >- @@ -200,14 +201,14 @@ jobs: - 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 diff --git a/Dockerfile b/Dockerfile index 1a55804f..490feda9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG DJANGO_CONTAINER_VERSION=1.4.1 +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 @@ -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/ diff --git a/docker/dev-values.yml b/docker/dev-values.yml index a4cfef1c..d80fb10d 100644 --- a/docker/dev-values.yml +++ b/docker/dev-values.yml @@ -34,8 +34,8 @@ externalService: enabled: true name: spotseeker-dev-db-service type: ClusterIP - serviceAddress: 172.18.0.196 - servicePort: 3306 + serviceAddress: 34.83.34.217 + servicePort: 5432 database: engine: mysql name: api_dev diff --git a/spotseeker_server/admin.py b/spotseeker_server/admin.py index 2f22683a..cc25d081 100644 --- a/spotseeker_server/admin.py +++ b/spotseeker_server/admin.py @@ -1,10 +1,11 @@ # Copyright 2024 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 -""" Changes - ================================================================= +""" +Changes +================================================================= - sbutler1@illinois.edu: use the same forms as used for REST. +sbutler1@illinois.edu: use the same forms as used for REST. """ from django.contrib import admin @@ -80,7 +81,7 @@ def get_actions(self, request): return actions def delete_model(self, request, queryset): - if type(queryset) == SpotImage: + if isinstance(type(queryset), SpotImage): queryset.delete() else: for spot_image in queryset.all(): @@ -155,7 +156,7 @@ def get_actions(self, request): return actions def delete_model(self, request, queryset): - if type(queryset) == ItemImage: + if isinstance(type(queryset), ItemImage): queryset.delete() else: for item_image in queryset.all(): diff --git a/spotseeker_server/test/item/form.py b/spotseeker_server/test/item/form.py index 5d68ecee..118c7788 100644 --- a/spotseeker_server/test/item/form.py +++ b/spotseeker_server/test/item/form.py @@ -4,7 +4,7 @@ from django.test import TestCase from django.test.utils import override_settings from spotseeker_server.forms.item import ItemForm, ItemExtendedInfoForm -from spotseeker_server.default_forms.item import DefaultItemForm,\ +from spotseeker_server.default_forms.item import DefaultItemForm, \ DefaultItemExtendedInfoForm