Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
enabling development on docker (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
yalaudah authored May 4, 2020
1 parent 2ed51ad commit fcbb792
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 9 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
SHELL ["/bin/bash", "-c"]

WORKDIR /home/username

# Install Anaconda and download the seismic-deeplearning repo
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
Expand All @@ -23,17 +25,17 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
wget --quiet https://github.com/microsoft/seismic-deeplearning/archive/staging.zip -O staging.zip && \
unzip staging.zip && rm staging.zip

WORKDIR seismic-deeplearning-staging

RUN conda env create -n seismic-interpretation --file environment/anaconda/local/environment.yml && \
RUN cd seismic-deeplearning-staging && \
conda env create -n seismic-interpretation --file environment/anaconda/local/environment.yml && \
source activate seismic-interpretation && \
python -m ipykernel install --user --name seismic-interpretation && \
pip install -e interpretation && \
pip install -e cv_lib

# TODO: add back in later when Penobscot notebook is available
# Download Penobscot dataset:
# RUN data_dir="/home/username/data/penobscot" && \
# RUN cd seismic-deeplearning-staging && \
# data_dir="/home/username/data/penobscot" && \
# mkdir -p "$data_dir" && \
# ./scripts/download_penobscot.sh "$data_dir" && \
# cd scripts && \
Expand All @@ -42,7 +44,8 @@ RUN conda env create -n seismic-interpretation --file environment/anaconda/local
# cd ..

# Download F3 dataset:
RUN data_dir="/home/username/data/dutch" && \
RUN cd seismic-deeplearning-staging && \
data_dir="/home/username/data/dutch" && \
mkdir -p "$data_dir" && \
./scripts/download_dutch_f3.sh "$data_dir" && \
cd scripts && \
Expand All @@ -57,4 +60,4 @@ EXPOSE 9000/tcp
EXPOSE 9001/tcp

CMD source activate seismic-interpretation && \
jupyter notebook --allow-root --ip 0.0.0.0 --port 9000
jupyter lab --allow-root --ip 0.0.0.0 --port 9000
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This process will take a few minutes to complete.
# Run the Docker image:
Once the Docker image is built, you can run it anytime using the following command:
```bash
sudo docker run --rm -it -p 9000:9000 -p 9001:9001 --gpus=all --shm-size 11G --mount type=bind,source=$PWD/hrnetv2_w48_imagenet_pretrained.pth,target=/home/username/models/hrnetv2_w48_imagenet_pretrained.pth seismic-deeplearning
sudo docker run --rm -it -p 9000:9000 -p 9001:9001 --gpus=all --shm-size 11G --mount type=bind,source=$PWD/hrnetv2_w48_imagenet_pretrained.pth,target=/home/models/hrnetv2_w48_imagenet_pretrained.pth -v ~/:/home/username seismic-deeplearning
```
If you have saved the pretrained model in a different directory, make sure you replace `$PWD/hrnetv2_w48_imagenet_pretrained.pth` with the **absolute** path to the pretrained HRNet model. The command above will run a jupyter notebook server that you can access by clicking on the link in your terminal. You can then navigate to the notebook that you would like to run.
If you have saved the pretrained model in a different directory, make sure you replace `$PWD/hrnetv2_w48_imagenet_pretrained.pth` with the **absolute** path to the pretrained HRNet model. The command above will run a Jupyter Lab instance that you can access by clicking on the link in your terminal. You can then navigate to the notebook that you would like to run. By default, running the command above would mount your home directory to the Docker container, allowing you to access your files and data from within Jupyter Lab.

1 change: 1 addition & 0 deletions environment/anaconda/local/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- itkwidgets==0.23.1
- pytest
- papermill>=1.0.1
- jupyterlab
- pip:
- segyio==1.8.8
- pytorch-ignite==0.3.0
Expand Down

0 comments on commit fcbb792

Please sign in to comment.