From bb7048f5861cf1b1c002a6c220b197861110e3fd Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:38:31 -0400 Subject: [PATCH 1/9] single dockerfile behaves --- EverythingDockerfile | 247 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 EverythingDockerfile diff --git a/EverythingDockerfile b/EverythingDockerfile new file mode 100644 index 0000000..da28e9f --- /dev/null +++ b/EverythingDockerfile @@ -0,0 +1,247 @@ +# EverythingDockerfile - Multistage build combining all services +# This combines mongodb, api, handler, ui, and telemetry into a single container + +# Stage 1: MongoDB base +FROM mongo:4.4.15 AS mongodb-stage +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* + +# Stage 2: Neuroimaging tools and handler dependencies +FROM neurodebian:nd20.04-non-free AS neuroimaging-stage +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND noninteractive + +RUN apt update && \ + apt-get update && apt-get upgrade -y + +RUN apt update && apt install -y parallel python3 python3-pip tree curl unzip git jq python libgl-dev python-numpy bc + +RUN pip3 install numpy==1.23.0 nibabel==4.0.0 pandas matplotlib pyyaml==5.4.1 pydicom==2.3.1 natsort pydeface && \ + pip3 install quickshear mne mne-bids pypet2bids==1.4.1 + +RUN apt-get install -y build-essential pkg-config cmake git pigz rename zstd libopenjp2-7 libgdcm-tools wget libopenblas-dev && \ + apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y + +RUN touch /.pet2bidsconfig && chown 1001:1001 /.pet2bidsconfig +RUN echo "DEFAULT_METADATA_JSON=/usr/local/lib/python3.8/dist-packages/pypet2bids/template_json.json" > /.pet2bidsconfig + +RUN mkdir -p /usr/local/fsl && \ + git clone https://github.com/dlevitas/FSL_binaries /usr/local/fsl && \ + rm -rf /usr/local/fsl/README.md && \ + mkdir -p /usr/local/fsl/data/standard && \ + mv /usr/local/fsl/bin/MNI152_T1_2mm_brain.nii.gz /usr/local/fsl/data/standard + +ENV FSLDIR=/usr/local/fsl +ENV PATH=$PATH:$FSLDIR/bin +ENV FSLOUTPUTTYPE=NIFTI_GZ + +RUN apt-get update \ + && apt-get install -y ca-certificates curl gnupg \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + +ARG NODE_MAJOR=20 +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + +RUN apt-get update \ + && apt-get install nodejs -y + +RUN cd /tmp && curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip \ + && unzip /tmp/dcm2niix_lnx.zip \ + && mv dcm2niix /usr/local/bin + +RUN mkdir -p /app + +# Get bids-specification from github +RUN cd /app && git clone https://github.com/bids-standard/bids-specification && \ + cd bids-specification && git checkout 3537e9edbc81545614d3ee605c398361099b6977 + +#install ROBEX +ADD https://www.nitrc.org/frs/download.php/5994/ROBEXv12.linux64.tar.gz//?i_agree=1&download_now=1 / +RUN tar -xzf /ROBEXv12.linux64.tar.gz +ENV PATH /ROBEX:$PATH + +ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH + +#install bids-validator +RUN npm install -g npm@9.5.1 +RUN npm install -g bids-validator@1.14.8 +RUN git clone https://github.com/bids-standard/bids-validator + +# Stage 3: Node.js base for API and UI +FROM node:20 AS nodejs-stage +RUN npm install -g npm@9.5.1 pm2 typescript tsc-watch + +# Stage 4: Telemetry dependencies +FROM neurodebian:nd20.04-non-free AS telemetry-stage +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND noninteractive + +RUN apt update && \ + apt-get update && apt-get upgrade -y + +RUN apt install -y parallel python3 python3-pip tree curl unzip git jq python libgl-dev python-numpy +RUN pip3 install --upgrade pip +RUN pip3 install conversiontelemetry + +# Stage 5: Final combined stage +FROM neurodebian:nd20.04-non-free AS everything +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND noninteractive + +# Install system dependencies +RUN apt update && \ + apt-get update && apt-get upgrade -y && \ + apt install -y parallel python3 python3-pip tree curl unzip git jq python libgl-dev python-numpy bc \ + build-essential pkg-config cmake git pigz rename zstd libopenjp2-7 libgdcm-tools wget libopenblas-dev \ + ca-certificates gnupg supervisor && \ + apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y + +# Install Node.js 20 +RUN mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + +ARG NODE_MAJOR=20 +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + +RUN apt-get update && apt-get install nodejs -y + +# Install Python packages +RUN pip3 install numpy==1.23.0 nibabel==4.0.0 pandas matplotlib pyyaml==5.4.1 pydicom==2.3.1 natsort pydeface && \ + pip3 install quickshear mne mne-bids pypet2bids==1.4.1 conversiontelemetry + +# Install MongoDB +RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - && \ + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list && \ + apt-get update && \ + apt-get install -y mongodb-org=4.4.15 mongodb-org-server=4.4.15 mongodb-org-shell=4.4.15 mongodb-org-mongos=4.4.15 mongodb-org-tools=4.4.15 + +# Install neuroimaging tools +RUN touch /.pet2bidsconfig && chown 1001:1001 /.pet2bidsconfig +RUN echo "DEFAULT_METADATA_JSON=/usr/local/lib/python3.8/dist-packages/pypet2bids/template_json.json" > /.pet2bidsconfig + +RUN mkdir -p /usr/local/fsl && \ + git clone https://github.com/dlevitas/FSL_binaries /usr/local/fsl && \ + rm -rf /usr/local/fsl/README.md && \ + mkdir -p /usr/local/fsl/data/standard && \ + mv /usr/local/fsl/bin/MNI152_T1_2mm_brain.nii.gz /usr/local/fsl/data/standard + +ENV FSLDIR=/usr/local/fsl +ENV PATH=$PATH:$FSLDIR/bin +ENV FSLOUTPUTTYPE=NIFTI_GZ + +# Install dcm2niix +RUN cd /tmp && curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip \ + && unzip /tmp/dcm2niix_lnx.zip \ + && mv dcm2niix /usr/local/bin + +# Install ROBEX +ADD https://www.nitrc.org/frs/download.php/5994/ROBEXv12.linux64.tar.gz//?i_agree=1&download_now=1 / +RUN tar -xzf /ROBEXv12.linux64.tar.gz +ENV PATH /ROBEX:$PATH + +# Install Node.js global packages +RUN npm install -g npm@9.5.1 pm2 typescript tsc-watch bids-validator@1.14.8 + +# Get bids-specification from github +RUN mkdir -p /app && \ + cd /app && git clone https://github.com/bids-standard/bids-specification && \ + cd bids-specification && git checkout 3537e9edbc81545614d3ee605c398361099b6977 + +# Clone bids-validator +RUN git clone https://github.com/bids-standard/bids-validator /app/bids-validator + +# Copy application code +COPY . /app + +# Generate keys for API +WORKDIR /app +RUN ./generate_keys.sh + +# Install API dependencies and build +WORKDIR /app/api +RUN cp /app/package.json /app/api/ && npm install && npx tsc + +# Install handler dependencies and build +WORKDIR /app/handler +RUN npm install && npx tsc + +# Install UI dependencies +WORKDIR /app/ui +RUN npm install + +# Copy UI entrypoint +COPY ui/entrypoint.sh /entrypoint-ui.sh +RUN chmod +x /entrypoint-ui.sh + +# Copy telemetry environment +COPY telemetry/telemetry.env /root/.telemetry.env + +# Create supervisor configuration +RUN mkdir -p /etc/supervisor/conf.d +COPY < Date: Wed, 17 Sep 2025 14:07:25 -0400 Subject: [PATCH 2/9] update readme with instructions --- README.md | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b1e62ba..9d26211 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The secure, cloud-based service for the semi-automated mapping of entire session ### About -This is the repository for a semi-supervised web-service for converting neuroimaging data files to [BIDS](https://bids.neuroimaging.io/). The web service is securely hosted at [brainlife.io/ezbids](https://brainlife.io/ezbids). For additional details on security feaures, please see [here](https://brainlife.io/docs/using_ezBIDS/#faq). +This is the repository for a semi-supervised web-service for converting neuroimaging data files to [BIDS](https://bids.neuroimaging.io/). This specific repository exists for users wishing to deploy this web service on premise. Unlike other BIDS converters, ezBIDS eliminates the need for coding and command line interfaces (CLI), doing the bulk of the work behind the scenes to save users time. Importantly, ezBIDS does not require an organizational structure for uploaded data. @@ -32,19 +32,48 @@ Helpful links: ### Usage -To access the ezBIDS web service, please visit https://brainlife.io/ezbids. If you do not have a brainlife.io account, you will be prompted to create one for authentication purposes. - Users do not need to organize their uploaded data in any specific manner, and users may choose to compress (e.g. zip, tar) their uploaded data. Should users feel the need to anonymize data before uploading, we strongly recommend that subjects (and sessions, if applicable) be organized into subject (and session) folders, with explicit labeling of the preferred subjects (and sessions) IDs (e.g. `MRI_data/sub-01/ses-01/DICOMS`). Failure to do so for non-anonymized data may result in an inaccurate *first guess* and require additional edits in the web browser. #### Local Usage -There are two methods for deploying this service one for local use and another using nginx for sitewide deployments. +There are three methods for deploying this service one for local use, another using nginx for sitewide deployments, and an apptainer option for local use +where docker is unavailable. + +For users that can are not setting this service up for others it's recommended to run without nginx. Additionally, for impermanent deployments +users can be up and running with 1 command and no other configuration: + +```bash +docker compose up +# or to hide the output +docker compose up -d +``` + +**Apptainer Use** + +The apptainer image must be built from the `EverythingDockerfile`, which is in turn dependent on the images defined/tagged in `docker-compose.yml` being +built. To create the apptainer image one must do the following: + +```bash +git clone https://github.com/openneuropet/ezbids_docker.git +cd ezbids_docker +docker compose build +docker build -f EverythingDockerfile -t ezbids-everything . +``` + +Then the run the following apptainer commands: +```bash +apptainer build ezbids-everything.sif docker-daemon://ezbids-everything:latest +apptainer run --fakeroot --writable-tmpfs --cleanenv --no-home ezbids-everything.sif +``` + +It should be noted that apptainer occasionally changes which ports it maps the ezBIDS ui to, but that will be mentioned in the console following +the apptainer run step above. -For users that can are not setting this service up for others it's recommended to run without nginx. +**Back to Docker** -In either case, the initial setup requires configuring the local environment via +For a sitewide deployment, the initial setup requires configuring the local environment via a `.env` file. The first steps are to copy the `example.env` file in this repo to `.env`: From d5f0cc1a77ff394d16bf39b6a58bd70d3c90cd8a Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 12:05:42 -0400 Subject: [PATCH 3/9] Added apptainer CI --- .github/workflows/apptainer-build-local.yml | 135 ++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 .github/workflows/apptainer-build-local.yml diff --git a/.github/workflows/apptainer-build-local.yml b/.github/workflows/apptainer-build-local.yml new file mode 100644 index 0000000..6767c9e --- /dev/null +++ b/.github/workflows/apptainer-build-local.yml @@ -0,0 +1,135 @@ +name: Test Local Upload + +on: + pull_request: + branches: [ master ] + workflow_run: + workflows: ["Docker Build (Local)"] + types: + - completed + workflow_dispatch: # Allow manual triggering + +jobs: + Test-Local-Uploads: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} + + env: + COMPOSE_FILE: ./docker-compose.yml + REGISTRY_PREFIX: docker.io/library + SERVER_NAME: localhost + + steps: + - uses: actions/checkout@v4 + with: + submodules: true # Ensure we get the submodule info + + - name: Set repository name + run: echo "REPO_NAME=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV + + - name: Cache test data + uses: actions/cache@v4 + id: test-data-cache + with: + path: test/test_data + key: test-data-${{ hashFiles('.gitmodules') }} + restore-keys: | + test-data- + + - name: Get test data if not cached + if: steps.test-data-cache.outputs.cache-hit != 'true' + 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: Setup Apptainer + run: | + sudo apt update + sudo apt install -y software-properties-common + sudo add-apt-repository -y ppa:apptainer/ppa + sudo apt update + sudo apt install -y apptainer + + apptainer --version + + - name: Build Single Docker Image + run: | + docker build -f EverythingDockerfile -t ezbids-everything . + + - name: Build Apptainer Image + run: | + apptainer build ezbids-everything.sif docker-daemon://ezbids-everything:latest + + - name: Run Apptainer Image + run: | + nohup apptainer run --fakeroot --writable-tmpfs --cleanenv --no-home ezbids-everything.sif 2>&1 & + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Verify uv installation + run: uv --versioni + + - name: Verify Apptainer image is running + run: | + apptainer instance list | grep ezbids-everything + if [ $? -ne 0 ]; then + echo "Apptainer image is not running" + exit 1 + fi + + - name: Run upload test + run: | + make test-upload + + - name: Verify Apptainer image is running after upload + run: | + apptainer instance list | grep ezbids-everything + if [ $? -ne 0 ]; then + echo "Apptainer image is not running" + exit 1 + fi + + From fa19f3e25ccd9d073a1fc42fce2da1ed8dee574c Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 12:31:03 -0400 Subject: [PATCH 4/9] added ci to build and test single image --- .../docker-build-everything-image.yaml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 .github/workflows/docker-build-everything-image.yaml diff --git a/.github/workflows/docker-build-everything-image.yaml b/.github/workflows/docker-build-everything-image.yaml new file mode 100644 index 0000000..de60364 --- /dev/null +++ b/.github/workflows/docker-build-everything-image.yaml @@ -0,0 +1,106 @@ +name: Test Local Upload + +on: + pull_request: + branches: [ master ] + workflow_run: + workflows: ["Docker Build (Local)"] + types: + - completed + workflow_dispatch: # Allow manual triggering + +jobs: + Test-Local-Uploads: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} + + env: + COMPOSE_FILE: ./docker-compose.yml + REGISTRY_PREFIX: docker.io/library + SERVER_NAME: localhost + + steps: + - uses: actions/checkout@v4 + with: + submodules: true # Ensure we get the submodule info + + - name: Set repository name + run: echo "REPO_NAME=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV + + - name: Cache test data + uses: actions/cache@v4 + id: test-data-cache + with: + path: test/test_data + key: test-data-${{ hashFiles('.gitmodules') }} + restore-keys: | + test-data- + + - name: Get test data if not cached + if: steps.test-data-cache.outputs.cache-hit != 'true' + 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: Build Single Docker Image + run: | + docker build -f EverythingDockerfile -t ezbids-everything . + + - name: Start Services + run: | + docker run -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything --daemon + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Verify uv installation + run: uv --version + + - name: Run upload test + run: | + make test-upload + + + From af661f1a1a29873e632b5dc6138ecd23e665ad37 Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 12:43:57 -0400 Subject: [PATCH 5/9] updated actions added cleanup for apptainer --- .github/scripts/util_free_space.sh | 94 +++++++++++++++++++ .github/workflows/apptainer-build-local.yml | 10 +- .../docker-build-everything-image.yaml | 4 +- 3 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 .github/scripts/util_free_space.sh diff --git a/.github/scripts/util_free_space.sh b/.github/scripts/util_free_space.sh new file mode 100644 index 0000000..3f1fc71 --- /dev/null +++ b/.github/scripts/util_free_space.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -eux + +df -h +echo "::group::/usr/local/*" +du -hsc /usr/local/* +echo "::endgroup::" +# ~1GB +sudo rm -rf \ + /usr/local/aws-sam-cil \ + /usr/local/julia* || : +echo "::group::/usr/local/bin/*" +du -hsc /usr/local/bin/* +echo "::endgroup::" +# ~1GB (From 1.2GB to 214MB) +sudo rm -rf \ + /usr/local/bin/aliyun \ + /usr/local/bin/azcopy \ + /usr/local/bin/bicep \ + /usr/local/bin/cmake-gui \ + /usr/local/bin/cpack \ + /usr/local/bin/helm \ + /usr/local/bin/hub \ + /usr/local/bin/kubectl \ + /usr/local/bin/minikube \ + /usr/local/bin/node \ + /usr/local/bin/packer \ + /usr/local/bin/pulumi* \ + /usr/local/bin/sam \ + /usr/local/bin/stack \ + /usr/local/bin/terraform || : +# 142M +sudo rm -rf /usr/local/bin/oc || : \ +echo "::group::/usr/local/share/*" +du -hsc /usr/local/share/* +echo "::endgroup::" +# 506MB +sudo rm -rf /usr/local/share/chromium || : +# 1.3GB +sudo rm -rf /usr/local/share/powershell || : +echo "::group::/usr/local/lib/*" +du -hsc /usr/local/lib/* +echo "::endgroup::" +# 15GB +sudo rm -rf /usr/local/lib/android || : +# 341MB +sudo rm -rf /usr/local/lib/heroku || : +# 1.2GB +sudo rm -rf /usr/local/lib/node_modules || : +echo "::group::/opt/*" +du -hsc /opt/* +echo "::endgroup::" +# 679MB +sudo rm -rf /opt/az || : +echo "::group::/opt/microsoft/*" +du -hsc /opt/microsoft/* +echo "::endgroup::" +# 197MB +sudo rm -rf /opt/microsoft/powershell || : +echo "::group::/opt/hostedtoolcache/*" +du -hsc /opt/hostedtoolcache/* +echo "::endgroup::" +# 5.3GB +sudo rm -rf /opt/hostedtoolcache/CodeQL || : +# 1.4GB +sudo rm -rf /opt/hostedtoolcache/go || : +# 489MB +sudo rm -rf /opt/hostedtoolcache/PyPy || : +# 376MB +sudo rm -rf /opt/hostedtoolcache/node || : +# Remove Web browser packages +#sudo apt purge -y \ +# firefox \ +# google-chrome-stable \ +# microsoft-edge-stable +df -h \ No newline at end of file diff --git a/.github/workflows/apptainer-build-local.yml b/.github/workflows/apptainer-build-local.yml index 6767c9e..f6dcb82 100644 --- a/.github/workflows/apptainer-build-local.yml +++ b/.github/workflows/apptainer-build-local.yml @@ -1,4 +1,4 @@ -name: Test Local Upload +name: Test Apptainer Build Local on: pull_request: @@ -10,7 +10,7 @@ on: workflow_dispatch: # Allow manual triggering jobs: - Test-Local-Uploads: + Test-Apptainer-Local-Uploads-and-Build: runs-on: ubuntu-latest if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} @@ -81,6 +81,12 @@ jobs: 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 + # remove the tar files + rm mongo.tar api.tar handler.tar ui.tar + + + - name: Clean Up some More Space + run: bash .github/scripts/util_free_space.sh - name: Setup Apptainer run: | diff --git a/.github/workflows/docker-build-everything-image.yaml b/.github/workflows/docker-build-everything-image.yaml index de60364..38ff67f 100644 --- a/.github/workflows/docker-build-everything-image.yaml +++ b/.github/workflows/docker-build-everything-image.yaml @@ -1,4 +1,4 @@ -name: Test Local Upload +name: Test Docker Build Everything Image on: pull_request: @@ -10,7 +10,7 @@ on: workflow_dispatch: # Allow manual triggering jobs: - Test-Local-Uploads: + Test-Docker-Build-Everything-Image: runs-on: ubuntu-latest if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} From 7fa18b5e9d8d5f6b22e337ff63c704a65a0be051 Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:05:55 -0400 Subject: [PATCH 6/9] nm rm --- .github/workflows/apptainer-build-local.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/apptainer-build-local.yml b/.github/workflows/apptainer-build-local.yml index f6dcb82..71908cb 100644 --- a/.github/workflows/apptainer-build-local.yml +++ b/.github/workflows/apptainer-build-local.yml @@ -81,9 +81,6 @@ jobs: 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 - # remove the tar files - rm mongo.tar api.tar handler.tar ui.tar - - name: Clean Up some More Space run: bash .github/scripts/util_free_space.sh From 441f778c124e687d0ec28b57e58f49402b48c5dc Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:07:39 -0400 Subject: [PATCH 7/9] not daemon -d is detach --- .github/workflows/docker-build-everything-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-everything-image.yaml b/.github/workflows/docker-build-everything-image.yaml index 38ff67f..9d79b2b 100644 --- a/.github/workflows/docker-build-everything-image.yaml +++ b/.github/workflows/docker-build-everything-image.yaml @@ -88,7 +88,7 @@ jobs: - name: Start Services run: | - docker run -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything --daemon + docker run -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything -d - name: Install uv run: | From f55cd857469b94dd3a2f30d4f9f05d9e37551027 Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:30:31 -0400 Subject: [PATCH 8/9] fix typi --- .github/workflows/apptainer-build-local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apptainer-build-local.yml b/.github/workflows/apptainer-build-local.yml index 71908cb..60727cf 100644 --- a/.github/workflows/apptainer-build-local.yml +++ b/.github/workflows/apptainer-build-local.yml @@ -113,7 +113,7 @@ jobs: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Verify uv installation - run: uv --versioni + run: uv --version - name: Verify Apptainer image is running run: | From ad0cf5d55eb1c4243fd8ddb9c59f4ee1eb97950f Mon Sep 17 00:00:00 2001 From: Anthony Galassi <28850131+bendhouseart@users.noreply.github.com> Date: Thu, 18 Sep 2025 15:12:30 -0400 Subject: [PATCH 9/9] apptainer and docker misunderstandings --- .github/workflows/apptainer-build-local.yml | 2 +- .github/workflows/docker-build-everything-image.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apptainer-build-local.yml b/.github/workflows/apptainer-build-local.yml index 60727cf..09705b5 100644 --- a/.github/workflows/apptainer-build-local.yml +++ b/.github/workflows/apptainer-build-local.yml @@ -105,7 +105,7 @@ jobs: - name: Run Apptainer Image run: | - nohup apptainer run --fakeroot --writable-tmpfs --cleanenv --no-home ezbids-everything.sif 2>&1 & + apptainer instance start --fakeroot --writable-tmpfs --cleanenv --no-home ezbids-everything.sif ezbids-everything - name: Install uv run: | diff --git a/.github/workflows/docker-build-everything-image.yaml b/.github/workflows/docker-build-everything-image.yaml index 9d79b2b..18a45d5 100644 --- a/.github/workflows/docker-build-everything-image.yaml +++ b/.github/workflows/docker-build-everything-image.yaml @@ -88,8 +88,7 @@ jobs: - name: Start Services run: | - docker run -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything -d - + docker run -d -p 27017:27017 -p 8082:8082 -p 3000:3000 -p 8000:8000 -v /tmp/ezbids-workdir:/tmp ezbids-everything - name: Install uv run: | curl -LsSf https://astral.sh/uv/install.sh | sh