Skip to content

Add histogram of number of triggered channels in muon candidate events #391

Add histogram of number of triggered channels in muon candidate events

Add histogram of number of triggered channels in muon candidate events #391

# calin/.github/workflows/singularity-build-and-deploy.yml - Stephen Fegan - 2021-08-23
#
# Continuous deployment using Github Actions and singularity
#
# Build and deploy calin container to the Github container repository
#
# Copyright 2021, Stephen Fegan <[email protected]>
# Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris
#
# This file is part of "calin"
#
# "calin" is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 or later, as published by
# the Free Software Foundation.
#
# "calin" is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
name: Singularity build and deploy
on:
push:
branches:
- main
paths-ignore:
- .github/workflows/native-build-and-test.yml
- azure-pipelines.yml
- Dockerfile
env:
geant_version: 11.2.2
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
arch: [ 'generic', 'ivybridge', 'broadwell', 'cascadelake' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y gsl-bin libgsl0-dev libfftw3-dev \
libzmq3-dev python3 python3-dev python3-numpy libxerces-c-dev \
libpcap-dev libz-dev libprotobuf-c-dev protobuf-c-compiler \
libprotobuf-dev protobuf-compiler libprotoc-dev libzstd-dev \
build-essential libssl-dev uuid-dev libgpgme11-dev squashfs-tools \
libseccomp-dev pkg-config libfuse3-dev
curl -L https://github.com/llr-cta/CTA_ADH_APIS_Build/releases/download/${{matrix.os}}/cta_adh_apis_installed.tgz | sudo tar -zxf - -C /
curl -L https://github.com/llr-cta/Geant4Build/releases/download/${{matrix.os}}-${{env.geant_version}}-OFF/Geant4-${{matrix.os}}-${{env.geant_version}}-OFF.tbz2 | sudo tar -jxf - -C /
- name: Configure calin
shell: bash
run: |
mkdir mybuild
cd mybuild
cmake -DCALIN_BUILD_ARCH=${{ matrix.arch }} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCALIN_PYTHON_SUB_DIR=lib/python3.10 \
-DNO_GEANT4_TEST:BOOLEAN=TRUE \
..
- name: Build calin
shell: bash
run: |
cd mybuild
make -j3
- name: Install calin
shell: bash
run: |
sudo find /usr -print > /tmp/files_before.txt
cd mybuild
sudo make install
- name: Package calin in TGZ file
shell: bash
run: |
sudo find /usr -print > /tmp/files_after.txt
cat /tmp/files_before.txt /tmp/files_after.txt | sort | uniq -u > /tmp/files_added.txt
tar -zcvf /tmp/calin_installed.tgz -C / -T /tmp/files_added.txt
ls -l /tmp/calin_installed.tgz
- name: Store calin TGZ file
uses: actions/upload-artifact@v4
with:
name: calin_installed_${{matrix.os}}_${{matrix.arch}}
path: /tmp/calin_installed.tgz
retention-days: 5
deploy:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
arch: [ 'generic', 'ivybridge', 'broadwell', 'cascadelake' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libssl-dev uuid-dev libgpgme11-dev squashfs-tools \
libseccomp-dev pkg-config libfuse3-dev
- name: Retrieve calin TGZ file
uses: actions/download-artifact@v4
with:
name: calin_installed_${{matrix.os}}_${{matrix.arch}}
path: /tmp
- name: Set up Go 1.21.1
uses: actions/setup-go@v5
with:
go-version: 1.21.1
cache: false
id: go
- name: Install Singularity
env:
SINGULARITY_VERSION: 3.8.3
GOPATH: /tmp/go
run: |
mkdir -p $GOPATH
sudo mkdir -p /usr/local/var/singularity/mnt
mkdir -p $GOPATH/src/github.com/sylabs
cd $GOPATH/src/github.com/sylabs
wget -qO- https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz | tar -zxf -
cd singularity-ce-${SINGULARITY_VERSION}
./mconfig -p /usr/local
make -C builddir
sudo make -C builddir install
- name: Build calin singularity container
run: |
sudo -E singularity build calin-${{ matrix.arch }}.sif singularity_build.def
ls -l calin-${{ matrix.arch }}.sif
singularity inspect calin-${{ matrix.arch }}.sif
- name: Login and deploy Container
run: |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
singularity push -U calin-${{ matrix.arch }}.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
- name: Pull container and compare
run: |
singularity pull calin-pulled.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
diff calin-${{ matrix.arch }}.sif calin-pulled.sif