Skip to content

Commit

Permalink
Merge pull request #246 from uw-it-aca/postgres
Browse files Browse the repository at this point in the history
Move to scout-v2
  • Loading branch information
abztrakt authored Feb 11, 2025
2 parents f89f528 + b16f1a4 commit c490026
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
29 changes: 15 additions & 14 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 @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
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
4 changes: 2 additions & 2 deletions docker/dev-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions spotseeker_server/admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright 2024 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

""" Changes
=================================================================
"""
Changes
=================================================================
[email protected]: use the same forms as used for REST.
[email protected]: use the same forms as used for REST.
"""

from django.contrib import admin
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion spotseeker_server/test/item/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit c490026

Please sign in to comment.