Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
f8ba357
chore(deps): bump actions/download-artifact from 4.1.4 to 4.1.7 (#7377)
dependabot[bot] Apr 29, 2024
428a424
chore(deps): bump slackapi/slack-github-action from 1.25.0 to 1.26.0 …
dependabot[bot] Apr 29, 2024
1e8b1ac
chore(deps): bump codecov/codecov-action from 4.2.0 to 4.3.0 (#7326)
dependabot[bot] Apr 29, 2024
64ff6b8
chore(deps): bump tar from 6.2.1 to 7.0.1 in /dev/diff in the npm gro…
dependabot[bot] Apr 29, 2024
000e6b7
chore(deps): bump tar in /dev/deploy-to-container in the npm group (#…
dependabot[bot] Apr 29, 2024
bd25bc6
fix: improve file investigation results (#7376)
rjsparks May 6, 2024
342905f
chore(deps): bump tar from 7.0.1 to 7.1.0 in /dev/diff in the npm gro…
dependabot[bot] May 6, 2024
5fbeb8c
chore(deps): bump tar in /dev/deploy-to-container in the npm group (#…
dependabot[bot] May 6, 2024
565486e
chore(deps): bump codecov/codecov-action from 4.3.0 to 4.3.1 (#7394)
dependabot[bot] May 6, 2024
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
c0a12fa
chore(deps): fix requirements.txt versions (#7414)
jennifer-richards May 14, 2024
ea0648d
Merge branch 'main' into feat/k8s
jennifer-richards May 14, 2024
235ac8b
refactor: idnits2 mgmt cmds -> tasks (#7421)
jennifer-richards May 14, 2024
48e0aa2
refactor: clean up logging (#7419)
jennifer-richards May 14, 2024
a4e0354
feat: get tool versions without VersionInfo model (#7418)
jennifer-richards May 14, 2024
46a00ac
refactor: sync to RFC Editor queue via celery (#7415)
jennifer-richards May 14, 2024
c9f3598
refactor: expire last calls via celery (#7417)
jennifer-richards May 15, 2024
c59d612
refactor: send_nomcom_reminders via celery task (#7424)
jennifer-richards May 15, 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
de8b3b5
ci: merge pull request #7416 from ietf-tools/feat/k8s
rjsparks May 16, 2024
ffb9eb1
refactor: generate I-D bibxml files via celery (#7426)
jennifer-richards May 16, 2024
a5f44df
refactor: generate 1wg-charters files via celery (#7428)
jennifer-richards May 16, 2024
d344f5f
ci: fix deploy-to-container script
NGPixel May 16, 2024
6f4459f
ci: update build.yml workflow
NGPixel May 17, 2024
ff633dc
ci: Update build.yml
NGPixel May 18, 2024
8315c66
feat: copy 1wg-charters files into place (#7431)
jennifer-richards May 20, 2024
6f8df32
ci: merge release to main (#7448)
rjsparks May 21, 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
101 changes: 39 additions & 62 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ on:
default: true
required: true
type: boolean
sandboxNoDbRefresh:
description: 'Sandbox Disable Daily DB Refresh'
deploy:
description: 'Deploy to Staging / Prod'
default: false
required: true
type: boolean
legacySandbox:
description: 'Deploy to Legacy Sandbox'
sandboxNoDbRefresh:
description: 'Sandbox Disable Daily DB Refresh'
default: false
required: false
required: true
type: boolean
skiptests:
description: 'Skip Tests'
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:

- name: Download a Coverage Results
if: ${{ github.event.inputs.skiptests == 'false' || github.ref_name == 'release' }}
uses: actions/download-artifact@v4.1.4
uses: actions/download-artifact@v4.1.7
with:
name: coverage

Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
.devcontainer
.github
.vscode
helm
k8s
playwright
svn-history
docker-compose.yml
Expand Down Expand Up @@ -323,7 +323,7 @@ jobs:
steps:
- name: Notify on Slack (Success)
if: ${{ !contains(join(needs.*.result, ','), 'failure') }}
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_GH_BUILDS_CHANNEL_ID }}
payload: |
Expand All @@ -346,7 +346,7 @@ jobs:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_GH_BOT }}
- name: Notify on Slack (Failure)
if: ${{ contains(join(needs.*.result, ','), 'failure') }}
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_GH_BUILDS_CHANNEL_ID }}
payload: |
Expand Down Expand Up @@ -385,7 +385,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download a Release Artifact
uses: actions/download-artifact@v4.1.4
uses: actions/download-artifact@v4.1.7
with:
name: release-${{ env.PKG_VERSION }}

Expand All @@ -407,62 +407,39 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
docker image prune -a -f

legacySandbox:
name: Deploy to Legacy Sandbox
if: ${{ !failure() && !cancelled() && github.event.inputs.legacySandbox == 'true' }}

# -----------------------------------------------------------------
# STAGING
# -----------------------------------------------------------------
staging:
name: Deploy to Staging
if: ${{ !failure() && !cancelled() && github.event.inputs.deploy == 'true' }}
needs: [prepare, release]
runs-on: [self-hosted, legacy-sandbox-server]
runs-on: ubuntu-latest
environment:
name: legacy-sandbox
url: "https://sandbox.ietf.org"
name: staging
env:
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}

steps:
- name: Download a Release Artifact
uses: actions/download-artifact@v4.1.4
with:
name: release-${{ env.PKG_VERSION }}
path: /a/www/ietf-datatracker/main.dev.${{ github.run_number }}
- name: Deploy to staging
run: |
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.GH_INFRA_K8S_TOKEN }}" ${{ secrets.GHA_K8S_DEPLOY_API }} -d '{"ref":"main", "inputs": { "environment":"${{ secrets.GHA_K8S_CLUSTER }}", "app":"datatracker", "appVersion":"${{ env.PKG_VERSION }}" }}'

- name: Extract Release
env:
DEBIAN_FRONTEND: noninteractive
working-directory: /a/www/ietf-datatracker/main.dev.${{ github.run_number }}
run: |
echo "Extracting release tarball..."
tar xzf release.tar.gz
echo "Deleting release tarball..."
rm -rf release.tar.gz

- name: Setup Environment
env:
DEBIAN_FRONTEND: noninteractive
working-directory: /a/www/ietf-datatracker/main.dev.${{ github.run_number }}
run: |
echo "Copying settings from previous deploy..."
cp ../web/ietf/settings_local.py ietf/
rsync -a ../web/test/ test/
echo "Installing Python dependencies..."
python3.9 -mvenv env
source env/bin/activate
pip install -r requirements.txt
pip freeze > frozen-requirements.txt
echo "Collecting static..."
ietf/manage.py collectstatic
echo "Running checks..."
ietf/manage.py check

- name: Update Docker Containers
env:
DEBIAN_FRONTEND: noninteractive
working-directory: /a/docker/datatracker
run: |
echo "Pulling latest docker images..."
docker image tag ghcr.io/ietf-tools/datatracker-celery:latest datatracker-celery-fallback
docker image tag ghcr.io/ietf-tools/datatracker-mq:latest datatracker-mq-fallback
docker-compose pull
# echo "Shutting down containers..."
# docker-compose down -t 300

# -----------------------------------------------------------------
# PROD
# -----------------------------------------------------------------
prod:
name: Deploy to Production
if: ${{ !failure() && !cancelled() && github.event.inputs.deploy == 'true' }}
needs: [staging]
runs-on: ubuntu-latest
environment:
name: production
env:
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}

steps:
- name: Deploy to production
run: |
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.GH_INFRA_K8S_TOKEN }}" ${{ secrets.GHA_K8S_DEPLOY_API }} -d '{"ref":"main", "inputs": { "environment":"${{ secrets.GHA_K8S_CLUSTER }}", "app":"datatracker", "appVersion":"${{ env.PKG_VERSION }}" }}'
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
path: geckodriver.log

- name: Upload Coverage Results to Codecov
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@v4.3.1
with:
files: coverage.xml

Expand Down
10 changes: 0 additions & 10 deletions bin/daily
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ cd $DTDIR/

logger -p user.info -t cron "Running $DTDIR/bin/daily"

# Run the hourly jobs first
$DTDIR/bin/hourly

# Set up the virtual environment
source $DTDIR/env/bin/activate


# Update our information about the current version of some commands we use
$DTDIR/ietf/manage.py update_external_command_info

# Get IANA-registered yang models
#YANG_IANA_DIR=$(python -c 'import ietf.settings; print ietf.settings.SUBMIT_YANG_IANA_MODEL_DIR')
# Hardcode the rsync target to avoid any unwanted deletes:
Expand All @@ -43,9 +37,5 @@ $DTDIR/ietf/manage.py populate_yang_model_dirs -v0
# Re-run yang checks on active documents
$DTDIR/ietf/manage.py run_yang_model_checks -v0

# Expire last calls
# Enable when removed from /a/www/ietf-datatracker/scripts/Cron-runner:
$DTDIR/ietf/bin/expire-last-calls

# Purge older PersonApiKeyEvents
$DTDIR/ietf/manage.py purge_old_personal_api_key_events 14
2 changes: 1 addition & 1 deletion bin/dump-to-names-json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

set -x
ietf/manage.py dumpdata --indent 1 doc.State doc.BallotType doc.StateType \
mailtrigger.MailTrigger mailtrigger.Recipient name utils.VersionInfo \
mailtrigger.MailTrigger mailtrigger.Recipient name \
group.GroupFeatures stats.CountryAlias dbtemplate.DBTemplate \
| jq --sort-keys "sort_by(.model, .pk)" \
| jq '[.[] | select(.model!="dbtemplate.dbtemplate" or .pk==354)]' > ietf/name/fixtures/names.json
40 changes: 0 additions & 40 deletions bin/hourly

This file was deleted.

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 <tools-discuss@ietf.org>"

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 <tools-discuss@ietf.org>"

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
2 changes: 1 addition & 1 deletion dev/deploy-to-container/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Docker from 'dockerode'
import path from 'path'
import fs from 'fs-extra'
import tar from 'tar'
import * as tar from 'tar'
import yargs from 'yargs/yargs'
import { hideBin } from 'yargs/helpers'
import slugify from 'slugify'
Expand Down
Loading