sigven / pcgr

Personal Cancer Genome Reporter (PCGR)
https://sigven.github.io/pcgr
MIT License
251 stars 47 forks source link

Sif image #218

Closed AidanGCr closed 10 months ago

AidanGCr commented 11 months ago

Is your feature request related to a problem? Please describe. It would be nice to have a sif image pre-built and downloadable from this repo instead of building the sif from docker/apptainer on my personal computer and then transferring it to an HPC.

Describe the solution you'd like A downloadable pre-built sif for the latest docker image.

Describe alternatives you've considered I have built the image for myself, but this could be a hassle for new users/students who are working in locked-down (no sudo access) HPC environments. Alternatively, adding a section to the readme about how to make the sif from the docker image would be good, as it's only a few lines of code.

Additional context I think this would help bring in new users.

sigven commented 11 months ago

Dear @AidanGCr ,

Thanks a lot for this! I totally agree, several users have already made their own Singularity images, having this pre-built would make it much easier for others. Would you care to share some of your setup, as to how you built your SIF image? That would be very helpful, as I am not that experienced with this part. I will of course acknowledge your contributions in this respect.

Happy to have your input,

best, Sigve

AidanGCr commented 10 months ago

Absolutely! I run a Linux desktop at home so here's everything pertinent about my system from inxi -Fx:

System:
  Host: fedora Kernel: 6.5.6-200.fc38.x86_64 arch: x86_64 bits: 64
    compiler: gcc v: 2.39-9.fc38 Desktop: GNOME v: 44.5 Distro: Fedora release
    38 (Thirty Eight)
Machine:
  Type: Desktop System: Micro-Star product: MS-7E27 v: 1.0
    serial: <superuser required>
  Mobo: Micro-Star model: PRO B650M-P (MS-7E27) v: 1.0
    serial: <superuser required> UEFI: American Megatrends LLC. v: 1.20
    date: 08/10/2023
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 2S
    charge: 55% (should be ignored) status: discharging
CPU:
  Info: 6-core model: AMD Ryzen 5 7600X bits: 64 type: MT MCP arch: Zen 4
    rev: 2 cache: L1: 384 KiB L2: 6 MiB L3: 32 MiB
  Speed (MHz): avg: 968 high: 4027 min/max: 400/5453 cores: 1: 400 2: 400
    3: 400 4: 3600 5: 400 6: 400 7: 400 8: 400 9: 400 10: 4027 11: 400 12: 400
    bogomips: 112803
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] vendor: ASRock
    driver: amdgpu v: kernel arch: RDNA-2 bus-ID: 03:00.0
  Device-2: AMD Raphael vendor: Micro-Star MSI driver: amdgpu v: kernel
    arch: RDNA-2 bus-ID: 12:00.0 temp: 33.0 C
  Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 22.1.9 driver: X:
    loaded: amdgpu unloaded: fbdev,modesetting,radeon,vesa dri: radeonsi
    gpu: amdgpu resolution: 2560x1440~120Hz
  API: OpenGL v: 4.6 vendor: amd mesa v: 23.1.8 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon RX 6800 XT (navi21 LLVM 16.0.6 DRM
    3.54 6.5.6-200.fc38.x86_64)
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
    bus-ID: 03:00.1
  Device-2: AMD Rembrandt Radeon High Definition Audio
    vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus-ID: 12:00.1
  Device-3: AMD Family 17h/19h HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 12:00.6
  API: ALSA v: k6.5.6-200.fc38.x86_64 status: kernel-api
  Server-1: PipeWire v: 0.3.81 status: active
Network:
  Device-1: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169
    v: kernel port: e000 bus-ID: 0e:00.0
  IF: enp14s0 state: up speed: 1000 Mbps duplex: full mac: ea:71:c5:48:61:43
  IF-ID-1: docker0 state: down mac: 02:42:62:c6:9c:05
Drives:
  Local Storage: total: 5.46 TiB used: 1.35 TiB (24.8%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WD BLACK SN770 1TB
    size: 931.51 GiB temp: 32.9 C
  ID-2: /dev/sda vendor: Seagate model: ST5000LM000-2AN170 size: 4.55 TiB
    type: USB
Partition:
  ID-1: / size: 929.93 GiB used: 670.43 GiB (72.1%) fs: btrfs
    dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 344.4 MiB (35.4%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 17.4 MiB (2.9%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 929.93 GiB used: 670.43 GiB (72.1%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 36.1 C mobo: N/A
  Fan Speeds (rpm): N/A
  GPU: device: amdgpu temp: 31.0 C fan: 0 device: amdgpu temp: 34.0 C
Info:
  Processes: 421 Uptime: 30m Memory: total: 32 GiB note: est.
  available: 30.5 GiB used: 5.02 GiB (16.5%) Init: systemd
  target: graphical (5) Compilers: gcc: 13.2.1 clang: 16.0.6 Packages: 39
  note: see --rpm Shell: fish v: 3.6.1 inxi: 3.3.30

As for creating the singularity/apptainer image, all that is needed is the below (assuming docker and singularity/apptainer are installed - something like sudo dnf install apptainer on Fedora):

sudo docker pull sigven/pcgr:vX.X.X #fill in your desired version here
sudo docker save sigven/pcgr:X.X.X -o myimage.tar #fill in your desired tar file name here as well 
sudo apptainer build mysif.sif docker-archive://myimage.tar #fill in your desired sif file name here as well 

The sif should be usable from there. On my workstation the sif and tar file are output to your home directory. You may need to use --fakeroot after the build keyword in the final command if sudo isn't working for you. Just add fakeroot and remove sudo and you should be good to go. Needless to say you need root access to do all of this, but you can easily transfer the sif file to an HPC after with scp or another protocol.

Thanks, Aidan