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

Update Dockerfile to spawn Jupter session #61

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM continuumio/miniconda3
FROM jupyter/scipy-notebook:python-3.11
LABEL author="ATLAS Open Data Team @ CERN 2024"
LABEL maintainer="Giovanni Guerrieri - giovanni.guerrieri@cern.ch"
WORKDIR /opt/app
Expand All @@ -9,9 +9,22 @@ COPY binder/environment.yml .
RUN conda env update -n base -f environment.yml && \
conda clean -afy && \
rm -rf /opt/conda/pkgs/*
SHELL ["conda", "run", "-n", "analysis", "/bin/bash", "-c"]
SHELL ["bash", "-c"]

# # Expose port 8888 for Jupyter Lab
# EXPOSE 8888
# Expose port 8888 for Jupyter Lab
EXPOSE 8888

# CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--no-browser"]
USER root
# Create a new non-root user
ARG NB_USER=atlasuser
ARG NB_UID=1001
ARG NB_GID=100
RUN adduser --disabled-password --gecos "" --uid $NB_UID --gid $NB_GID $NB_USER && \
mkdir -p /home/$NB_USER && \
chown -R $NB_USER:$NB_GID /home/$NB_USER /opt/app

# Switch to the created user
USER $NB_USER

# Set the home directory as the working directory
WORKDIR /home/$NB_USER
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
# ATLAS Open Data

## notebooks-collection-opendata
A set of multiple notebooks using 8 TeV and 13 TeV ATLAS Open Data datasets
[![Docker image](https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/actions/workflows/docker_push.yml/badge.svg)](https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/actions/workflows/docker_push.yml) [![Run all Jupyter Notebooks](https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/actions/workflows/notebooks-health-check.yml/badge.svg)](https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/actions/workflows/notebooks-health-check.yml)
# ATLAS Open Data Jupyter Notebooks
A set of multiple notebooks using 8 TeV and 13 TeV ATLAS Open Data datasets.

## Run on Binder
To execute in MyBinder:
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/atlas-outreach-data-tools/notebooks-collection-opendata/HEAD)


For more complex needs, such as running multiple notebooks review the [Binder Documentation](https://mybinder.readthedocs.io/en/latest/#) for guidance on setting up a more personalized Binder environment.

Note: before starting running the code in the jupyter notebooks, click on the up right button "not trusted" in order to get "trusted" displayed. This should lead the JavaScript to be executed, that is useful to visualise interactive histograms. If that doesn't work, simply go to the top of the notebook, find the cell that contains the line of code `%jsroot` and comment out that.

For more, please go to:
[http://opendata.atlas.cern](http://opendata.atlas.cern)
## Run on Docker containers

Docker provides a robust platform for developing, sharing, and running applications within containers.

**Steps to run ATLAS open data using Docker:**

1. **Install Docker**: Download and install Docker from the [official website](https://docs.docker.com/get-docker/).
2. **Open Docker**
3. **Run the Docker Image**: Open your terminal and run the Docker image, available on our [GitHub registry](https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/pkgs/container/notebooks-collection-opendata).
```
docker run -it -p 8888:8888 -v my_volume:/home/jovyan/work ghcr.io/atlas-outreach-data-tools/notebooks-collection-opendata:latest
```
4. **Launch the Notebook**: After running the Docker image, use the link provided in the terminal to access the Jupyter interface. The terminal should look like this:
```
To access the notebook interface, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-15-open.html
Or copy and paste one of these URLs:
http://4c61742ed77c:8888/?token=34b7f124f6783e047e796fea8061c3fca708a062a902c2f9
or http://127.0.0.1:8888/?token=34b7f124f6783e047e796fea8061c3fca708a062a902c2f9
```

@2021
For more, please go to: [opendata.atlas.cern/docs/category/choose-your-enviroment](https://opendata.atlas.cern/docs/category/choose-your-enviroment)

---
@2024
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- hist==2.8.0
- ipykernel==6.29.5
- jupyter==1.0.0
- libmamba==2.0.4
- lmfit==1.3.2
- matplotlib==3.9.1
- metakernel==0.30.2
Expand Down
Loading