Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

User home #142

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ env:
install:
- "if [[ \"$TRAVIS_TAG\" == \"\" ]]; then sed -i.bak \
's/image: rhodium\\/worker.*/image: rhodium\\/worker:'\"$TRAVIS_COMMIT\"'/' \
notebook/worker-template.yml; else sed -i.bak \
notebook/pre-home/worker-template.yml; else sed -i.bak \
's/image: rhodium\\/worker:.*/image: rhodium\\/worker:'\"$TRAVIS_TAG\"'/' \
notebook/worker-template.yml; fi"
- "rm notebook/worker-template.yml.bak"
- "cat notebook/worker-template.yml | grep image:"
notebook/pre-home/worker-template.yml; fi"
- "rm notebook/pre-home/worker-template.yml.bak"
- "cat notebook/pre-home/worker-template.yml | grep image:"
- "cp base_environment.yml $IMAGE_NAME/base_environment.yml"
- "cp common.sh $IMAGE_NAME/common.sh && chmod +x $IMAGE_NAME/common.sh"
- "cd $IMAGE_NAME"
Expand Down
9 changes: 3 additions & 6 deletions notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ RUN sed -ri "s#Defaults\s+secure_path=\"([^\"]+)\"#Defaults secure_path=\"\1:$CO
USER $NB_USER


## filepath curation
RUN sudo mkdir /pre-home && sudo chown -R $NB_USER /pre-home
COPY worker-template.yml /pre-home
COPY add_service_creds.py /pre-home
COPY run_sql_proxy.py /pre-home
COPY config.yaml /pre-home
## create temporary directory for injecting user content into ~ on container boot
COPY pre-home /
RUN sudo chown -R $NB_USER /pre-home

RUN sudo mkdir /tempdir
COPY common.sh /tempdir
Expand Down
18 changes: 18 additions & 0 deletions notebook/pre-home/about/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Welcome!

If you're seeing this, you're on a jupyterhub server maintained by
[Rhodium Group](https://github.com/RhodiumGroup). Welcome!

If you have any questions, are troubleshooting an issue, or would like to report
a bug, don't hesitate to shout on the
[#rhg-hub](https://rhgroup.slack.com/archives/CA8DZHUH1) slack channel, or
file an issue on our
[github repository](https://github.com/RhodiumGroup/docker_images/issues).

If you are having trouble accessing either of these, please contact
[Michael Delgado](mailto:[email protected]).

Please note that the `~/about` folder in which this readme file lives is
overwritten on every server reboot. Do not attempt to save anything in this
folder - instead save your work in other folders within your home directory
(`/home/jovyan`, a.k.a. `~/`).
8 changes: 2 additions & 6 deletions notebook/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ set -x

echo "Copy Dask configuration files from pre-load directory into home/.config"
mkdir -p /home/jovyan/.config/dask
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop this line right? It will be implied by the copy of the folder contents?

cp --update -r -v /pre-home/config.yaml /home/jovyan/.config/dask/

# should probably pick one of these!!! The second is new, but is implied by the
# cp /pre-home below, and we actually only read the version in ~ in rhg_compute_tools.
cp -r -v /pre-home/worker-template.yml /home/jovyan/.config/dask/
cp -r -v /pre-home/worker-template.yml /home/jovyan/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we now drop this b/c it is implied by the copy of the full folder below?


sudo rm /pre-home/config.yaml

echo "Copy files from pre-load directory into home"
cp --update -r -v /pre-home/. /home/jovyan
sudo rm -r /pre-home

# mirror directory used on workers
sudo mkdir -p /opt/gcsfuse_tokens/
Expand All @@ -36,7 +32,7 @@ done

if [ -f "/home/jovyan/worker-template.yml" ]; then
echo "appending service-account-credentials to worker-template";
python /home/jovyan/add_service_creds.py;
python /home/jovyan/.maintenance/add_service_creds.py;
fi

# Run extra commands
Expand Down