Skip to content

Commit cff6adb

Browse files
committed
Merge branch 'next'
2 parents 53f0d1a + 3210b20 commit cff6adb

File tree

7 files changed

+109
-36
lines changed

7 files changed

+109
-36
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
node_modules/
22
.vagrant/
33
.idea/
4+
5+
.env
6+

docker-compose.yml

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
- local
1818

1919
db_migrate:
20-
image: ghcr.io/fnndsc/cube:5.0.0
20+
image: ghcr.io/fnndsc/cube:6.3.0-beta.7
2121
command: python manage.py migrate --noinput
2222
env_file: secrets.env
2323
volumes:
@@ -30,7 +30,7 @@ services:
3030

3131
chris:
3232
container_name: chris
33-
image: ghcr.io/fnndsc/cube:5.0.0
33+
image: ghcr.io/fnndsc/cube:6.3.0-beta.7
3434
ports:
3535
- "8000:8000"
3636
volumes:
@@ -39,7 +39,7 @@ services:
3939
db_migrate:
4040
condition: service_completed_successfully
4141
queue:
42-
condition: service_started
42+
condition: service_healthy
4343
cube-nonroot-user-volume-fix:
4444
condition: service_completed_successfully
4545
networks:
@@ -49,7 +49,7 @@ services:
4949
org.chrisproject.role: "ChRIS_ultron_backEnd"
5050
org.chrisproject.miniChRIS: "miniChRIS"
5151
worker:
52-
image: ghcr.io/fnndsc/cube:5.0.0
52+
image: ghcr.io/fnndsc/cube:6.3.0-beta.7
5353
command: celery -A core worker -c 4 -l info -Q main1,main2
5454
volumes:
5555
- chris_files:/data:rw
@@ -58,7 +58,7 @@ services:
5858
db_migrate:
5959
condition: service_completed_successfully
6060
queue:
61-
condition: service_started
61+
condition: service_healthy
6262
pfcon:
6363
condition: service_started
6464
cube-nonroot-user-volume-fix:
@@ -67,7 +67,7 @@ services:
6767
networks:
6868
- local
6969
worker_periodic:
70-
image: ghcr.io/fnndsc/cube:5.0.0
70+
image: ghcr.io/fnndsc/cube:6.3.0-beta.7
7171
command: celery -A core worker -c 2 -l info -Q periodic
7272
volumes:
7373
- chris_files:/data:rw
@@ -76,14 +76,14 @@ services:
7676
db_migrate:
7777
condition: service_completed_successfully
7878
queue:
79-
condition: service_started
79+
condition: service_healthy
8080
cube-nonroot-user-volume-fix:
8181
condition: service_completed_successfully
8282
restart: unless-stopped
8383
networks:
8484
- local
8585
scheduler:
86-
image: ghcr.io/fnndsc/cube:5.0.0
86+
image: ghcr.io/fnndsc/cube:6.3.0-beta.7
8787
command: celery -A core beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
8888
volumes:
8989
- chris_files:/data:rw
@@ -92,7 +92,7 @@ services:
9292
db_migrate:
9393
condition: service_completed_successfully
9494
queue:
95-
condition: service_started
95+
condition: service_healthy
9696
cube-nonroot-user-volume-fix:
9797
condition: service_completed_successfully
9898
restart: unless-stopped
@@ -115,19 +115,27 @@ services:
115115
queue:
116116
image: docker.io/library/rabbitmq:3
117117
restart: on-failure
118+
ports:
119+
- 5672:5672
118120
networks:
119121
- local
122+
healthcheck:
123+
test: rabbitmq-diagnostics -q ping
124+
start_period: 20s
125+
retries: 3
126+
timeout: 10s
127+
interval: 5s
120128

121129
pfcon:
122130
container_name: pfcon
123-
image: ghcr.io/fnndsc/pfcon:5.2.2
131+
image: ghcr.io/fnndsc/pfcon:5.2.3
124132
environment:
125133
COMPUTE_SERVICE_URL: http://pman:5010/api/v1/
126134
SECRET_KEY: secret
127135
PFCON_USER: pfcon
128136
PFCON_PASSWORD: pfcon1234
129137
PFCON_INNETWORK: "true"
130-
STORAGE_ENV: filesystem
138+
STORAGE_ENV: fslink
131139
STOREBASE_MOUNT: /var/local/storeBase
132140
ports:
133141
- "5005:5005"
@@ -169,13 +177,27 @@ services:
169177
org.chrisproject.role: "pman"
170178

171179
chris_ui:
172-
image: ghcr.io/fnndsc/chris_ui:20240507.446-767958ca
173-
command: sirv --host --single
180+
# This image is likely outdated.
181+
# Newer tags can be found here --> https://github.com/FNNDSC/ChRIS_ui/pkgs/container/chris_ui
182+
image: ghcr.io/fnndsc/chris_ui:staging
174183
environment:
175-
REACT_APP_CHRIS_UI_URL: http://localhost:8000/api/v1/
176-
REACT_APP_PFDCM_URL: http://localhost:4005/
184+
# https://chrisproject.org/docs/run/chris_ui#environment-variables
185+
CHRIS_UI_URL: http://${HOSTNAME:-localhost}:8000/api/v1/
186+
PFDCM_URL: http://${HOSTNAME:-localhost}:4005
187+
OHIF_URL: http://${HOSTNAME:-localhost}:8042/ohif/
188+
SERVER_PORT: "8020"
189+
SERVER_LOG_REMOTE_ADDRESS: "true"
190+
SERVER_HEALTH: "true"
177191
ports:
178-
- "8020:3000"
192+
- "8020:8020"
193+
user: "100100:100100"
194+
group_add: [ root ]
195+
healthcheck:
196+
test: ["CMD", "wget", "--spider", "http://127.0.0.1:8020/health"]
197+
interval: 5s
198+
timeout: 2s
199+
retries: 3
200+
start_period: 10s
179201

180202
orthanc:
181203
image: docker.io/jodogne/orthanc-plugins:1.12.3
@@ -212,17 +234,19 @@ services:
212234
condition: service_completed_successfully
213235

214236
oxidicom:
215-
image: ghcr.io/fnndsc/oxidicom:2.0.0
237+
image: ghcr.io/fnndsc/oxidicom:pr-3 # https://github.com/FNNDSC/oxidicom/pull/3
216238
environment:
217-
OXIDICOM_DB_CONNECTION: postgresql://chris:chris1234@db:5432/chris
239+
# https://chrisproject.org/docs/oxidicom/deployment#environment-variables
218240
OXIDICOM_FILES_ROOT: /data
241+
OXIDICOM_AMQP_ADDRESS: amqp://queue:5672
242+
OXIDICOM_NATS_ADDRESS: nats:4222
219243
OXIDICOM_SCP_AET: ChRIS
220-
OXIDICOM_PACS_ADDRESS: '{MINICHRISORTHANC="orthanc:4242"}'
221244
OXIDICOM_SCP_PROMISCUOUS: "true"
222-
OXIDICOM_DB_BATCH_SIZE: 20
223245
OXIDICOM_LISTENER_THREADS: 32
224-
OXIDICOM_VERBOSE: "true"
225246
OXIDICOM_LISTENER_PORT: 11111
247+
RUST_LOG: oxidicom=info
248+
OXIDICOM_PROGRESS_INTERVAL: 100ms
249+
OXIDICOM_DEV_SLEEP: 150ms # throttle performance, so that we can see what's going on in ChRIS_ui
226250
ports:
227251
- "11111:11111"
228252
volumes:
@@ -233,9 +257,28 @@ services:
233257
profiles:
234258
- pacs
235259
user: 1001:0
260+
stop_signal: SIGKILL
236261
depends_on:
262+
queue:
263+
condition: service_healthy
264+
nats:
265+
condition: service_healthy
237266
cube-nonroot-user-volume-fix:
238267
condition: service_completed_successfully
268+
269+
nats:
270+
image: docker.io/library/nats:2.10.20-alpine3.20
271+
ports:
272+
- "4222:4222"
273+
networks:
274+
- local
275+
healthcheck:
276+
test: wget http://localhost:8222/healthz -q -S -O -
277+
start_period: 10s
278+
retries: 3
279+
timeout: 2s
280+
interval: 2s
281+
239282
pfbridge:
240283
image: docker.io/fnndsc/pfbridge:3.7.2
241284
container_name: pfbridge
@@ -287,7 +330,7 @@ services:
287330
- pflink
288331

289332
graphql-engine:
290-
image: docker.io/hasura/graphql-engine:v2.40.0
333+
image: docker.io/hasura/graphql-engine:v2.41.0
291334
ports:
292335
- "8090:8080"
293336
restart: unless-stopped

minichris.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ fi
77
# change to directory where this script lives
88
cd "$(dirname "$(readlink -f "$0")")"
99

10-
set -ex
10+
set -x # print commands before running them
11+
12+
# (optional) set HOSTNAME environment variable
13+
hn="$(hostname)" && echo "HOSTNAME=$hn" > .env
14+
15+
set -e # fail on error
16+
1117
docker compose up -d "$@"
1218

1319
# if chris is running, run chrisomatic

scripts/clear_pacsfiles.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ docker compose exec chris pip install tqdm
1212
docker compose exec chris python manage.py shell -c '
1313
from django.conf import settings
1414
from core.storage import connect_storage
15-
from pacsfiles.models import PACSFile
15+
from pacsfiles.models import PACSSeries
1616
from tqdm import tqdm
1717
18-
with tqdm(PACSFile.objects.all()) as pbar:
18+
with tqdm(PACSSeries.objects.all()) as pbar:
1919
for pacs_file in pbar:
2020
_ = pacs_file.delete()
2121

secrets.env

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CHRIS_SUPERUSER_PASSWORD=chris1234
12
DJANGO_SETTINGS_MODULE=config.settings.production
23
CUBE_CELERY_POLL_INTERVAL=5.0
34
DJANGO_ALLOWED_HOSTS=*
@@ -11,8 +12,11 @@ DATABASE_PORT=5432
1112
POSTGRES_DB=chris
1213
POSTGRES_USER=chris
1314
POSTGRES_PASSWORD=chris1234
14-
CHRIS_STORE_URL=https://chrisstore.co/api/v1/
15-
STORAGE_ENV=filesystem
15+
CHRIS_STORE_URL=https://cube.chrisproject.org/api/v1/
16+
STORAGE_ENV=fslink
1617
MEDIA_ROOT=/data
1718
CELERY_BROKER_URL=amqp://queue:5672
19+
PFDCM_ADDRESS=http://pfdcm:4005
20+
NATS_ADDRESS=nats://nats:4222
1821
AUTH_LDAP=False
22+
DISABLE_USER_ACCOUNT_CREATION=false

test.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#!/bin/bash -x
1+
#!/usr/bin/env bash
22
# run pl-dircopy on the file "LICENSE", that's it
33

44
cd $(dirname "$(readlink -f "$0")")
55

6+
set -x
7+
68
ok_statuses=(created waiting scheduled started registeringFiles)
79

810
function is_ok() {
@@ -31,10 +33,10 @@ token=$(
3133
)
3234

3335
# upload a file
34-
curl -s 'http://localhost:8000/api/v1/uploadedfiles/' \
36+
curl -s 'http://localhost:8000/api/v1/userfiles/' \
3537
-H 'Accept: application/vnd.collection+json' \
3638
-H "Authorization: Token $token" \
37-
-F 'upload_path=chris/uploads/wow-upload-01/LICENSE' \
39+
-F 'upload_path=home/chris/uploads/wow-upload-01/LICENSE' \
3840
-F "fname=@LICENSE"
3941

4042
# find the plugin ID for pl-dircopy
@@ -50,7 +52,7 @@ feed=$(
5052
-H "Authorization: Token $token" \
5153
-H 'Content-Type: application/vnd.collection+json' \
5254
-H 'Accept: application/json' \
53-
--data '{"template":{"data":[{"name":"dir","value":"chris/uploads/wow-upload-01"}]}}'
55+
--data '{"template":{"data":[{"name":"dir","value":"home/chris/uploads/wow-upload-01"}]}}'
5456
)
5557

5658
job_url=$(echo $feed | jq -r .url)
@@ -82,13 +84,28 @@ if [ "$run_status" != "finishedSuccessfully" ]; then
8284
fi
8385

8486
# download output file
87+
output_folder_root=$(
88+
curl -s "$(echo $job | jq -r .output_folder)" \
89+
-H "Authorization: Token $token" \
90+
-H 'Accept: application/json'
91+
)
92+
output_folder_linkfiles=$(
93+
curl -s "$(echo $output_folder_root | jq -r .link_files)" \
94+
-H "Authorization: Token $token" \
95+
-H 'Accept: application/json'
96+
)
97+
linked_folder=$(
98+
curl -s "$(echo $output_folder_linkfiles | jq -r '.results[0].linked_folder')" \
99+
-H "Authorization: Token $token" \
100+
-H 'Accept: application/json'
101+
)
85102
output_files=$(
86-
curl -s "$(echo $job | jq -r .files)" \
103+
curl -s "$(echo $linked_folder | jq -r '.files')" \
87104
-H "Authorization: Token $token" \
88105
-H 'Accept: application/json'
89106
)
90107
copied_file_url=$(
91-
echo $output_files \
108+
echo "$output_files" \
92109
| jq -r '.results | map(select(.fname|endswith("LICENSE")))[0].file_resource'
93110
)
94111

wrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
*/
99

1010

11-
const fs = require('fs');
12-
const path = require('path');
13-
const { execFileSync } = require('child_process');
11+
const fs = require('node:fs');
12+
const path = require('node:path');
13+
const { execFileSync } = require('node:child_process');
1414
const assert = require('node:assert/strict');
1515

1616

0 commit comments

Comments
 (0)