diff --git a/.github/workflows/custom_docker_builds.yml b/.github/workflows/custom_docker_builds.yml index 5b78d353a..6882b2b6b 100644 --- a/.github/workflows/custom_docker_builds.yml +++ b/.github/workflows/custom_docker_builds.yml @@ -45,7 +45,7 @@ jobs: - docker-image: ./images/cache-indexer image-tags: ghcr.io/spack/cache-indexer:0.0.6 - docker-image: ./analytics - image-tags: ghcr.io/spack/django:0.5.3 + image-tags: ghcr.io/spack/django:0.5.4 - docker-image: ./images/ci-prune-buildcache image-tags: ghcr.io/spack/ci-prune-buildcache:0.0.4 - docker-image: ./images/protected-publish diff --git a/analytics/Dockerfile b/analytics/Dockerfile index 9167af7e5..296aca197 100644 --- a/analytics/Dockerfile +++ b/analytics/Dockerfile @@ -29,6 +29,4 @@ RUN pip install -r requirements.txt COPY . . -RUN chmod +x ./entrypoint.sh -ENTRYPOINT [ "./entrypoint.sh" ] CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--access-logfile", "-", "analytics.wsgi"] diff --git a/analytics/entrypoint.sh b/analytics/entrypoint.sh deleted file mode 100644 index bc38904c5..000000000 --- a/analytics/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -e - -# Always run migrate when invoking this image -python manage.py migrate - -# This will exec the CMD passed to docker, i.e. "gunicorn" or "celery" -exec "$@" diff --git a/k8s/production/custom/webhook-handler/deployments.yaml b/k8s/production/custom/webhook-handler/deploy/deployments.yaml similarity index 98% rename from k8s/production/custom/webhook-handler/deployments.yaml rename to k8s/production/custom/webhook-handler/deploy/deployments.yaml index a866b146d..9f6a0963e 100644 --- a/k8s/production/custom/webhook-handler/deployments.yaml +++ b/k8s/production/custom/webhook-handler/deploy/deployments.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: webhook-handler containers: - name: webhook-handler - image: ghcr.io/spack/django:0.5.3 + image: ghcr.io/spack/django:0.5.4 imagePullPolicy: Always resources: requests: @@ -146,7 +146,7 @@ spec: serviceAccountName: webhook-handler containers: - name: webhook-handler-worker - image: ghcr.io/spack/django:0.5.3 + image: ghcr.io/spack/django:0.5.4 command: [ "celery", diff --git a/k8s/production/custom/webhook-handler/service-accounts.yaml b/k8s/production/custom/webhook-handler/deploy/service-accounts.yaml similarity index 100% rename from k8s/production/custom/webhook-handler/service-accounts.yaml rename to k8s/production/custom/webhook-handler/deploy/service-accounts.yaml diff --git a/k8s/production/custom/webhook-handler/services.yaml b/k8s/production/custom/webhook-handler/deploy/services.yaml similarity index 100% rename from k8s/production/custom/webhook-handler/services.yaml rename to k8s/production/custom/webhook-handler/deploy/services.yaml diff --git a/k8s/production/custom/webhook-handler/flux/deploy.yaml b/k8s/production/custom/webhook-handler/flux/deploy.yaml new file mode 100644 index 000000000..631a09a43 --- /dev/null +++ b/k8s/production/custom/webhook-handler/flux/deploy.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: webhook-handler-deploy +spec: + dependsOn: + - name: webhook-handler-pre-deploy + sourceRef: + kind: GitRepository + name: flux-system + path: "./deploy/" + interval: 5m + timeout: 5m + prune: true + wait: true diff --git a/k8s/production/custom/webhook-handler/flux/pre-deploy.yaml b/k8s/production/custom/webhook-handler/flux/pre-deploy.yaml new file mode 100644 index 000000000..d1bfe31a3 --- /dev/null +++ b/k8s/production/custom/webhook-handler/flux/pre-deploy.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: webhook-handler-pre-deploy +spec: + sourceRef: + kind: GitRepository + name: flux-system + path: "./pre-deploy/" + interval: 5m + timeout: 5m + prune: true + wait: true + force: true diff --git a/k8s/production/custom/webhook-handler/pre-deploy/migration.job.yaml b/k8s/production/custom/webhook-handler/pre-deploy/migration.job.yaml new file mode 100644 index 000000000..f238b8051 --- /dev/null +++ b/k8s/production/custom/webhook-handler/pre-deploy/migration.job.yaml @@ -0,0 +1,15 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: webhook-handler-db-migration +spec: + template: + spec: + restartPolicy: Never + containers: + - name: migration + image: ghcr.io/spack/django:0.5.4 + command: + - python + - manage.py + - migrate