Skip to content

Commit

Permalink
Merge pull request #423 from getodk/next
Browse files Browse the repository at this point in the history
Release v2023.3
  • Loading branch information
sadiqkhoja committed Jun 1, 2023
2 parents 86c843b + a05efc9 commit 4604090
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
appropriate/curl -4 --insecure --retry 20 --retry-delay 2 --retry-connrefused https://localhost/v1/projects \
| tee /dev/tty \
| grep -q '\[\]'
docker compose exec -T service pm2 list | grep -c "online" | grep -q 4 || exit 1
docker compose exec -T service npx pm2 list | grep -c "online" | grep -q 4 || exit 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.swp
*.swo
/.env
/docker-compose.override.yml
/version.txt

/files/allow-postgres14-upgrade
Expand Down
2 changes: 1 addition & 1 deletion client
Submodule client updated 204 files
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ services:
options:
max-file: "30"
pyxform:
image: 'ghcr.io/getodk/pyxform-http:v1.12.0'
image: 'ghcr.io/getodk/pyxform-http:v1.12.1'
restart: always
secrets:
volumes:
Expand All @@ -121,7 +121,7 @@ services:
- SUPPORT_EMAIL=${SYSADMIN_EMAIL}
- HTTPS_PORT=${HTTPS_PORT:-443}
enketo_redis_main:
image: redis:7.0.8
image: redis:7.0
volumes:
- ./files/enketo/redis-enketo-main.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_main:/data
Expand All @@ -130,7 +130,7 @@ services:
- /usr/local/etc/redis/redis.conf
restart: always
enketo_redis_cache:
image: redis:7.0.8
image: redis:7.0
volumes:
- ./files/enketo/redis-enketo-cache.conf:/usr/local/etc/redis/redis.conf:ro
- enketo_redis_cache:/data
Expand Down
2 changes: 1 addition & 1 deletion enketo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/enketo/enketo-express:6.0.0
FROM ghcr.io/enketo/enketo-express:6.1.0

ENV ENKETO_SRC_DIR=/srv/src/enketo_express
WORKDIR ${ENKETO_SRC_DIR}
Expand Down
20 changes: 0 additions & 20 deletions files/postgres/upgrade-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ if [[ -f "$flag_upgradeCompletedOk" ]]; then
if [[ -f "$flag_deleteOldData_internal" ]]; then
log "Deleting old data..."
rm "$flag_deleteOldData_internal"
# We cannot run ./delete_old_cluster.sh here, as it will try to:
#
# rm -rf '/var/lib/postgresql/data'
#
# This will fail with:
#
# rm: cannot remove '/var/lib/postgresql/data': Device or resource busy
#
# This is because that is the root of a docker volume. Instead,
# we must do our own manual equivalent:
if ! [[ -f ./delete_old_cluster.sh ]]; then
log "!!!"
log "!!! ERROR: file missing: delete_old_cluster.sh"
log "!!!"
log "!!! Upgrade may not have completed successfully."
log "!!!"
log "!!! Old data will not be deleted."
log "!!!"
exit 1
fi
rm -rf /var/lib/postgresql/data/*
touch "$flag_oldDataDeleted"
log "Old data deleted."
Expand Down
2 changes: 1 addition & 1 deletion files/postgres14/upgrade/check-available-space
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [[ "$volume" = "" ]]; then
exit 1
fi
mountpoint="$(docker volume inspect --format='{{.Mountpoint}}' "$volume")"
used="$(du -s "$mountpoint" | cut -f1)"
used="$(( $(du -s "$mountpoint" | cut -f1) + 5000000 ))" # add 5G of buffer

log
log " Free space: $(numfmt --to=si "$((free*1000))")B"
Expand Down
16 changes: 0 additions & 16 deletions files/service/pm2.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion files/service/scripts/start-odk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ fi
echo "using $WORKER_COUNT worker(s) based on available memory ($MEMTOT).."

echo "starting server."
exec pm2-runtime ./pm2.config.js
exec npx pm2-runtime ./pm2.config.js

2 changes: 1 addition & 1 deletion nginx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.19.1 as intermediate
FROM node:16.20 as intermediate

COPY ./ ./
RUN files/prebuild/write-version.sh
Expand Down
2 changes: 1 addition & 1 deletion postgres14.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:14
FROM postgres:14.8

COPY files/postgres14/start-postgres.sh /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion secrets.dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM node:16.19.1
FROM node:16.20
COPY files/enketo/generate-secrets.sh ./
2 changes: 1 addition & 1 deletion server
Submodule server updated 73 files
+1 −1 .github/workflows/soak-test.yml
+1 −0 .gitignore
+4 −0 Makefile
+2 −0 README.md
+1 −1 config/default.json
+375 −22 docs/api.md
+1 −0 lib/bin/check-file-headers.js
+4 −0 lib/data/analytics.js
+17 −1 lib/data/dataset.js
+125 −38 lib/data/entity.js
+4 −4 lib/formats/mail.js
+3 −2 lib/formats/odata.js
+23 −12 lib/http/preprocessors.js
+3 −2 lib/http/service.js
+1 −1 lib/model/frames.js
+2 −1 lib/model/frames/dataset.js
+61 −21 lib/model/frames/entity.js
+1 −1 lib/model/frames/submission.js
+1 −1 lib/model/knexfile.js
+31 −0 lib/model/migrations/20230324-01-edit-dataset-verbs.js
+48 −0 lib/model/migrations/20230406-01-add-entity-def-fields.js
+66 −0 lib/model/migrations/20230406-02-move-entity-label-add-deletedAt.js
+14 −0 lib/model/migrations/20230414-01-remove-user-mfa-secret.js
+44 −0 lib/model/migrations/20230419-01-optimize-indices-sub-defs.js
+25 −0 lib/model/migrations/20230509-01-dataset-approval-flag.js
+20 −0 lib/model/migrations/20230512-01-add-entity-root.js
+23 −0 lib/model/migrations/20230512-02-backfill-entity-id.js
+129 −0 lib/model/migrations/20230512-03-add-entity-source.js
+20 −0 lib/model/migrations/20230518-01-add-entity-index-to-audits.js
+15 −2 lib/model/query/analytics.js
+91 −6 lib/model/query/audits.js
+285 −248 lib/model/query/datasets.js
+249 −63 lib/model/query/entities.js
+2 −2 lib/model/query/form-attachments.js
+9 −21 lib/model/query/forms.js
+27 −7 lib/model/query/submissions.js
+42 −22 lib/resources/datasets.js
+124 −0 lib/resources/entities.js
+41 −27 lib/resources/forms.js
+7 −5 lib/resources/odata-entities.js
+2 −4 lib/resources/sessions.js
+24 −8 lib/resources/submissions.js
+16 −1 lib/util/http.js
+17 −3 lib/util/problem.js
+15 −1 lib/util/promise.js
+21 −0 lib/worker/dataset.js
+1 −4 lib/worker/entity.js
+5 −3 lib/worker/jobs.js
+3 −2 lib/worker/worker.js
+2,980 −182 package-lock.json
+2 −0 package.json
+16 −0 pm2.config.js
+6 −2 soak-tester/index.js
+72 −36 test/assertions.js
+24 −9 test/data/xml.js
+104 −2 test/integration/api/audits.js
+941 −203 test/integration/api/datasets.js
+1,142 −0 test/integration/api/entities.js
+64 −0 test/integration/api/forms/forms.js
+72 −5 test/integration/api/odata-entities.js
+63 −57 test/integration/api/projects.js
+98 −15 test/integration/api/submissions.js
+1 −2 test/integration/api/users.js
+60 −2 test/integration/other/analytics-queries.js
+1 −1 test/integration/other/bearer-auth.js
+373 −4 test/integration/other/migrations.js
+374 −21 test/integration/worker/entity.js
+23 −0 test/integration/worker/worker.js
+81 −1 test/unit/data/dataset.js
+350 −98 test/unit/data/entity.js
+33 −36 test/unit/http/preprocessors.js
+28 −0 test/unit/model/frames/entity.js
+29 −1 test/unit/util/promise.js
4 changes: 1 addition & 3 deletions service.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG node_version=16.19.1
ARG node_version=16.20
FROM node:${node_version} as intermediate

COPY . .
Expand All @@ -23,11 +23,9 @@ COPY files/service/crontab /etc/cron.d/odk
COPY server/package*.json ./

RUN npm clean-install --omit=dev --legacy-peer-deps --no-audit --fund=false --update-notifier=false
RUN npm install [email protected] -g

COPY server/ ./
COPY files/service/scripts/ ./
COPY files/service/pm2.config.js ./

COPY files/service/config.json.template /usr/share/odk/
COPY files/service/odk-cmd /usr/bin/
Expand Down

0 comments on commit 4604090

Please sign in to comment.