Skip to content

Commit

Permalink
add s3fs in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
maximemulder committed Oct 31, 2024
1 parent 9810e93 commit eb802b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ env:
DATABASE_NAME: TestDatabase
DATABASE_USERNAME: TestUsername
DATABASE_PASSWORD: TestPassword
BUCKET_URL: https://ace-minio-1.loris.ca:9000
BUCKET_NAME: loris-rb-data
BUCKET_ACCESS_KEY: lorisadmin
BUCKET_SECRET_KEY: Tn=qP3LupmXnMuc

jobs:
docker:
Expand Down Expand Up @@ -52,10 +56,26 @@ jobs:
DATABASE_NAME=${{ env.DATABASE_NAME }}
DATABASE_USER=${{ env.DATABASE_USERNAME }}
DATABASE_PASS=${{ env.DATABASE_PASSWORD }}
BUCKET_URL=${{ env.BUCKET_URL }}
BUCKET_NAME=${{ env.BUCKET_NAME }}
BUCKET_ACCESS_KEY=${{ env.BUCKET_ACCESS_KEY }}
BUCKET_SECRET_KEY=${{ env.BUCKET_SECRET_KEY }}
tags: loris-mri
load: true
cache-from: type=gha,scope=loris-mri
cache-to: type=gha,scope=loris-mri
cache-to: type=gha,mode=max,scope=loris-mri

# TODO: Move as much as possible of this in the MRI dockerfile
- name: Mount imaging files S3 bucket
run: |
sudo apt-get update
sudo apt-get install -y s3fs fuse kmod
sudo modprobe fuse
sudo mkdir /data-imaging
touch .passwd-s3fs
chmod 600 .passwd-s3fs
echo ${{ env.BUCKET_ACCESS_KEY }}:${{ env.BUCKET_SECRET_KEY }} > .passwd-s3fs
sudo s3fs ${{ env.BUCKET_NAME }} /data-imaging -o passwd_file=.passwd-s3fs -o url=${{ env.BUCKET_URL }} -o use_path_request_style -o allow_other
- name: Run integration tests
run: docker compose --file ./test/docker-compose.yml run mri pytest python/tests/integration
2 changes: 2 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
retries: 5
mri:
image: loris-mri
volumes:
- /data-imaging:/data-imaging
depends_on:
db:
condition: service_healthy
17 changes: 5 additions & 12 deletions test/mri.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@ RUN apt-get update
# Install utilities #
#####################

# Update the package list and install build-essential, checkinstall, and cmake
# Install some general dependencies
RUN apt-get install -y build-essential checkinstall cmake libzip-dev mariadb-client

# Install Perl and update CPAN
RUN apt-get install -y perl && \
cpan CPAN
# Install the dependencies of LORIS-MRI
RUN apt-get install -y build-essential checkinstall cmake dcmtk libzip-dev mariadb-client perl

# Install utilities
# - `wget` is used by some installation commands
# - `sudo` is used by the imaging install script
RUN apt-get install -y wget sudo

# Install the DICOM Toolkit
RUN apt-get install -y dcmtk
# - `s3fs` is used to mount the imaging files on the file system
# - `wget` is used by some installation commands
RUN apt-get install -y sudo wget

########################
# Install MINC Toolkit #
Expand Down

0 comments on commit eb802b7

Please sign in to comment.