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

ci: k8s deployment files #7416

Merged
merged 72 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
661941d
feat: Split datatracker/celery start scripts (#6974)
jennifer-richards Jan 26, 2024
ff228a5
feat: merge dt and celery container builds (#6973)
rjsparks Jan 26, 2024
c867d6f
ci: helm values + deployment files for all 5 services (wip)
NGPixel Jan 26, 2024
f980954
ci: add missing "&&"
jennifer-richards Mar 12, 2024
bf74f2d
ci: still need to chmod start.sh
jennifer-richards Mar 12, 2024
6ed19bb
ci: nearly deployable helm chart (wip) (#7176)
jennifer-richards Mar 12, 2024
dca77db
ci: package and push helm chart
jennifer-richards Mar 12, 2024
cd22501
ci: Memcached service (#7185)
jennifer-richards Mar 15, 2024
f91ea45
chore: CRLF -> LF (#7214)
rjsparks Mar 17, 2024
c637299
ci: use datatracker image values for celery/beat (#7213)
jennifer-richards Mar 17, 2024
0faf4d8
ci: Update Dockerfile
NGPixel Mar 17, 2024
f6db3e8
ci: Update Dockerfile
NGPixel Mar 17, 2024
c987bac
ci: Rabbitmq progress (wip) (#7233)
jennifer-richards Mar 19, 2024
f1e6c37
ci: give rabbitmq a persistent volume claim (#7235)
jennifer-richards Mar 19, 2024
b36ff61
feat: use gunicorn (#7215)
rjsparks Mar 20, 2024
ad34104
ci: Deploy rabbitmq with a password (#7239)
jennifer-richards Mar 20, 2024
1c90789
chore: reduce worker count and disable live checks for the datatracke…
rjsparks Mar 20, 2024
7a238a3
ci: collectstatic --no-input (#7252)
jennifer-richards Mar 26, 2024
e3d0290
ci: install libreoffice (#7262)
jennifer-richards Mar 27, 2024
f58bbc3
ci: parameterize / update settings (#7248)
jennifer-richards Mar 27, 2024
253ba1d
fix: mypy/flakes lint
jennifer-richards Mar 28, 2024
8872e31
ci: Get APP_API_TOKENS from env (#7271)
jennifer-richards Apr 2, 2024
46e521e
ci: shared PersistentVolumeClaim on /a (#7283)
jennifer-richards Apr 2, 2024
c4a2ea9
ci: Adjust secrets in values.yaml (#7288)
jennifer-richards Apr 3, 2024
206a4bb
ci: clean up labels and service values (#7314)
jennifer-richards Apr 11, 2024
e99286f
ci: use values for PVClaims, STATIC_URL (#7317)
jennifer-richards Apr 12, 2024
39d2199
ci: allow override of csrf_trusted_origins
jennifer-richards Apr 12, 2024
8a4fcf7
ci: comment out DATATRACKER_STATIC_URL env
jennifer-richards Apr 12, 2024
48f9080
ci: collect statics when building image
jennifer-richards Apr 12, 2024
ebaf6b5
ci: quotes around shell parameters
jennifer-richards Apr 15, 2024
c81b5f7
ci: nindent instead of indent
jennifer-richards Apr 15, 2024
ac51551
ci: label PVCs
jennifer-richards Apr 15, 2024
64441be
chore: Remove accidentally committed file
jennifer-richards Apr 15, 2024
ffcf74b
chore: Remove accidental commits... (#7329)
jennifer-richards Apr 15, 2024
90dc303
ci: Add scoutapm sidecar container (#7330)
jennifer-richards Apr 16, 2024
d14cbd1
ci: refactor scout sidecar (#7338)
jennifer-richards Apr 18, 2024
6ccde89
ci: do not re-run yarn / collectstatics (#7353)
jennifer-richards Apr 23, 2024
26f2306
ci: add scout container to celery pod (#7354)
jennifer-richards Apr 23, 2024
b50e60b
ci: default to static.ietf.org in helm chart
jennifer-richards Apr 23, 2024
9379bba
ci: remove reminder comment
jennifer-richards Apr 23, 2024
2c9c61d
ci: more memcached mem; set securityContext (#7356)
jennifer-richards Apr 24, 2024
30a4a5a
ci: run rabbitmq as non-root (#7362)
jennifer-richards Apr 24, 2024
c8ee43d
ci: run datatracker pod as non-root user (#7366)
jennifer-richards Apr 25, 2024
70c3225
ci: non-root user for scout containers
jennifer-richards Apr 25, 2024
4e2b9ce
ci: Non-root for celery containers (#7368)
jennifer-richards Apr 25, 2024
8f87573
ci: Fill in settings_local for docker
jennifer-richards Apr 25, 2024
d2623de
feat: config celery logging via Django (#7371)
jennifer-richards Apr 26, 2024
e35b46e
ci: fix celery scout env var names (#7373)
jennifer-richards Apr 26, 2024
3ea70f2
refactor: helm to kustomize (wip)
NGPixel May 4, 2024
0a3bb9e
refactor: move node affinity to upstream
NGPixel May 4, 2024
24309c2
refactor: move nfs entry upstream
NGPixel May 4, 2024
05bd47c
chore: add rabbitmq vol claim template
NGPixel May 4, 2024
d075404
refactor: add beat + celery deployments
NGPixel May 5, 2024
867360e
ci: k8s fixup (#7401)
jennifer-richards May 9, 2024
7e56b2e
ci: drop helm chart GHA step
jennifer-richards May 10, 2024
dd46a8a
ci: use ietfa uid/gid for datatracker user (#7407)
jennifer-richards May 10, 2024
3a4939c
ci: collect memcached metrics (#7410)
jennifer-richards May 10, 2024
8b3d330
ci: metrics.portName annotation
jennifer-richards May 10, 2024
49a3cdc
ci: "true"
jennifer-richards May 11, 2024
c1a7a60
ci: handle b64-encoded APP_API_TOKENS
jennifer-richards May 13, 2024
5486345
ci: remove unnecessary helper
jennifer-richards May 13, 2024
212a915
ci: don't set APP_API_TOKENS in django-config
jennifer-richards May 13, 2024
b744f2b
chore: switch back to uid/gid=1000
jennifer-richards May 13, 2024
38b0b2c
feat: get tool versions without VersionInfo model (#7393) (#7403)
jennifer-richards May 13, 2024
635ca28
chore: remove helm stuff
NGPixel May 14, 2024
6cb0fa5
chore: Remove helm config from .editorconfig
NGPixel May 14, 2024
ea0648d
Merge branch 'main' into feat/k8s
jennifer-richards May 14, 2024
2b81663
Merge branch 'refs/heads/main' into feat/k8s
jennifer-richards May 15, 2024
06b99fa
chore: remove unused import
jennifer-richards May 15, 2024
1c3825b
test: ensure logs only go to console during tests
jennifer-richards May 15, 2024
0d68646
chore: suppress pyflakes check
jennifer-richards May 15, 2024
d9c6ae7
chore: remove syslog handler from settings.py (#7427)
jennifer-richards May 16, 2024
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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ indent_size = 2

[ietf/**.html]
insert_final_newline = false

# Settings for Kubernetes yaml
# ---------------------------------------------------------
# Use 2-space indents
[k8s/**.yaml]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
.devcontainer
.github
.vscode
helm
k8s
playwright
svn-history
docker-compose.yml
Expand Down
56 changes: 39 additions & 17 deletions dev/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
LABEL maintainer="IETF Tools Team <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive

COPY . .
COPY ./dev/build/start.sh ./start.sh
RUN pip3 --disable-pip-version-check --no-cache-dir install -r requirements.txt
RUN chmod +x start.sh && \
chmod +x docker/scripts/app-create-dirs.sh && \
sh ./docker/scripts/app-create-dirs.sh

VOLUME [ "/assets" ]

EXPOSE 8000

CMD ["./start.sh"]
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
LABEL maintainer="IETF Tools Team <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive

# uid 498 = wwwrun and gid 496 = www on ietfa
RUN groupadd -g 1000 datatracker && \
useradd -c "Datatracker User" -u 1000 -g datatracker -m -s /bin/false datatracker

RUN apt-get purge -y imagemagick imagemagick-6-common

# Install libreoffice (needed via PPT2PDF_COMMAND)
RUN echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/bullseye-backports.list && \
apt-get update && \
apt-get -qyt bullseye-backports install libreoffice-nogui

COPY . .
COPY ./dev/build/start.sh ./start.sh
COPY ./dev/build/datatracker-start.sh ./datatracker-start.sh
COPY ./dev/build/celery-start.sh ./celery-start.sh

RUN pip3 --disable-pip-version-check --no-cache-dir install -r requirements.txt && \
echo '# empty' > ietf/settings_local.py && \
ietf/manage.py patch_libraries && \
rm -f ietf/settings_local.py

RUN chmod +x start.sh && \
chmod +x datatracker-start.sh && \
chmod +x celery-start.sh && \
chmod +x docker/scripts/app-create-dirs.sh && \
sh ./docker/scripts/app-create-dirs.sh

RUN mkdir -p /a

VOLUME [ "/a" ]

EXPOSE 8000

CMD ["./start.sh"]
22 changes: 22 additions & 0 deletions dev/build/celery-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# Run a celery worker
#
echo "Running Datatracker checks..."
./ietf/manage.py check

cleanup () {
# Cleanly terminate the celery app by sending it a TERM, then waiting for it to exit.
if [[ -n "${celery_pid}" ]]; then
echo "Gracefully terminating celery worker. This may take a few minutes if tasks are in progress..."
kill -TERM "${celery_pid}"
wait "${celery_pid}"
fi
}

trap 'trap "" TERM; cleanup' TERM

# start celery in the background so we can trap the TERM signal
celery "$@" &
celery_pid=$!
wait "${celery_pid}"
17 changes: 17 additions & 0 deletions dev/build/datatracker-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Running Datatracker checks..."
./ietf/manage.py check

echo "Running Datatracker migrations..."
./ietf/manage.py migrate --settings=settings_local

echo "Starting Datatracker..."

gunicorn \
--workers "${DATATRACKER_GUNICORN_WORKERS:-9}" \
--max-requests "${DATATRACKER_GUNICORN_MAX_REQUESTS:-32768}" \
--timeout "${DATATRACKER_GUNICORN_TIMEOUT:-180}" \
--bind :8000 \
--log-level "${DATATRACKER_GUNICORN_LOG_LEVEL:-info}" \
ietf.wsgi:application
28 changes: 19 additions & 9 deletions dev/build/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/bin/bash

echo "Running Datatracker checks..."
./ietf/manage.py check

echo "Running Datatracker migrations..."
./ietf/manage.py migrate --settings=settings_local

echo "Starting Datatracker..."
./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local
#
# Environment config:
#
# CONTAINER_ROLE - datatracker, celery, or beat (defaults to datatracker)
#
case "${CONTAINER_ROLE:-datatracker}" in
datatracker)
exec ./datatracker-start.sh
;;
celery)
exec ./celery-start.sh --app=ietf worker
;;
beat)
exec ./celery-start.sh --app=ietf beat
;;
*)
echo "Unknown role '${CONTAINER_ROLE}'"
exit 255
esac
23 changes: 0 additions & 23 deletions helm/.helmignore

This file was deleted.

23 changes: 0 additions & 23 deletions helm/Chart.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions helm/templates/_helpers.tpl

This file was deleted.

66 changes: 0 additions & 66 deletions helm/templates/deployment.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions helm/templates/hpa.yaml

This file was deleted.

Loading
Loading