Skip to content

Commit

Permalink
added corticalflow docker
Browse files Browse the repository at this point in the history
  • Loading branch information
hvgazula committed Aug 1, 2023
1 parent b978234 commit d3ad1b8
Show file tree
Hide file tree
Showing 281 changed files with 100,538 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build the Docker image
run: docker build -t hvgazula/cortexode ./docker
run: docker build -t hvgazula/corticalflow ./docker

# Cleanup steps to free up disk space

Expand All @@ -35,4 +35,4 @@ jobs:
# if: github.event.pull_request.merged == true
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push hvgazula/cortexode
docker push hvgazula/corticalflow
Binary file added docker/CBSI.tar.gz
Binary file not shown.
34 changes: 25 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ENV PATH=/opt/miniconda3/bin:$PATH
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
ENV PIPENV_VENV_IN_PROJECT=1
ENV JCC_JDK=/usr/lib/jvm/java-8-openjdk-amd64
RUN USE_CUDA=1
RUN CUDA_VERSION=11.6.1
RUN CUDNN_VERSION=8
Expand All @@ -22,21 +24,35 @@ curl \
git \
wget \
cmake \
vim && rm -rf /var/lib/apt/lists/*
ENV PYTHON_VERSION=3.7
ENV CONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh
openjdk-8-jdk \
libaio-dev && \
apt-get install -y --no-install-recommends llvm-10 lldb-10 llvm-10-dev libllvm10 llvm-10-runtime
RUN rm -rf /var/lib/apt/lists/*
ENV PYTHON_VERSION=3.8
ENV CONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh
RUN curl -fsSL -v -o ~/miniconda.sh -O ${CONDA_URL} && \
chmod +x ~/miniconda.sh && \
~/miniconda.sh -b -p /opt/miniconda3
RUN mkdir /app

WORKDIR /app
RUN echo "redo copy"
COPY environment.yml .
COPY mesh_intersection-0.1.0-cp37-cp37m-linux_x86_64.whl .
COPY CBSI.tar.gz .
RUN tar -xf CBSI.tar.gz
RUN mkdir niftyreg-build
ENV CMAKE_BUILD_TYPE=Release
WORKDIR /app/niftyreg-build
RUN cmake ../niftyreg-CBSI
RUN make
RUN make install
WORKDIR /app
RUN conda env create -f environment.yml
SHELL ["conda", "run", "-n", "cortexode", "/bin/bash", "-c"]
RUN conda install pytorch3d=0.4.0 -c pytorch3d
RUN pip install mesh_intersection-0.1.0-cp37-cp37m-linux_x86_64.whl
SHELL ["conda", "run", "-n", "corticalflow", "/bin/bash", "-c"]
RUN pip install jcc==3.12
RUN git clone https://github.com/neuroneural/corticalflow_fork.git
WORKDIR /app/corticalflow_fork/docker/nighres
RUN git checkout tags/docker1
RUN ./build.sh
RUN python3 -m pip install .
RUN apt-get clean
RUN pip cache purge
RUN conda clean -a
Expand Down
110 changes: 67 additions & 43 deletions docker/environment.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: cortexode
name: corticalflow
channels:
- pytorch3d
- pytorch
- bottler
- iopath
- fvcore
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=5.1=1_gnu
- blas=1.0=mkl
- ca-certificates=2022.10.11=h06a4308_0
- certifi=2022.9.24=py37h06a4308_0
- colorama=0.4.6=pyhd8ed1ab_0
- cudatoolkit=10.2.89=hfd86e86_1
- dataclasses=0.8=pyhc8e2a94_3
- freetype=2.12.1=h4a9f257_0
- fvcore=0.1.5.post20220512=pyhd8ed1ab_0
- ca-certificates=2022.6.15=ha878542_0
- certifi=2022.6.15=py37h06a4308_0
- colorama=0.4.5=pyhd8ed1ab_0
- cudatoolkit=11.0.221=h6bb024c_0
- freetype=2.11.0=h70c0345_0
- fvcore=0.1.5.post20210915=py37
- giflib=5.2.1=h7b6447c_0
- intel-openmp=2021.4.0=h06a4308_3561
- iopath=0.1.9=pyhd8ed1ab_0
- iopath=0.1.9=py37
- jpeg=9b=h024ee3a_2
- lcms2=2.12=h3be6417_0
- ld_impl_linux-64=2.38=h1181459_1
Expand All @@ -37,54 +39,76 @@ dependencies:
- ncurses=6.3=h5eee18b_3
- ninja=1.10.2=h06a4308_5
- ninja-base=1.10.2=hd09550d_5
- numpy=1.21.5=py37h6c91a56_3
- numpy-base=1.21.5=py37ha15fc14_3
- nvidiacub=1.10.0=0
- openssl=1.1.1q=h7f8727e_0
- pip=22.2.2=py37h06a4308_0
- portalocker=2.6.0=py37h89c1867_0
- python=3.7.13=haa1d7c7_1
- pillow=9.2.0=py37hace64e9_1
- pip=22.1.2=py37h06a4308_0
- portalocker=2.5.1=py37h89c1867_0
- python=3.7.13=h12debd9_0
- python_abi=3.7=2_cp37m
- pytorch=1.7.1=py3.7_cuda10.2.89_cudnn7.6.5_0
- pytorch=1.7.1=py3.7_cuda11.0.221_cudnn8.0.5_0
- pytorch3d=0.6.2=py37_cu110_pyt171
- pyyaml=6.0=py37h540881e_4
- readline=8.2=h5eee18b_0
- setuptools=65.5.0=py37h06a4308_0
- readline=8.1.2=h7f8727e_1
- setuptools=61.2.0=py37h06a4308_0
- six=1.16.0=pyhd3eb1b0_1
- sqlite=3.39.3=h5082296_0
- tabulate=0.9.0=pyhd8ed1ab_1
- termcolor=2.0.1=pyhd8ed1ab_1
- sqlite=3.38.5=hc218d9a_0
- tabulate=0.8.10=pyhd8ed1ab_0
- termcolor=1.1.0=pyhd8ed1ab_3
- tk=8.6.12=h1ccaba5_0
- torchvision=0.8.2=py37_cu102
- typing_extensions=4.3.0=py37h06a4308_0
- torchaudio=0.7.2=py37
- torchvision=0.8.2=py37_cu110
- tqdm=4.64.0=pyhd8ed1ab_0
- typing_extensions=4.1.1=pyh06a4308_0
- wheel=0.37.1=pyhd3eb1b0_0
- xz=5.2.6=h5eee18b_0
- xz=5.2.5=h7f8727e_1
- yacs=0.1.8=pyhd8ed1ab_0
- yaml=0.2.5=h7f98852_2
- zlib=1.2.13=h5eee18b_0
- zlib=1.2.12=h7f8727e_2
- zstd=1.4.9=haebb681_0
- pip:
- cycler==0.11.0
- fonttools==4.38.0
- imageio==2.22.3
- joblib==1.2.0
- kiwisolver==1.4.4
- llvmlite==0.36.0
- matplotlib==3.5.3
- networkx==2.6.3
- numba==0.53.1
- numpy==1.20.0
- absl-py==1.2.0
- antlr4-python3-runtime==4.9.3
- attrs==21.4.0
- black==22.6.0
- cachetools==5.2.0
- click==8.1.3
- google-auth==2.9.1
- google-auth-oauthlib==0.4.6
- grpcio==1.47.0
- hydra-core==1.2.0
- importlib-metadata==4.12.0
- importlib-resources==5.8.0
- isort==4.3.21
- joblib==1.1.0
- markdown==3.4.1
- mccabe==0.6.1
- mypy-extensions==0.4.3
- oauthlib==3.2.0
- omegaconf==2.2.2
- packaging==21.3
- pillow==9.3.0
- pathspec==0.9.0
- platformdirs==2.5.2
- protobuf==3.19.4
- pyasn1==0.4.8
- pyasn1-modules==0.2.8
- pycodestyle==2.8.0
- pyflakes==2.4.0
- pyparsing==3.0.9
- python-dateutil==2.8.2
- pywavelets==1.3.0
- scikit-image==0.18.1
- requests-oauthlib==1.3.1
- rsa==4.9
- scikit-learn==1.0.2
- scipy==1.6.2
- scipy==1.7.3
- tensorboard==2.9.1
- tensorboard-data-server==0.6.1
- tensorboard-plugin-wit==1.8.1
- threadpoolctl==3.1.0
- tifffile==2021.11.2
- torch==1.7.1
- torchdiffeq==0.2.1
- tqdm==4.59.0
- trimesh==3.9.15
- typing-extensions==4.4.0
prefix: /home/users/washbee1/anaconda3/envs/cortexode
- tomli==2.0.1
- trimesh==3.12.9
- typed-ast==1.5.4
- werkzeug==2.1.2
- zipp==3.8.1
prefix: /data/users2/washbee/anaconda3/envs/corticalflow
Binary file not shown.
24 changes: 24 additions & 0 deletions docker/nighres/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build using conda environment
on: [push, pull_request]

jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: nighres
environment-file: conda-nighres.yml
python-version: 3.9
auto-activate-base: false
- name: Run build process
shell: bash -l {0}
run: |
./build.sh
- name: Run pip install
run: |
python3 -m pip install .
38 changes: 38 additions & 0 deletions docker/nighres/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
__pycache__/
*.pyc
*~
*.zip
*.nt.bz2
*.tar.gz
*.tgz

env/
build/
cbstools-public/
imcn-imaging/
nighresjava/
develop-eggs/
dist/
downloads/
lib/
lib64/
parts/
sdist/
var/
eggs/
.eggs/
nighres.egg-info/
nighres.egg
.installed.cfg

.so
.jar

travis.log

doc/_build
doc/auto_examples
doc/gen_modules
doc/modules/generated

nighres_examples
35 changes: 35 additions & 0 deletions docker/nighres/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
matrix:
include:
- dist: bionic
language: java
jdk: openjdk11
before_install:
- export JCC_JDK=/usr/lib/jvm/java-11-openjdk-amd64
- sudo ln -s /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so /usr/lib/libjvm.so
- sudo ln -s /usr/lib/jvm/java-11-openjdk-amd64/lib/libjava.so /usr/lib/libjava.so
- sudo apt-get update
- sudo apt-get install python3.6
- sudo apt-get install python3-pip
- python3 -m pip install --upgrade --user setuptools
- python3 -m pip install --upgrade --user wheel
- python3 -m pip install --upgrade --user JCC
script: "travis/make_dist.sh"
# before_deploy:
# - python3 -m pip install --user twine
# - python3 -m pip install --user urllib3[secure]
# deploy:
# provider: pypi
# #server: https://test.pypi.org/legacy/
# user: "nighres"
# # using plain text password for testpypi, when switching to real pypi use encrypted (below)
# password:
# secure: "S010GtC13p8KB6lXiuPVDhCWk++PGCPGVmX9Kd7AL91c6KTSRnPAoWCGNPrgbPtKjapiuYd2f4D2iWuURdpI6OYUahzH/dlHJVDHJNZ3XFfE7eIylwnKxKGtlXxu0Tm+JLrN1gprU3bCWH9MbpWINgmccCXO+YJfDcsVzFd/ywJ2oo4n7fntAMOhj3djRlkXh57pPLM3LKQeHSjjx8RMYTwKCVUAMB76iUnfcow7Lcmo73KghD/71uJEr8AA0RDB0uC8x9DAR/RL4g8JL1PR0ocOJ9iHsBus1jHxsxw+ISVP6iCiJNqKUKV3JbZ7PJ997YxpmInTBJNnAzGkne7dy77f10m3RMHKjsFimg0yQouPGDi8hBk2/0i2piDErq6lf2x4rTvWsIBhKroaNUjvltFl2N6OCGMzN1xsnYtzrUWc5DuY9XerEVFkPIpd+i/ojyBqU+ssj5fwMRNoACWxFZ/Hxf1YwEpU9OgBXfiU3SK4VwGPf2s2zXbqTT+ogiNB+EYhdrAaPaFgjLkfoLjLxpSnmE2WTJphmLFCx9ZRbW5tS++K+iJ5Cyc+pTjIfzb7KLLPAvhD99VEikutp8X91pRT1LTUWV921ymD0BKtF4K2eUJZSYiVO4ct9sl2GQIi0v1rRfDWxN+9pUnCOP1cPHnXTe0qGH26ulf48lQejm8="
# skip_cleanup: true
# on:
# tags: true
# branch: master
# condition: $TRAVIS_PYTHON_VERSION = "2.7" once we run travis against
# multiple python versions, this ensures that the package will be deployed only once

notifications:
email: false
58 changes: 58 additions & 0 deletions docker/nighres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get -y install sudo && \
sudo apt-get update -qq && \
apt-get install -y python3 \
python3-pip \
python3-dev \
build-essential \
software-properties-common \
openjdk-8-jdk \
git \
wget && \
sudo add-apt-repository ppa:openjdk-r/ppa && \
apt-get update -qq && \
apt-get install -y openjdk-8-jdk

RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home
ENV JAVA_HOME=/docker-java-home \
JCC_JDK=/docker-java-home

RUN apt-get install libffi-dev && \
python3 -m pip install --upgrade "pip < 21.0" \
wheel \
JCC \
urllib3 && \
python3 -m pip install jupyter \
nilearn \
sklearn \
nose \
matplotlib \
scipy \
psutil

RUN useradd --no-user-group --create-home --shell /bin/bash neuro && \
mkdir /home/neuro/nighres
COPY build.sh cbstools-lib-files.sh setup.py MANIFEST.in README.rst LICENSE imcntk-lib-files.sh /home/neuro/nighres/
COPY nighres /home/neuro/nighres/nighres

RUN cd /home/neuro/nighres && \
./build.sh && \
cd /home/neuro/nighres && python3 -m pip install . && \
mkdir /home/neuro/notebooks && \
chown -R neuro /home/neuro

COPY docker/jupyter_notebook_config.py /etc/jupyter/

EXPOSE 8888

ENV TINI_VERSION v0.6.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "--"]

EXPOSE 8888
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0"]

USER neuro
Loading

0 comments on commit d3ad1b8

Please sign in to comment.