Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c75c69c
Create dockerimage.yml
Robbie1977 Nov 18, 2019
3e395c5
adding base36
Robbie1977 Jan 21, 2020
9828388
adding requirements
Robbie1977 Jan 21, 2020
5adc95b
adding requirements in 3.7
Robbie1977 Jan 24, 2020
bbc55e0
not needed
Robbie1977 Jan 24, 2020
8b28a7e
reverting to working
Robbie1977 Jan 24, 2020
7564759
using binary version
Robbie1977 Jan 24, 2020
3fe845a
checking
Robbie1977 Jan 24, 2020
7cec7f3
fix to add universe repositories
Robbie1977 May 22, 2020
fbd3bf0
typo fix
Robbie1977 May 22, 2020
6a90295
testing with xenial
Robbie1977 May 22, 2020
aefdef4
fixing to bionic
Robbie1977 May 22, 2020
e75dda6
limiting update to opt
Robbie1977 Apr 23, 2021
807f258
installing 3.7 kernel
Robbie1977 Aug 11, 2021
ba4138c
moving to 3
Robbie1977 Aug 11, 2021
1eb2dbe
changing order
Robbie1977 Aug 11, 2021
b4175be
reverting move
Robbie1977 Aug 11, 2021
d77d4a6
adding python-cjson
Robbie1977 Aug 11, 2021
31917f1
Fix to ensure git pulls don't lockup loading
Robbie1977 Jul 17, 2024
b78500b
Update startup.sh
Robbie1977 Aug 8, 2024
cb0f3a4
adding README fix
Robbie1977 Aug 8, 2024
50724ef
installing cJSON explicitly
Robbie1977 Aug 8, 2024
1b6df99
pointing to cjson
Robbie1977 Aug 8, 2024
fe2fd27
syntax fix
Robbie1977 Aug 8, 2024
361c9c5
Revert "syntax fix"
Robbie1977 Aug 8, 2024
deb1462
Revert "pointing to cjson"
Robbie1977 Aug 8, 2024
10b34a7
Revert "installing cJSON explicitly"
Robbie1977 Aug 8, 2024
1b25584
swapping to python 3.10
Robbie1977 Oct 30, 2024
c8dd5e4
base change
Robbie1977 Oct 30, 2024
8f21d98
Woolz fixes
Robbie1977 Oct 30, 2024
6dfb400
Update startup.sh
Robbie1977 Oct 30, 2024
afe0b2c
Update dockerimage.yml
Robbie1977 Oct 30, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker Image CI

on: [push]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build . --file Dockerfile --tag loadedubuntu:${GITHUB_REF#refs/heads/}
- name: Dockerize
if: success()
uses: manusa/actions-publish-docker@v1.1.2
with:
name: rcourt/loadedubuntu
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
203 changes: 111 additions & 92 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,82 @@
FROM ubuntu
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
VOLUME input
VOLUME output
VOLUME template

#cmtk
RUN apt-get -qq -y update \
&& apt-get -qq -y install locales cmtk python python-pip python-dev ipython build-essential git nano autoconf nasm zip automake autoconf m4 libtool bison cmake flex xvfb imagej bc sec libpq-dev python3.7\
&& pip install --upgrade virtualenv \
&& pip install --upgrade pip

#python image support
RUN pip install pynrrd
RUN pip install h5py

#python neo4j support
RUN pip install requests
RUN pip install psycopg2
RUN pip install neo4j
# Install base dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y \
locales \
cmtk \
build-essential \
git \
nano \
autoconf \
nasm \
zip \
automake \
m4 \
libtool \
bison \
cmake \
flex \
xvfb \
imagej \
bc \
sec \
libpq-dev \
python3.10 \
python3.10-dev \
python3.10-distutils \
python3-pip \
wget \
curl \
libdirectfb-dev \
libjpeg-dev \
zlib1g-dev \
libsdl-gfx1.2-dev \
libsdl1.2-dev \
libasound2-dev \
pkg-config \
libpci-dev \
dh-autoreconf \
csh \
&& rm -rf /var/lib/apt/lists/*

# Set Python 3.10 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 \
&& update-alternatives --set python3 /usr/bin/python3.10

# Install pip for Python 3.10
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

# Python image support
RUN python3.10 -m pip install pynrrd h5py

# Environment variables
ENV MA=/opt/MouseAtlas
ENV PATH=/opt/MouseAtlas/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/MouseAtlas/lib:$LD_LIBRARY_PATH
ENV LD_RUN_PATH=/opt/MouseAtlas/lib:$LD_RUN_PATH

#woolz
RUN apt-get -y install build-essential gcc make wget libdirectfb-dev libjpeg-dev zlib1g-dev libsdl-gfx1.2-dev gcc libsdl1.2-dev libasound2-dev pkg-config libpci-dev dh-autoreconf csh
# Woolz dependencies
RUN apt-get -y install build-essential gcc make wget libdirectfb-dev libjpeg-dev zlib1g-dev libsdl-gfx1.2-dev gcc libsdl1.2-dev libasound2-dev pkg-config libpci-dev dh-autoreconf csh

ENV MA=/opt/MouseAtlas
RUN export PATH=/root/anaconda3/bin:/opt/VFB_neo4j/src:/opt/MouseAtlas/bin:$PATH
ENV PATH=/opt/MouseAtlas/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/MouseAtlas/lib:$LD_LIBRARY_PATH
ENV LD_RUN_PATH=/opt/MouseAtlas/lib:$LD_RUN_PATH

# External Dependencies
RUN cd /tmp/ \
&& git clone https://github.com/ma-tech/External.git

# Install Fcgi
RUN cd /tmp/External/ \
&& cd Fcgi/ \
&& tar -zxf fcgi-2.4.0.tar.gz \
Expand All @@ -39,6 +86,7 @@ RUN cd /tmp/External/ \
&& make \
&& make install

# Install Log4Cpp
RUN cd /tmp/External/ \
&& cd Log4Cpp \
&& rm -rf log4cpp-1.0 \
Expand All @@ -49,6 +97,7 @@ RUN cd /tmp/External/ \
&& make \
&& make install

# Install PNG
RUN cd /tmp/External/ \
&& cd PNG \
&& rm -rf libpng-1.6.29 \
Expand All @@ -58,6 +107,7 @@ RUN cd /tmp/External/ \
&& make \
&& make install

# Install JPEG
RUN cd /tmp/External/ \
&& cd Jpeg \
&& rm -rf libjpeg-turbo-1.5.1 \
Expand All @@ -68,115 +118,84 @@ RUN cd /tmp/External/ \
&& make \
&& make install

# Install Tiff
RUN cd /tmp/External/ \
&& cd Tiff \
&& rm -rf tiff-4.0.8 \
&& tar -zxf tiff-4.0.8.tar.gz \
&& cd tiff-4.0.8 \
&& ./configure --prefix=$MA --disable-shared --enable-static --with-pic --with-jpeg-include-dir=$MA/include --with-jpeg-lib-dir==$MA/lib \
&& ./configure --prefix=$MA --disable-shared --enable-static --with-pic --with-jpeg-include-dir=$MA/include --with-jpeg-lib-dir=$MA/lib \
&& make \
&& make install

# Install NIfTI
RUN cd /tmp/External/ \
&& cd NIfTI \
&& tar -zxf nifticlib-2.0.0.tar.gz \
&& cmake nifticlib-2.0.0 \
&& make \
&& make install

# Install cJSON
RUN cd /tmp/ \
&& git clone https://github.com/DaveGamble/cJSON.git \
&& cd cJSON \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install

# Woolz compilation
RUN cd /tmp/ \
&& git clone https://github.com/ma-tech/Woolz.git \
&& cd Woolz \
&& cp -v Readme.md README \
&& mkdir -p m4 \
&& libtoolize \
&& aclocal \
&& automake --add-missing \
&& autoreconf -i --force \
&& ./build.sh \
&& ./configure --prefix=$MA --enable-optimise --enable-extff --with-jpeg=$MA --with-tiff=$MA --with-nifti=/usr/local/ \
&& ./configure --prefix=$MA --enable-optimise --enable-extff --with-jpeg=$MA --with-tiff=$MA --with-nifti=/usr/local/ CPPFLAGS="-I/usr/local/include/cjson" LDFLAGS="-L/usr/local/lib" \
&& make \
&& make install


# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/NRRDtools.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/SWCtools.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/Bound.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/3DwarpScoring.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/IndexStackConv.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/3DstackDisplay.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/lsm2nrrd.git
# RUN cd /opt/ \
# && git clone https://github.com/Robbie1977/nrrd2raw.git
# Clone VFB repositories
RUN cd /opt/ \
&& git clone https://github.com/VirtualFlyBrain/VFB_neo4j.git
# RUN cd /opt/ \
# && git clone https://github.com/VirtualFlyBrain/StackProcessing.git
# RUN cd /opt/ \
# && git clone https://github.com/VirtualFlyBrain/StackLoader.git
# RUN cd /opt/ \
# && wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip \
# && unzip fiji-linux64.zip \
# && rm fiji-linux64.zip

# ENV FIJI=/opt/Fiji.app/ImageJ-linux64

# RUN mkdir -p /data/ && cd /data/ \
# && git clone https://github.com/VirtualFlyBrain/DrosAdultVNSdomains.git

# RUN cd /data/ \
# && git clone https://github.com/VirtualFlyBrain/DrosAdultBRAINdomains.git

# RUN cd /data/ \
# && git clone https://github.com/VirtualFlyBrain/DrosAdultHalfBRAINdomains.git



# RUN mkdir -p /disk/data/VFB/IMAGE_DATA/
# RUN ln -s /opt/StackLoader /disk/data/VFB/IMAGE_DATA/
# RUN mkdir -p /partition/bocian/VFBTools
# RUN ln -s /opt/* /partition/bocian/VFBTools/
# RUN ln -s /VFB /disk/data/VFB/IMAGE_DATA/
# RUN mkdir -p /disk/data/VFBTools
# RUN ln -s /opt/Fiji.app /disk/data/VFBTools/
# RUN mv /disk/data/VFBTools/Fiji.app /disk/data/VFBTools/Fiji
# RUN ln -s /opt/* /disk/data/VFBTools/
# RUN ln -s /disk/data/VFBTools/MouseAtlas /disk/data/VFBTools/Woolz2013Full
# RUN mkdir -p /partition/karenin/VFB/IMAGE_DATA/
# RUN ln -s /opt/StackLoader /partition/karenin/VFB/IMAGE_DATA/
# RUN ln -s /VFB /partition/karenin/VFB/IMAGE_DATA/
# RUN mkdir -p /partition/bocian/VFBTools/python-modules-2.6/bin/
# RUN echo "#empty" > /partition/bocian/VFBTools/python-modules-2.6/bin/activate
# RUN ln -s /opt/StackProcessing /disk/data/VFB/IMAGE_DATA/
&& git clone https://github.com/VirtualFlyBrain/VFB_neo4j.git \
&& git clone https://github.com/VirtualFlyBrain/curation.git

# Set environment variables
ENV TZAREA=Europe
ENV TZCITY=London
ENV ANACONDAINS=Anaconda3-5.2.0-Linux-x86_64.sh
ENV ANACONDAINS=Anaconda3-2023.09-0-Linux-x86_64.sh
ENV JUPYPASS="sha1:7f8e745dd219:b14fb15e0b4bc290a5d109ae97cba5c361b5d139"

#ipython jupyter notebook
RUN cd /tmp/ && \
wget https://repo.anaconda.com/archive/${ANACONDAINS} && \
bash ${ANACONDAINS} -b

RUN conda install python=3.7 anaconda=custom

#neo4j requirements
RUN /root/anaconda3/bin/pip install pynrrd
RUN /root/anaconda3/bin/pip install requests
RUN /root/anaconda3/bin/pip install psycopg2
RUN /root/anaconda3/bin/pip install pandas
RUN /root/anaconda3/bin/pip install catpy

# Install Anaconda
RUN cd /tmp/ \
&& wget https://repo.anaconda.com/archive/${ANACONDAINS} \
&& bash ${ANACONDAINS} -b

# Install Python packages
RUN python3.10 -m pip install \
requests \
psycopg2-binary \
neo4j \
jupyter \
ipykernel

# Set up Python 3.10 kernel for Jupyter
RUN python3.10 -m ipykernel install --name 'python3.10' --display-name 'Python 3.10'

# Install requirements from VFB repositories
RUN sed 's/^psycopg2$/psycopg2-binary/g' /opt/VFB_neo4j/requirements.txt >> /opt/requirements.txt \
&& sed 's/^psycopg2$/psycopg2-binary/g' /opt/curation/requirements.txt >> /opt/requirements.txt \
&& python3.10 -m pip install -r /opt/requirements.txt

# Copy and prepare scripts
COPY /scripts/* /scripts/
RUN chmod +x /scripts/*.sh

ENTRYPOINT /scripts/startup.sh

EXPOSE 80
9 changes: 7 additions & 2 deletions scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

for folder in $(find / | grep '/\.git$') ; do git --git-dir=$folder pull || : ; done;
/root/anaconda3/bin/jupyter lab --ip='*' --NotebookApp.password="${JUPYPASS}" --no-browser --port 80 --allow-root &

/root/anaconda3/bin/jupyter lab --ip='*' --NotebookApp.password="${JUPYPASS}" --no-browser --port 80 --allow-root
for folder in $(find /opt/ | grep '/\.git$') ; do echo $folder; cd $folder/../; git pull || : ; cd ..; sleep 10m; done;

while true
do
sleep 999m
done