Skip to content

Commit 993b14c

Browse files
authored
Merge pull request #1623 from getodk/next
Release v2025.4.2
2 parents cf374ca + da545cf commit 993b14c

11 files changed

Lines changed: 60 additions & 32 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- run: sudo apt-get install shellcheck
1616
- run: ./test/check-scripts.sh
17+
- run: ./test/check-for-large-files.sh
1718
- run: ./test/check-dockerfiles.sh
1819
test-envsub:
1920
timeout-minutes: 2
@@ -36,7 +37,7 @@ jobs:
3637
submodules: recursive
3738
- uses: actions/setup-node@v4
3839
with:
39-
node-version: 22.21.1
40+
node-version: 22.22.0
4041
- run: cd test/nginx && npm clean-install
4142
- run: cd test/nginx && npm run lint
4243
- run: cd test/nginx && ./setup-tests.sh

client

files/service/scripts/start-odk.sh

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,39 @@ node ./lib/bin/log-upgrade
2727
echo "starting cron.."
2828
cron -f &
2929

30-
get_cgroup_version() {
31-
# The max memory calculation is different between cgroup v1 & v2
32-
local cgroup_type
33-
cgroup_type=$(stat -fc %T /sys/fs/cgroup/)
34-
if [ "$cgroup_type" == "cgroup2fs" ]; then
35-
echo "v2"
36-
else
37-
echo "v1"
38-
fi
30+
is_cgroup2() {
31+
[ -f /sys/fs/cgroup/cgroup.controllers ]
3932
}
4033

4134
get_memory_limit() {
42-
local cgroup_version
43-
cgroup_version=$(get_cgroup_version)
35+
local memtot fallback_memtot
36+
37+
if [ -r /proc/meminfo ]; then
38+
fallback_memtot=$(awk '/MemTotal/ {print $2 * 1024}' /proc/meminfo)
39+
else
40+
fallback_memtot=0
41+
fi
4442

45-
if [ "$cgroup_version" == "v2" ]; then
46-
local memtot
47-
memtot=$(cat /sys/fs/cgroup/memory.max)
48-
if [ "$memtot" == "max" ]; then
49-
# No cgroup memory limit; fallback to system's total memory
50-
memtot=$(grep MemTotal /proc/meminfo | awk '{print $2 * 1024}')
43+
if is_cgroup2; then
44+
if [ -r /sys/fs/cgroup/memory.max ]; then
45+
memtot=$(cat /sys/fs/cgroup/memory.max)
46+
else
47+
memtot="max"
48+
fi
49+
if [ "$memtot" = "max" ]; then
50+
memtot=$fallback_memtot
5151
fi
52-
# Force memtot to be an integer (not scientific notation e+09)
53-
printf "%.0f\n" "$memtot"
5452
else
5553
# cgroup v1
56-
local memtot
57-
memtot=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
58-
# Force memtot to be an integer
59-
printf "%.0f\n" "$memtot"
54+
if [ -r /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
55+
memtot=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
56+
else
57+
memtot=$fallback_memtot
58+
fi
6059
fi
60+
61+
# Force memtot to be an integer (not scientific notation e+09)
62+
printf "%.0f\n" "$memtot"
6163
}
6264

6365
determine_worker_count() {

nginx.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.21.1-slim AS intermediate
1+
FROM node:22.22.0-slim AS intermediate
22

33
RUN apt-get update \
44
&& apt-get install -y --no-install-recommends \

secrets.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM node:22.21.1-slim
1+
FROM node:22.22.0-slim
22

33
COPY files/enketo/generate-secrets.sh ./

server

service.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG node_version=22.21.1
1+
ARG node_version=22.22.0
22

33

44

test/check-for-large-files.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -eu
2+
set -o pipefail
3+
shopt -s inherit_errexit
4+
5+
git ls-files -z \
6+
| xargs -0 ls -l -- \
7+
| awk '
8+
BEGIN {
9+
print "[check-for-large-files] Checking for large files...";
10+
}
11+
12+
$5 > 1000000 {
13+
++n;
14+
print $5 "\t" $9;
15+
}
16+
17+
END {
18+
if(n>0) {
19+
print "[check-for-large-files] !!! " n " LARGE FILE(S) FOUND";
20+
exit 1;
21+
} else {
22+
print "[check-for-large-files] No large files found ✅";
23+
}
24+
}
25+
'

test/nginx/mock-http-service.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.21.1-slim
1+
FROM node:22.22.0-slim
22

33
WORKDIR /workspace
44

test/nginx/mock-sentry.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.21.1-slim
1+
FROM node:22.22.0-slim
22

33
RUN apt-get update \
44
&& apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)