Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Link to Video Tutorial

This is the fastest and easiest way to run a example Facet2 sim on s3df. It uses a prebuilt docker container stored here. When the container runs it will copy example jupyter notebook files and the Facet-II Lattice files to $HOME/impact_bmad_container_notebooks . You should be able to navigate to there and run the notebooks with no other setup*. 

*must have FACET repo access or use ad:beamphysics for batch compute

Impact-T + Bmad Simulation Code:

...

  1. login to open ondemand at https://s3df.slac.stanford.edu/ondemand
  2. click on the top menu bar and choose interactive apps → Jupyter
  3. Image RemovedImage Added
  4. Select Custom facet2 for Jupyter Image
  5. Select Apptainer Image impact_bmad_sim for  Image
  6. Click use JupyterLab instead of Jupyter Notebook
  7. For run on cluster type select: Batch; s3df; account: FACET; Partition Milano
  8. Select number of hours and cores 
  9. Configure rest of settings - *to use the FACET account you need to be added via coact; you can try using the beamphysics account if FACET doesnt work.
  10. Image Added
  11. Launch and connect
  12. The container will copy the necessary notebooks to $HOME/impact_bmad_container_notebooks . Click on this directory via the Jupyter UI and run the Impact / Bmad Sim. 

If you want to customize the path where the notebook files are copied to from the container then:

  1. instead of step 4 above select custom
  2. select apptainer image
  3. paste in the code below and change NOTEBOOK_ROOT
  4. Image Removed
  5. Set the "Commands to initiate Jupyter" to be:
  6. (also available here)

    Code Block
    # Set the environment variable for the Apptainer image path
    export APPTAINER_IMAGE_PATH=/sdf/group/facet/sanjeev/containers/impact-bmad_latest.sif
    export NOTEBOOK_ROOT=$HOME/impact_bmad_container_notebooks
    mkdir -p $HOME/impact_bmad_container_notebooks
    
    # Define the jupyter function to use Apptainer for executing Jupyter with necessary bindings and running mkdir and cp commands
    function jupyter() {
    apptainer exec -B /usr,/sdf,/fs,/sdf/scratch,/lscratch ${APPTAINER_IMAGE_PATH} bash -c "
            mkdir -p ${NOTEBOOK_ROOT} &&
            cp -rn /opt/notebooks/* ${NOTEBOOK_ROOT}/";
      	apptainer exec -B /usr,/sdf,/fs,/sdf/scratch,/lscratch ${APPTAINER_IMAGE_PATH}  jupyter $@;
    }
  7. Click use JupyterLab instead of Jupyter Notebook
  8. For run on cluster type select: Batch; s3df; account: FACET; Partition Milano
  9. Select number of hours and cores 
  10. Configure rest of settings - *to use the FACET account you need to be added via coact; you can try using the beamphysics account if FACET doesnt work.
  11. Image Removed
  12. Launch and connect
  13. The container will copy the necessary notebooks to $HOME/impact_bmad_container_notebooks . Click on this directory via the Jupyter UI and run the Impact / Bmad Sim. 

Via Command Line (S3DF)

blah blah

Via Command Line (not S3DF)

  1. continue from step 6

Via Command Line (S3DF)

  • Connect to s3df with port forwarding (juptyer notebooks will run on port 5555 and be forwarded to your local machine)
Code Block
 ssh -L 5555:localhost:5555 <SLAC UNIX USERNAME>@s3dflogin.slac.stanford.edu
  • connect to interactive compute cluster
Code Block
 ssh -L 5555:localhost:5555 iana
  • Run this script which copies jupyter notebook files out of the container and starts a session 
  • tbd




Via Command Line (not S3DF)

tbd 

if you have docker, then just docker pull slacact/impact-bmad  and start that somehow

if you dont have docker but have apptainer then do singularity pull docker://slacact/impact-bmad and run it??