Skip to content

Commit

Permalink
Merge branch 'master' into new_som
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-l-kong authored Aug 9, 2021
2 parents f06a7ff + 9ef485e commit 7530233
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ RUN R -e "install.packages('BiocManager')"
RUN R -e "BiocManager::install('FlowSOM')"
RUN R -e "BiocManager::install('ConsensusClusterPlus')"

# jupyter notebook
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--allow-root"]
# jupyter lab
CMD jupyter lab --ip=0.0.0.0 --allow-root --no-browser --port=$JUPYTER_PORT
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You've now installed the code base.
Enter the following command into terminal from the same directory you ran the above commands:

```
bash start_docker.sh
./start_docker.sh
```

This will generate a link to a jupyter notebook. Copy the last URL (the one with `127.0.0.1:8888` at the beginning) into your web browser.
Expand All @@ -47,7 +47,7 @@ Be sure to keep this terminal open. **Do not exit the terminal or enter control

### NOTE

If you already have a Jupyter session open when you run `$ bash start_docker.sh`, you will receive a couple additional prompts.
If you already have a Jupyter session open when you run `$ ./start_docker.sh`, you will receive a couple additional prompts.

Copy the URL listed after `Enter this URL instead to access the notebooks:`

Expand Down Expand Up @@ -75,11 +75,11 @@ git pull

Then, run the command below to update the jupyter notebooks to the latest version
```
bash start_docker.sh --update
./start_docker.sh --update
```
or
```
bash start_docker.sh -u
./start_docker.sh -u
```

If the requirements.txt has changed, Docker will rebuild with the new dependencies first.
Expand Down
16 changes: 5 additions & 11 deletions start_docker.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# if requirements.txt has been changed in the last day, automatically rebuild Docker first
if [[ $(find . -mmin -1440 -type f -print | grep requirements.txt | wc -l) -eq 1 ]]
Expand All @@ -13,20 +13,14 @@ bash update_notebooks.sh "$@"
# find lowest open port available
PORT=8888

until [[ $(lsof -i -P -n | grep 127.0.0.1:$PORT | wc -l) -eq 0 ]]
until [[ $(docker container ls | grep 0.0.0.0:$PORT | wc -l) -eq 0 ]]
do
((PORT=PORT+1))
((PORT=$PORT+1))
done

if [ $PORT -ne 8888 ]
then
echo "WARNING: another Jupyter server on port 8888 running"
echo "Enter this URL instead to access the notebooks: http://127.0.0.1:$PORT/"
echo "In the URLs below, copy the token after \"token=\", paste that into the password prompt, and log in"
fi

docker run -it \
-p $PORT:8888 \
-p $PORT:$PORT \
-e JUPYTER_PORT=$PORT\
-v "$PWD/ark:/usr/local/lib/python3.6/site-packages/ark" \
-v "$PWD/scripts:/scripts" \
-v "$PWD/data:/data" \
Expand Down

0 comments on commit 7530233

Please sign in to comment.