Skip to content

Commit

Permalink
Merge pull request #205 from NIEHS/stable
Browse files Browse the repository at this point in the history
Stable
  • Loading branch information
JoQCcoz authored Jul 11, 2023
2 parents 44ece4f + ebc9a70 commit f9b90d4
Show file tree
Hide file tree
Showing 57 changed files with 1,023 additions and 543 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ docker-compose.yml.bak
.config
.python_history
MyDocker/*

.ipython
.mysql_history
.gitignore
.ipython/profile_default/history.sqlite
11 changes: 11 additions & 0 deletions .ipython/profile_default/startup/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is the IPython startup directory

.py and .ipy files in this directory will be run *prior* to any code or files specified
via the exec_lines or exec_files configurables whenever you load this profile.

Files will be run in lexicographical order, so you can control the execution order of files
with a prefix, e.g.::

00-first.py
50-middle.py
99-last.ipy
41 changes: 14 additions & 27 deletions Docker/Dockerfile-base
Original file line number Diff line number Diff line change
@@ -1,50 +1,37 @@
FROM nvidia/cuda:10.1-base-ubuntu18.04

FROM nvidia/cuda:12.1.0-base-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
python3-dev default-libmysqlclient-dev build-essential wget libglib2.0-0 ffmpeg libsm6 libxext6 curl mariadb-server && \
python3-dev default-libmysqlclient-dev build-essential wget libglib2.0-0 ffmpeg libsm6 libxext6 curl mariadb-server git && \
apt-get clean && rm -rf /var/cache/apt/lists

# RUN service mariadb stop && service mariadb disable

RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda3 && \
rm Miniconda3-latest-Linux-x86_64.sh

RUN wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_4.11.15_RHEL7-64_CUDA10.1.sh && \
yes | bash imod_4.11.15_RHEL7-64_CUDA10.1.sh -name IMOD && \
rm imod_4.11.15_RHEL7-64_CUDA10.1.sh
RUN wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_4.11.24_RHEL7-64_CUDA10.1.sh && ls && \
yes | bash imod_4.11.24_RHEL7-64_CUDA10.1.sh -name IMOD && \
rm imod_4.11.24_RHEL7-64_CUDA10.1.sh

ADD config/singularity/ctffind /usr/local/

ADD config/docker/requirements.txt .

# RUN mkdir /opt/logs/ /mnt/fake_scope/ /mnt/fake_scope/raw/ /opt/nginx-mount/



ENV PATH=$PATH:/opt/smartscope/Smartscope/bin:/opt/miniconda3/bin:$IMOD_DIR/bin
ENV PATH=$PATH:/opt/miniconda3/bin

RUN conda update -y conda && \
yes | conda install python=3.9 cudatoolkit=10.2 cudnn=7.6 && \
yes | pip install numpy==1.21.0 && \
yes | pip install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu102 && \
yes | pip install -r requirements.txt && \
yes | pip install ipython && \
yes | pip install sphinx-multiversion && \
yes | conda install python=3.9 && \
yes | conda install cudatoolkit=11.1 cudnn -c nvidia
RUN yes | conda install pytorch torchvision -c pytorch-lts -c nvidia && \
conda clean --all

# RUN wget docs.smartscope.org/downloads/Smartscope0.6.tar.gz --no-check-certificate &&\
# tar -xvf Smartscope0.6.tar.gz -C /opt/ &&\
# rm Smartscope0.6.tar.gz
RUN yes | pip install numpy==1.21.0 && \
# yes | pip install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111 && \
yes | pip install -r requirements.txt


# create a non-root user
ARG USER_ID=9999

RUN useradd -m --no-log-init --system --uid $USER_ID smartscope_user

# RUN chmod 777 -R /mnt/ && \
# chmod 777 /opt/logs/ && \
# chmod 777 /opt/nginx-mount/
RUN useradd -m --no-log-init --system --uid $USER_ID smartscope_user
4 changes: 3 additions & 1 deletion Docker/Dockerfile-smartscope
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ ENV ALLOWED_HOSTS=localhost \
MYSQL_HOST=db \
MYSQL_PORT=3306 \
MYSQL_USERNAME=root \
MYSQL_ROOT_PASSWORD=pass \
MYSQL_PASSWORD=pass \
DB_NAME=smartscope \
REDIS_HOST=cache \
REDIS_PORT=6379 \
USE_AWS=False \
FORCE_CPU=False

ENV PATH=$PATH:/opt/smartscope/Smartscope/bin:/usr/local/IMOD/bin

ADD . /opt/smartscope/

RUN wget docs.smartscope.org/downloads/Smartscope0.6.tar.gz --no-check-certificate && \
Expand Down
7 changes: 5 additions & 2 deletions Docker/SmartScope/database.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=pass
MYSQL_DATABASE=smartscope
MYSQL_PASSWORD=pass
MYSQL_DATABASE=smartscope
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_SSL=False
4 changes: 1 addition & 3 deletions Docker/SmartScope/smartscope.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ ALLOWED_HOSTS=localhost
AUTO_MIGRATION=true
USE_SSL=false
USE_LONGTERMSTORAGE=False
TIMEZONE=America/New_York

### EXPERT SETTINGS ###
### EVERYTHING BELOW SHOULD NOT NEED TO BE CHANGED###
#Other database settings
# MYSQL_HOST=db
# MYSQL_PORT=3306

# #Executables
# IMOD_DIR=/usr/local/IMOD
Expand Down
1 change: 1 addition & 0 deletions Smartscope/bin/smartscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging
from Smartscope.core.main_commands import main


logger = logging.getLogger(__name__)


Expand Down
3 changes: 3 additions & 0 deletions Smartscope/bin/smartscope.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

smartscope.py $@ &
Loading

0 comments on commit f9b90d4

Please sign in to comment.