Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Binder support #23

Merged
merged 11 commits into from
Jan 9, 2023
Merged
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -48,3 +48,8 @@ test_fastjet:
--volume $(shell pwd):/work \
matthewfeickert/pythia-python:latest \
'g++ tests/test_FastJet.cc -o tests/test_FastJet $$(fastjet-config --cxxflags --libs --plugins); ./tests/test_FastJet'

binder_repo2docker:
repo2docker \
--image-name matthewfeickert/pythia-python:binder \
.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

[![Docker Pulls](https://img.shields.io/docker/pulls/matthewfeickert/pythia-python)](https://hub.docker.com/r/matthewfeickert/pythia-python)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/matthewfeickert/pythia-python/latest)](https://hub.docker.com/r/matthewfeickert/pythia-python/tags?name=latest)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/matthewfeickert/pythia-python/HEAD)

> PYTHIA is a program for the generation of high-energy physics events, i.e. for the description of collisions at high energies between elementary particles such as e+, e-, p and pbar in various combinations.
40 changes: 40 additions & 0 deletions binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM matthewfeickert/pythia-python:pythia8.308

# Remove existing non-root user "docker" with uid 1000
# to avoid conflict with jovyan
USER root
RUN deluser docker

ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}

USER root
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
USER ${NB_USER}

# FIXME: Downgrade jupyter-server to contend with:
# https://github.com/jupyterhub/repo2docker/issues/1231
# https://github.com/jupyter-server/jupyter_server/issues/1038
RUN python -m pip --no-cache-dir install --upgrade \
notebook \
jupyterlab \
jupyterhub \
'jupyter-server<2.0.0'

# Make sure the contents of the repo are in ${HOME}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME} && \
chown -R ${NB_UID} /usr/local/venv
USER ${NB_USER}
WORKDIR ${HOME}

# Null out ENTRYPOINT and CMD to let repo2docker control them
ENTRYPOINT [ ]
CMD [ ]