FACET2 Injector Simulation Docker Image Configuration
FACET2 Injector Simulation Docker Image
Overview
This repository contains the necessary components to create a Docker image that encapsulates a Jupyter Notebook simulation environment for the FACET2 injector. Github actions automatically builds the container and updates the local copy on S3DF. The simulation utilizes both IMPACT and BMAD codes to model and analyze the injector's behavior. The juptyer notebooks are written by Eric Cropp. Additionally, the repository includes a script to facilitate running the Docker container on the S3DF platform.
Docker Image
The Docker image is designed to provide a ready-to-use simulation environment with pre-installed dependencies and configurations necessary for running IMPACT and BMAD simulations. The core of this environment is a Jupyter Notebook that guides users through the simulation process, from setting up initial conditions to visualizing the results.
Components
Jupyter Notebook: Contains the simulation workflow, including setup, execution, and analysis steps.
IMPACT: A particle accelerator simulation tool used for the initial stages of the simulation.
BMAD: A library for simulating charged particle beams and designing accelerators, used in the latter stages of the simulation.
Running the Container on S3DF
Included in this repository is a script that simplifies the process of deploying and running the Docker container on the S3DF platform. This script handles copying the notebooks to a working directory on s3df and runs a local copy of the container on s3df.
Usage
To run the Docker container on S3DF, execute the provided script with the necessary parameters. Instructions are on confluence (here)
Forking repo to create custom container for S3DF:
Step 1: Fork the Repository
Go to the repository on GitHub.
Click on "Use this template" in the top right corner.
Create your new repository from this template.
Step 2: Edit the Dockerfile
In your new repository, navigate to the
Dockerfile
.Locate the section where
conda
packages are installed:Edit the list and similar parts to include or exclude packages as needed for your project.
Step 3: Update Jupyter Notebooks
Navigate to the
./notebooks
directory.Replace the existing notebooks with your own notebooks that are needed for your project.
Step 5: Configure GitHub Actions Secrets
Go to the settings of your new GitHub repository.
Navigate to
Secrets
under theSecurity
section.Add the necessary secrets for your Docker container to be built and pushed to Docker Hub.
These secrets might include
DOCKER_HUB_ACCESS_TOKEN
,DOCKER_HUB_USERNAME
,SSH_PASSWORD
and any other necessary credentials (ssh username).
Step 6: Adjust GitHub Actions Workflow
Ensure the path where the container is pulled to on S3DF (in the
pull_to_s3df.yml
GitHub Actions workflow) matches the path referenced inondemand.sh
.Edit the
pull_to_s3df.yml
file as necessary to match your configuration.
Step 7: Connect to S3DF and Start Jupyter Instance
Connect to the S3DF OnDemand portal.
Start a Jupyter instance using a custom Singularity (Apptainer) image.
Paste the
ondemand.sh
script into the box below the custom Apptainer image on the OnDemand portal.
Support
For any issues or questions regarding the setup, execution, or other aspects of using this Docker image, please refer to the documentation provided [here] or contact sanjeev@slac.stanford.edu.