generated from AICONSlab/HippMapp3r
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6ac3610
Showing
52 changed files
with
3,278 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
# https://circleci.com/orbs/registry/orb/circleci/docker-publish | ||
docker-publish: circleci/[email protected] | ||
|
||
jobs: | ||
|
||
build: | ||
environment: | ||
- TZ: "/usr/share/zoneinfo/Canada/Toronto" | ||
- CONTAINER_NAME: "mgoubran/hippmapper" | ||
docker: | ||
- image: docker:18.06.3-ce-git | ||
working_directory: /tmp/src/HippMapp3r | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Build Docker images | ||
no_output_timeout: 60m | ||
command: | | ||
# Build docker image | ||
hippmapper_VERSION=$(cat /tmp/src/HippMapp3r/hippmapper/__init__.py | tr -dc '0-9' | sed 's/./&./g') | ||
echo "hippmapper version is ${hippmapper_VERSION}" | ||
e=1 && for i in {1..5}; do | ||
docker build \ | ||
--rm=false \ | ||
-t ${CONTAINER_NAME} \ | ||
-f /tmp/src/HippMapp3r/Dockerfile \ | ||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ | ||
--build-arg VCS_REF=`git rev-parse --short HEAD` \ | ||
--build-arg VERSION="${CIRCLE_TAG:-$THISVERSION}" . \ | ||
&& e=0 && break || sleep 15 | ||
done && [ "$e" -eq "0" ] | ||
- run: | ||
name: Run Tests | ||
no_output_timeout: 2h | ||
command: | | ||
echo "Runing tests:" | ||
docker run --entrypoint bash -it mgoubran/hippmapper -c "hippmapper seg_hipp -t1 /HippMapp3r/data/test_case/mprage.nii.gz" | ||
- store_test_results: | ||
path: /home/circleci/out/tests | ||
|
||
|
||
workflows: | ||
build_and_test: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
|
||
# This workflow will deploy images on merge to master only | ||
docker_with_lifecycle: | ||
jobs: | ||
- docker-publish/publish: | ||
image: mgoubran/hippmapper | ||
tag: latest | ||
filters: | ||
branches: | ||
only: master | ||
after_build: | ||
- run: | ||
name: Publish Docker Tag with hippmapper Version | ||
command: | | ||
docker tag mgoubran/hippmapper:latest mgoubran/hippmapper:0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# models directory | ||
models/ | ||
|
||
# .idea directory | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Use a Linux Distro as a parent image | ||
FROM ubuntu:16.04 | ||
|
||
# Set up | ||
RUN apt-get update && apt-get install -y git wget build-essential g++ gcc cmake curl clang && \ | ||
apt-get install -y libfreetype6-dev apt-utils pkg-config vim gfortran && \ | ||
apt-get install -y binutils make linux-source unzip && \ | ||
apt install -y libsm6 libxext6 libfontconfig1 libxrender1 libgl1-mesa-glx | ||
|
||
# Install c3d | ||
RUN wget https://downloads.sourceforge.net/project/c3d/c3d/Nightly/c3d-nightly-Linux-x86_64.tar.gz && \ | ||
tar -xzvf c3d-nightly-Linux-x86_64.tar.gz && mv c3d-1.1.0-Linux-x86_64 /opt/c3d && \ | ||
rm c3d-nightly-Linux-x86_64.tar.gz | ||
ENV PATH /opt/c3d/bin:${PATH} | ||
|
||
# FSL | ||
# Installing Neurodebian packages FSL | ||
RUN wget -O- http://neuro.debian.net/lists/xenial.us-tn.full | tee /etc/apt/sources.list.d/neurodebian.sources.list | ||
RUN apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 | ||
|
||
# Install FSL | ||
RUN apt-get update && apt-get install -y fsl | ||
|
||
ENV FSLDIR="/usr/share/fsl/5.0" \ | ||
FSLOUTPUTTYPE="NIFTI_GZ" \ | ||
FSLMULTIFILEQUIT="TRUE" \ | ||
POSSUMDIR="/usr/share/fsl/5.0" \ | ||
LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH" \ | ||
FSLTCLSH="/usr/bin/tclsh" \ | ||
FSLWISH="/usr/bin/wish" \ | ||
POSSUMDIR="/usr/share/fsl/5.0" | ||
|
||
ENV PATH="/usr/lib/fsl/5.0":${PATH} | ||
|
||
# Install ANTs | ||
ENV ANTSPATH /opt/ANTs | ||
RUN mkdir -p /opt/ANTs && \ | ||
curl -sSL "https://dl.dropbox.com/s/2f4sui1z6lcgyek/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz" \ | ||
| tar -xzC $ANTSPATH --strip-components 1 | ||
ENV PATH=${ANTSPATH}:${PATH} | ||
|
||
# Install miniconda | ||
RUN curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash Miniconda3-latest-Linux-x86_64.sh -p /opt/miniconda -b && \ | ||
rm Miniconda3-latest-Linux-x86_64.sh | ||
ENV PATH=/opt/miniconda/bin:${PATH} | ||
|
||
# Install all needed packages based on pip installation | ||
RUN git clone https://github.com/mgoubran/HippMapp3r.git && \ | ||
cd HippMapp3r && \ | ||
pip install git+https://www.github.com/keras-team/keras-contrib.git && \ | ||
pip install -e .[hippmapper] | ||
|
||
# Download models, store in directory | ||
RUN mkdir /HippMapp3r/models && \ | ||
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1ftE79HF-sWXGa_X2bOUc-ldyWQEB5-Dz' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1ftE79HF-sWXGa_X2bOUc-ldyWQEB5-Dz" -O /HippMapp3r/models/hipp_model.json && \ | ||
rm -rf /tmp/cookies.txt && \ | ||
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=19zEi7552X93_5JbEokfry2Y28gFeVGt2' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=19zEi7552X93_5JbEokfry2Y28gFeVGt2" -O /HippMapp3r/models/hipp_model_weights.h5 && \ | ||
rm -rf /tmp/cookies.txt && \ | ||
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1NmyniIkAk_wY2OW4YqEp9vF7IlVsRfrA' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1NmyniIkAk_wY2OW4YqEp9vF7IlVsRfrA" -O /HippMapp3r/models/hipp_zoom_model.json && \ | ||
rm -rf /tmp/cookies.txt && \ | ||
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=10uPh9byC-7Qj7Duwgh9gyQcSXH-CwWz1' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=10uPh9byC-7Qj7Duwgh9gyQcSXH-CwWz1" -O /HippMapp3r/models/hipp_zoom_model_weights.h5 && \ | ||
rm -rf /tmp/cookies.txt | ||
|
||
# Run hippmapper when the container launches | ||
ENTRYPOINT /bin/bash |
Oops, something went wrong.