Skip to content

Commit e1224e1

Browse files
authored
Merge pull request #120 from fractal-analytics-platform/new-example-for-testing
New example for testing
2 parents ee54561 + d64bcf4 commit e1224e1

13 files changed

+32
-209
lines changed

examples/staging-full-stack/docker-compose.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
services:
2+
23
db:
34
cpus: 1.0
45
mem_limit: "1G"
@@ -28,16 +29,16 @@ services:
2829
networks:
2930
- fractal
3031

31-
server:
32-
hostname: server
33-
container_name: server
32+
fractal-server:
33+
hostname: fractal-server
34+
container_name: fractal-server
3435
cpus: 3.0
3536
mem_limit: 5g
3637
build:
37-
context: server
38+
context: ./fractal-server
3839
dockerfile: Dockerfile
3940
args:
40-
- FRACTAL_SERVER_VERSION=2.14.0a0
41+
- FRACTAL_SERVER_VERSION=2.14.0a1
4142
depends_on:
4243
db:
4344
condition: service_healthy
@@ -46,22 +47,22 @@ services:
4647
ports:
4748
- 8000:8000
4849
healthcheck:
49-
test: wget http://server:8000/api/alive/ > /dev/null 2>&1
50+
test: wget http://fractal-server:8000/api/alive/ > /dev/null 2>&1
5051
interval: 5s
5152
timeout: 2s
5253
retries: 5
5354
networks:
5455
- fractal
5556

56-
web:
57+
fractal-web:
5758
container_name: fractal-web
5859
build:
59-
context: ./web
60+
context: ./fractal-web
6061
dockerfile: Dockerfile
6162
args:
62-
- FRACTAL_WEB_VERSION=1.17.0-a0
63+
- FRACTAL_WEB_VERSION=1.17.0-a1
6364
depends_on:
64-
server:
65+
fractal-server:
6566
condition: service_healthy
6667
ports:
6768
- 5173:5173
@@ -75,7 +76,7 @@ services:
7576
args:
7677
- FRACTAL_CLIENT_VERSION=2.7.1
7778
depends_on:
78-
server:
79+
fractal-server:
7980
condition: service_healthy
8081
volumes:
8182
- data:/data
@@ -97,7 +98,7 @@ services:
9798
container_name: vizarr
9899
image: ghcr.io/fractal-analytics-platform/fractal-vizarr-viewer:stable
99100
environment:
100-
- FRACTAL_SERVER_URL=http://server:8000
101+
- FRACTAL_SERVER_URL=http://fractal-server:8000
101102
- AUTHORIZATION_SCHEME=fractal-server
102103
ports:
103104
- 3000:3000

examples/staging-full-stack/server/.fractal_server.env examples/staging-full-stack/fractal-server/.fractal_server.env

-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ FRACTAL_RUNNER_BACKEND=local
55
FRACTAL_TASKS_DIR=/data/app/Tasks
66
FRACTAL_RUNNER_WORKING_BASE_DIR=/data/app/Artifacts
77

8-
98
FRACTAL_TASKS_PYTHON_DEFAULT_VERSION="3.10"
109
FRACTAL_TASKS_PYTHON_3_10=/usr/bin/python3
1110

1211
FRACTAL_VIEWER_AUTHORIZATION_SCHEME=viewer-paths
1312

14-
1513
JWT_EXPIRE_SECONDS=84600
1614

1715
POSTGRES_HOST=fractal-db

examples/staging-full-stack/server/Dockerfile examples/staging-full-stack/fractal-server/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
FROM ghcr.io/fractal-analytics-platform/ubuntu22-slurm:0.1
1+
FROM ubuntu:22.04
22

3-
ARG FRACTAL_SERVER_VERSION
3+
RUN apt update -y
4+
RUN apt install -y wget vim less python3 python3-pip python3-venv
45

5-
RUN echo "Install fractal-server ${FRACTAL_SERVER_VERSION}"
6+
ARG FRACTAL_SERVER_VERSION
67
RUN pip3 install fractal-server==${FRACTAL_SERVER_VERSION}
78

89
COPY run_server.sh ./

examples/staging-full-stack/server/run_server.sh examples/staging-full-stack/fractal-server/run_server.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
fractalctl set-db
45

examples/staging-full-stack/web/Dockerfile examples/staging-full-stack/fractal-web/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ENV NODE_MAJOR_VERSION=20
77

88
RUN wget -qO- "https://github.com/fractal-analytics-platform/fractal-web/releases/download/v${FRACTAL_WEB_VERSION}/node-${NODE_MAJOR_VERSION}-fractal-web-v${FRACTAL_WEB_VERSION}.tar.gz" | tar -xz
99

10-
ENV FRACTAL_SERVER_HOST=http://server:8000
10+
ENV FRACTAL_SERVER_HOST=http://fractal-server:8000
1111
ENV PUBLIC_FRACTAL_VIZARR_VIEWER_URL=http://localhost:3000/vizarr
1212
ENV PUBLIC_FRACTAL_ADMIN_SUPPORT_EMAIL=
1313
ENV PUBLIC_OAUTH_CLIENT_NAME=

examples/staging-full-stack/makefile

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# Auxiliary targets
2-
31
up:
42
docker compose up
53

64
build:
7-
docker compose build --progress=plain
5+
docker compose --progress=plain build
86

97
build-no-cache:
10-
docker compose build --no-cache --progress=plain
8+
docker compose --progress=plain build --no-cache
119

1210
clean:
1311
docker compose down -v --timeout 1
1412

1513
clean-with-volumes:
1614
docker compose down --volumes -v --timeout 1
15+
16+
17+
all-from-scratch: clean-with-volumes build-no-cache
18+
docker compose up

examples/staging-full-stack/scripts/.fractal.env

-3
This file was deleted.

examples/staging-full-stack/scripts/.gitignore

-2
This file was deleted.

examples/staging-full-stack/scripts/1_trigger_fractal_tasks_core_collection.sh

-10
This file was deleted.

examples/staging-full-stack/scripts/2_prepare_workflow_for_execution.sh

-32
This file was deleted.

examples/staging-full-stack/scripts/workflow.json

-138
This file was deleted.

examples/staging-full-stack/server-config/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM python:3.11-slim
22

3-
RUN apt update
3+
RUN apt update -y
44
RUN apt install -y unzip wget
55

66
ARG FRACTAL_CLIENT_VERSION
77
RUN pip install fractal-client==${FRACTAL_CLIENT_VERSION}
88

9-
ENV FRACTAL_SERVER=http://server:8000
9+
ENV FRACTAL_SERVER=http://fractal-server:8000
1010
1111
ENV FRACTAL_PASSWORD=1234
1212

examples/staging-full-stack/server-config/config.sh

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# Update user
46
FRACTAL_USER_ID=$(fractal --batch user whoami)
57
fractal user edit "$FRACTAL_USER_ID" --new-project-dir /data/zarrs/test01
68

79
# Assuming that group 1 is the ALL
810
ALL_GROUP_ID=1
11+
# shellcheck disable=SC2046
912
if [ $(fractal group get "$ALL_GROUP_ID" | grep name | grep All) != "0" ]; then
1013
echo "User group with id $ALL_GROUP_ID is not the 'All' group. Exit."
1114
exit 1
@@ -14,6 +17,7 @@ fractal group update "$ALL_GROUP_ID" --new-viewer-paths /data
1417

1518
# Download test zarr data
1619
mkdir -p /data/zarrs
20+
# shellcheck disable=SC2164
1721
cd /data/zarrs/
1822
wget --quiet https://zenodo.org/records/10424292/files/20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip
1923
unzip -q 20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip
@@ -22,6 +26,7 @@ rm -r 20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip __MACOSX
2226
# Download test image data
2327
mkdir -p /data/images
2428
mkdir /data/images/10.5281_zenodo.8287221
29+
# shellcheck disable=SC2164
2530
cd /data/images/10.5281_zenodo.8287221
2631
wget --quiet https://zenodo.org/api/records/8287221/files-archive
2732
mv files-archive files-archive.zip

0 commit comments

Comments
 (0)