Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- uses: actions/checkout@v4
- run: sudo apt-get install shellcheck
- run: ./test/check-scripts.sh
- run: ./test/check-for-large-files.sh
- run: ./test/check-dockerfiles.sh
test-envsub:
timeout-minutes: 2
Expand All @@ -36,7 +37,7 @@ jobs:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 22.21.1
node-version: 22.22.0
- run: cd test/nginx && npm clean-install
- run: cd test/nginx && npm run lint
- run: cd test/nginx && ./setup-tests.sh
Expand Down
2 changes: 1 addition & 1 deletion client
Submodule client updated 2 files
+7 −7 package-lock.json
+1 −1 package.json
48 changes: 25 additions & 23 deletions files/service/scripts/start-odk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,39 @@ node ./lib/bin/log-upgrade
echo "starting cron.."
cron -f &

get_cgroup_version() {
# The max memory calculation is different between cgroup v1 & v2
local cgroup_type
cgroup_type=$(stat -fc %T /sys/fs/cgroup/)
if [ "$cgroup_type" == "cgroup2fs" ]; then
echo "v2"
else
echo "v1"
fi
is_cgroup2() {
[ -f /sys/fs/cgroup/cgroup.controllers ]
}

get_memory_limit() {
local cgroup_version
cgroup_version=$(get_cgroup_version)
local memtot fallback_memtot

if [ -r /proc/meminfo ]; then
fallback_memtot=$(awk '/MemTotal/ {print $2 * 1024}' /proc/meminfo)
else
fallback_memtot=0
fi

if [ "$cgroup_version" == "v2" ]; then
local memtot
memtot=$(cat /sys/fs/cgroup/memory.max)
if [ "$memtot" == "max" ]; then
# No cgroup memory limit; fallback to system's total memory
memtot=$(grep MemTotal /proc/meminfo | awk '{print $2 * 1024}')
if is_cgroup2; then
if [ -r /sys/fs/cgroup/memory.max ]; then
memtot=$(cat /sys/fs/cgroup/memory.max)
else
memtot="max"
fi
if [ "$memtot" = "max" ]; then
memtot=$fallback_memtot
fi
# Force memtot to be an integer (not scientific notation e+09)
printf "%.0f\n" "$memtot"
else
# cgroup v1
local memtot
memtot=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
# Force memtot to be an integer
printf "%.0f\n" "$memtot"
if [ -r /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
memtot=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
else
memtot=$fallback_memtot
fi
fi

# Force memtot to be an integer (not scientific notation e+09)
printf "%.0f\n" "$memtot"
}

determine_worker_count() {
Expand Down
2 changes: 1 addition & 1 deletion nginx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.21.1-slim AS intermediate
FROM node:22.22.0-slim AS intermediate

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion secrets.dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM node:22.21.1-slim
FROM node:22.22.0-slim

COPY files/enketo/generate-secrets.sh ./
2 changes: 1 addition & 1 deletion server
Submodule server updated 1 files
+1 −0 lib/external/sentry.js
2 changes: 1 addition & 1 deletion service.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG node_version=22.21.1
ARG node_version=22.22.0



Expand Down
25 changes: 25 additions & 0 deletions test/check-for-large-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -eu
set -o pipefail
shopt -s inherit_errexit

git ls-files -z \
| xargs -0 ls -l -- \
| awk '
BEGIN {
print "[check-for-large-files] Checking for large files...";
}

$5 > 1000000 {
++n;
print $5 "\t" $9;
}

END {
if(n>0) {
print "[check-for-large-files] !!! " n " LARGE FILE(S) FOUND";
exit 1;
} else {
print "[check-for-large-files] No large files found ✅";
}
}
'
2 changes: 1 addition & 1 deletion test/nginx/mock-http-service.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.21.1-slim
FROM node:22.22.0-slim

WORKDIR /workspace

Expand Down
2 changes: 1 addition & 1 deletion test/nginx/mock-sentry.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.21.1-slim
FROM node:22.22.0-slim

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion test/nginx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"mocha": "^11.6.0"
},
"volta": {
"node": "22.21.1"
"node": "22.22.0"
}
}