Sign inSign up

ykrsama/darkshine-simulation

By ykrsama

•Updated 8 months ago

Dark SHINE Simulation Software Framework

Image
0

2.6K

ykrsama/darkshine-simulation repository overview

⁠DarkSHINE Docker 【暗光刀客】

Dockerfile⁠ | Release⁠

Dockerfile Graph

⁠Get startup scripts

In a terminal or PowerShell:

git clone https://gitlab.com/ykrsama/darkshine-docker.git

Which contains scripts for Docker on MacOS, Linux, WSL, Windows, and Singularity on Linux. Currently, GUI is only supported on local hosts.

[[TOC]]

⁠MacOS

  1. Install Docker⁠

  2. Setup X11 forwarding for Event Display Apps

    1. Install XQuartz⁠

    2. To enable the OpenGL rendering, run in the host terminal:

    defaults write org.xquartz.X11 enable_iglx -bool true
    
    1. From the XQuartz preferences, in the security tab, make sure Allow connections from network clients is enabled.

    2. Restart XQuartz.

  3. Run Simple example

    cd darkshine-docker
    ./docker-macos.sh # Mount current directory, mkdir run, and create config files
    # Test
    DSimu -b 100 # Simulation, reads default.yaml, outputs dp_simu.root
    DDis # Event display, reads dp_simu.root
    exit
    
  4. Alias command

    echo alias dss-docker=\"$PWD/docker-macos.sh bash --init-file /root/dss.sh\" >> ~/.zshrc
    source ~/.zshrc
    

    dss-docker will simply mount the current directory, without creating config files.

⁠Linux / WSL Docker

  1. Install Docker and run

    sudo apt install docker.io # Threre are some problem in snap version
    cd darkshine-docker
    ./docker-linux.sh # Mount current directory, mkdir run, and create config files
    # Test
    DSimu -b 100 # Simulation, reads default.yaml, outputs dp_simu.root
    DDis # Event display, reads dp_simu.root
    exit
    
  2. Alias command

    echo alias dss-docker=\"$PWD/docker-linux.sh bash --init-file /root/dss.sh\" >> ~/.bashrc
    source ~/.bashrc
    

    dss-docker will simply mount the current directory, without creating config files.

⁠Windows Docker

  1. Install Docker⁠

  2. Setup X11 forwarding

    1. Run a new PowerShell as an Administrator:

      choco install vcxsrv
      
    2. Run Xlaunch from start menu, go with all the default settings, however do check Disable access control. X server should show up in your tray icons.

  3. Run (PowerShell as normal user)

    cd darkshine-docker
    ./docker-win.ps1 # Mount current directory, mkdir run, and create config files
    # Test
    DSimu -b 100 # Simulation, reads default.yaml, outputs dp_simu.root
    DDis # Event display, reads dp_simu.root
    exit
    

⁠Singularity - Linux

  1. Install singularity. If you have access to a machine running CVMFS⁠, simply

    export PATH="/cvmfs/atlas.cern.ch/repo/containers/sw/singularity/x86_64-el7/current/bin:$PATH"
    
  2. For SJTU bl-0 cluster: don't work in the login node

    condor_submit -i
    
  3. Run

    cd darkshine-docker
    ./singularity.sh
    echo alias dss-docker=\"$PWD/singularity.sh bash --init-file /root/dss.sh\" >> ~/.bashrc
    source ~/.bashrc
    

⁠For Developers

The Docker supports debugger gdb, dynamic analysis tools valgrind, and profiler perf.

⁠CLion example settings

Toolchains

  • Name: DSS
  • Image: ykrsama/darkshine-simulation:latest
  • Container Settings: -e DISPLAY=host.docker.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix:ro --net host --rm

CMake

  • Toolchain: DSS
  • Uncheck: Environment - Include system environment variables

Run/Debug Configurations

  • Environment variables:

    HOME /root
    DISPLAY host.docker.internal:0
    
  • Environment variables - Load variables from file: /entry-point.sh

Tag summary

Content type

Image

Digest

sha256:b9d37fffd…

Size

3 GB

Last updated

8 months ago

docker pull ykrsama/darkshine-simulation