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
39 changes: 7 additions & 32 deletions .github/workflows/apptainer-build-local.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test Apptainer Build Local

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_run:
Expand Down Expand Up @@ -41,46 +43,14 @@ jobs:
run: |
make get-test-data
- name: Cache Docker images
uses: actions/cache@v4
id: docker-cache
with:
path: |
mongo.tar
api.tar
handler.tar
ui.tar
key: docker-local-images-${{ github.event.workflow_run.head_sha || github.sha }}
restore-keys: |
docker-local-images-
- name: Setup environment
run: |
# copy the example.env to .env
cp example.env .env
# Update .env to use the hostname
sed -i "s/SERVER_NAME=.*/SERVER_NAME=localhost/" .env
- name: Build or load images
run: |
if [ -f mongo.tar ] && [ -f api.tar ] && [ -f handler.tar ] && [ -f ui.tar ]; then
echo "Loading cached images..."
if ! docker load < mongo.tar || ! docker load < api.tar || ! docker load < handler.tar || ! docker load < ui.tar; then
echo "Failed to load cached images, building instead..."
docker compose -f ${{ env.COMPOSE_FILE }} build
else
rm mongo.tar api.tar handler.tar ui.tar
fi
else
echo "Building images..."
docker compose -f ${{ env.COMPOSE_FILE }} build
fi
# Tag the images to match docker-compose
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-api:latest api:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-handler:latest handler:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest ui:latest
- name: Clean Up some More Space
run: bash .github/scripts/util_free_space.sh
Expand Down Expand Up @@ -135,4 +105,9 @@ jobs:
exit 1
fi
- name: Push Images
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
run: |
docker login ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }}
make docker-push-everything
54 changes: 16 additions & 38 deletions .github/workflows/docker-build-everything-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ jobs:
run: |
make get-test-data
- name: Cache Docker images
uses: actions/cache@v4
id: docker-cache
with:
path: |
mongo.tar
api.tar
handler.tar
ui.tar
key: docker-local-images-${{ github.event.workflow_run.head_sha || github.sha }}
restore-keys: |
docker-local-images-
- name: Setup environment
run: |
# copy the example.env to .env
Expand All @@ -62,33 +49,26 @@ jobs:
# Update .env to use the hostname
sed -i "s/SERVER_NAME=.*/SERVER_NAME=localhost/" .env
- name: Build or load images
run: |
if [ -f mongo.tar ] && [ -f api.tar ] && [ -f handler.tar ] && [ -f ui.tar ]; then
echo "Loading cached images..."
if ! docker load < mongo.tar || ! docker load < api.tar || ! docker load < handler.tar || ! docker load < ui.tar; then
echo "Failed to load cached images, building instead..."
docker compose -f ${{ env.COMPOSE_FILE }} build
else
rm mongo.tar api.tar handler.tar ui.tar
fi
else
echo "Building images..."
docker compose -f ${{ env.COMPOSE_FILE }} build
fi
# Tag the images to match docker-compose
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-api:latest api:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-handler:latest handler:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest ui:latest
- name: Build Single Docker Image
run: |
docker build -f EverythingDockerfile -t ezbids-everything .
docker build -f EverythingDockerfile -t openneuropet/ezbids-everything .
- name: Save everything image to cache
run: |
docker save openneuropet/ezbids-everything > everything.tar
- name: Cache everything image
uses: actions/cache@v4
with:
path: |
everything.tar
key: docker-everything-images-${{ github.sha }}
restore-keys: |
docker-everything-images-
- name: Start Services
run: |
docker run -d -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything
docker run -d -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp openneuropet/ezbids-everything
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
Expand All @@ -100,6 +80,4 @@ jobs:
- name: Run upload test
run: |
make test-upload

6 changes: 3 additions & 3 deletions .github/workflows/docker-build-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
run: |
# Save images to tar files
docker save mongo > mongo.tar
docker save ${REGISTRY_PREFIX}/${REPO_NAME}-api:latest > api.tar
docker save ${REGISTRY_PREFIX}/${REPO_NAME}-handler:latest > handler.tar
docker save ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest > ui.tar
docker save openneuropet/ezbids-api:latest > api.tar
docker save openneuropet/ezbids-handler:latest > handler.tar
docker save openneuropet/ezbids-ui:latest > ui.tar
- name: Cache Docker images
uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Save images
run: |
# Save all ui and nginx images to tar files
docker save ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest > ui-nginx.tar
docker save openneuropet/ezbids-ui-nginx:latest > ui-nginx.tar
docker save nginx > nginx.tar
- name: Cache Nginx images
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test-upload-local.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test Local Upload

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_run:
Expand Down Expand Up @@ -77,10 +79,6 @@ jobs:
docker compose -f ${{ env.COMPOSE_FILE }} build
fi
# Tag the images to match docker-compose
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-api:latest api:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-handler:latest handler:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest ui:latest
- name: Start services
run: |
Expand All @@ -103,3 +101,9 @@ jobs:
- name: Run upload test
run: |
make test-upload
- name: Push Images
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
run: |
docker login ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }}
make docker-local-push
14 changes: 8 additions & 6 deletions .github/workflows/test-upload-nginx.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test Nginx Upload

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_run:
Expand Down Expand Up @@ -89,9 +91,6 @@ jobs:
docker compose -f ${{ env.COMPOSE_FILE }} build
fi
# Tag the images to match docker-compose
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-api:latest api:latest
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-handler:latest handler:latest
- name: Build or load nginx images
run: |
Expand All @@ -108,9 +107,6 @@ jobs:
docker compose -f ${{ env.COMPOSE_FILE }} build
fi
# Tag the UI image to match docker-compose
docker tag ${REGISTRY_PREFIX}/${REPO_NAME}-ui:latest ui:latest
- name: Do additional Nginx setup
run: |
# create self signed certs using the hostname
Expand All @@ -137,3 +133,9 @@ jobs:
- name: Run upload test
run: |
make test-upload
- name: Push Images
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
run: |
docker login ${{ secrets.DOCKER_USERNAME }} ${{ secrets.DOCKER_PASSWORD }}
make docker-nginx-push
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,26 @@ test-upload: setup-test
clean-test:
rm -rf test/.venv
rm -rf test/__pycache__
rm -rf test/.pytest_cache
rm -rf test/.pytest_cache

# build local (non-nginx)
docker-build-local:
EZBIDS_VERSION=$(shell git describe --tags --always) docker compose build

# build nginx (non-nginx)
docker-build-nginx:
EZBIDS_VERSION=$(shell git describe --tags --always) docker compose -f docker-compose-nginx.yml build

docker-local-push:
EZBIDS_VERSION=$(shell git describe --tags --always) docker compose push

docker-nginx-push:
EZBIDS_VERSION=$(shell git describe --tags --always) docker compose -f docker-compose-nginx.yml push

docker-build-everything:
docker build -f EverythingDockerfile -t openneuropet/ezbids-everything:latest .
docker build -f EverythingDockerfile -t openneuropet/ezbids-everything:$(shell git describe --tags --always) .

docker-push-everything:
docker push openneuropet/ezbids-everything:latest
docker push openneuropet/ezbids-everything:$(shell git describe --tags --always)
33 changes: 25 additions & 8 deletions docker-compose-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ networks:

services:
mongodb:
container_name: brainlife_ezbids-mongodb
container_name: ezbids-mongodb
image: mongo:4.4.15
platform: linux/amd64
volumes:
Expand All @@ -18,8 +18,13 @@ services:
- ezbids

api:
container_name: brainlife_ezbids-api
build: .
container_name: ezbids-api
image: openneuropet/ezbids-api:${EZBIDS_VERSION:-latest}
build:
context: .
tags:
- openneuropet/ezbids-api:latest
- openneuropet/ezbids-api:${EZBIDS_VERSION:-latest}
platform: linux/amd64
volumes:
- ${EZBIDS_TMP_DIR:-/tmp/ezbids-workdir}:/tmp
Expand All @@ -38,9 +43,13 @@ services:
- ezbids

handler:
container_name: brainlife_ezbids-handler
container_name: ezbids-handler
image: openneuropet/ezbids-handler:${EZBIDS_VERSION:-latest}
build:
context: .
tags:
- openneuropet/ezbids-handler:latest
- openneuropet/ezbids-handler:${EZBIDS_VERSION:-latest}
dockerfile: handler/Dockerfile
platform: linux/amd64
volumes:
Expand All @@ -61,9 +70,13 @@ services:
ui:
# we only run this container to build the UI pages to mount into a volume
# for use in the nginx container.
container_name: brainlife_ezbids-ui-builder
container_name: ezbids-ui-builder
image: openneuropet/ezbids-ui-nginx:${EZBIDS_VERSION:-latest}
build:
context: ./ui/
tags:
- openneuropet/ezbids-ui-nginx:latest
- openneuropet/ezbids-ui-nginx:${EZBIDS_VERSION:-latest}
dockerfile: Dockerfile-production
platform: linux/amd64
environment:
Expand All @@ -76,8 +89,12 @@ services:

# by default this is not enabled, add COMPOSE_PROFILES=telemetry to your .env
telemetry:
container_name: brainlife_ezbids-telemetry
build: ./telemetry
container_name: ezbids-telemetry
build:
context: ./telemetry
tags:
- openneuropet/ezbids-telemetry:latest
- openneuropet/ezbids-telemetry:${EZBIDS_VERSION:-latest}
platform: linux/amd64
depends_on:
- mongodb
Expand All @@ -86,7 +103,7 @@ services:
- ezbids

nginx:
container_name: brainlife_ezbids-nginx
container_name: ezbids-nginx
depends_on:
- ui
- api
Expand Down
Loading