Skip to content

Commit 82dfb2f

Browse files
committed
added yaml and trying ghrc
1 parent a633eca commit 82dfb2f

7 files changed

Lines changed: 293 additions & 45 deletions

File tree

.github/workflows/docker.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Build & Publish GitHub Container Registry (GHCR) Images
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
9+
concurrency:
10+
group: ghcr-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
discover:
15+
name: Discover Dockerfiles
16+
runs-on: ubuntu-latest
17+
outputs:
18+
matrix: ${{ steps.scan.outputs.matrix }}
19+
image: ${{ steps.scan.outputs.image }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- id: scan
24+
uses: actions/github-script@v7
25+
with:
26+
script: |
27+
const fs = require('fs');
28+
const path = require('path');
29+
const dir = 'dockerfiles';
30+
const entries = fs.existsSync(dir) ? fs.readdirSync(dir) : [];
31+
const rows = [];
32+
for (const f of entries) {
33+
if (!f.startsWith('Dockerfile-gemc-')) continue;
34+
// Expected: Dockerfile-gemc-<tag>-<os>
35+
const rest = f.replace(/^Dockerfile-/, ''); // "gemc-<tag>-<os>"
36+
const m = /^gemc-([^-]+)-(.+)$/.exec(rest);
37+
if (!m) { core.warning(`Skipping ${f}`); continue; }
38+
const tag = m[1];
39+
const os = m[2];
40+
const weight = ((tag.match(/(\d+)$/) || [])[1] ?? '0')|0; // numeric suffix, default 0
41+
rows.push({ file: path.join(dir, f), tag, os, weight });
42+
}
43+
if (!rows.length) core.setFailed(`No matching dockerfiles in ${dir}`);
44+
45+
// Choose "latest" per OS by highest weight
46+
const maxByOS = {};
47+
for (const r of rows) {
48+
if (!(r.os in maxByOS) || r.weight > maxByOS[r.os]) maxByOS[r.os] = r.weight;
49+
}
50+
const include = rows.map(r => ({ file: r.file, tag: r.tag, os: r.os, latest: r.weight === maxByOS[r.os] }));
51+
52+
core.setOutput('matrix', JSON.stringify({ include }));
53+
core.setOutput('image', `ghcr.io/${process.env.GITHUB_REPOSITORY_OWNER.toLowerCase()}/gemc`);
54+
55+
build:
56+
name: Build ${{ matrix.tag }} on ${{ matrix.os }}
57+
needs: discover
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: read
61+
packages: write
62+
strategy:
63+
fail-fast: false
64+
matrix: ${{ fromJSON(needs.discover.outputs.matrix) }}
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: docker/setup-qemu-action@v3
68+
- uses: docker/setup-buildx-action@v3
69+
70+
- name: Log in to GHCR
71+
uses: docker/login-action@v3
72+
with:
73+
registry: ghcr.io
74+
username: ${{ github.actor }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- id: meta
78+
name: Generate tags/labels (incl. latest alias)
79+
uses: docker/metadata-action@v5
80+
with:
81+
images: ${{ needs.discover.outputs.image }}
82+
tags: |
83+
type=raw,value=gemc-${{ matrix.tag }}-${{ matrix.os }}
84+
type=raw,value=gemc-latest-${{ matrix.os }},enable=${{ matrix.latest }}
85+
labels: |
86+
org.opencontainers.image.source=${{ github.repository }}
87+
org.opencontainers.image.description=GEMC image (${{ matrix.tag }} on ${{ matrix.os }})
88+
89+
- name: Build (PR) or Build+Push (main/tags)
90+
uses: docker/build-push-action@v6
91+
with:
92+
context: .
93+
file: ${{ matrix.file }}
94+
platforms: linux/amd64,linux/arm64
95+
push: ${{ github.event_name != 'pull_request' }}
96+
tags: ${{ steps.meta.outputs.tags }}
97+
labels: ${{ steps.meta.outputs.labels }}
98+
cache-from: type=gha
99+
cache-to: type=gha,mode=max

LICENSE

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
GEMC Software License
2+
Version 1.0, August 25, 2025
3+
4+
Copyright (c) 2006–2025,
5+
Maurizio Ungaro and Thomas Jefferson National Accelerator Facility (“Jefferson Lab”).
6+
All rights not expressly granted under this license are reserved.
7+
8+
This software includes voluntary contributions made to the GEMC project.
9+
Additional information about GEMC may be provided in the accompanying
10+
documentation or repository.
11+
12+
Installation, use, reproduction, display, modification, and redistribution of
13+
this software, with or without modification, in source and binary forms, are
14+
permitted on a non-exclusive basis. Any exercise of rights by you under this
15+
license is subject to the following conditions:
16+
17+
1. Redistributions of this software, in whole or in part, with or without
18+
modification, must reproduce the above copyright notice and these license
19+
conditions in (a) the source code, (b) the user documentation, and (c) any
20+
other materials provided with the redistributed software.
21+
22+
2. The user documentation, if any, included with a redistribution, must
23+
include the following notice:
24+
“This product includes software developed by Maurizio Ungaro and the
25+
GEMC project at Thomas Jefferson National Accelerator Facility
26+
(Jefferson Lab).”
27+
If that is where third-party acknowledgments normally appear, this
28+
acknowledgment must also be reproduced in any modified version of this
29+
software itself.
30+
31+
3. Scientific citation. Publications or presentations that use this software
32+
or results produced with it must include the following citation:
33+
M. Ungaro, “Geant4 Monte-Carlo (GEMC) A database-driven simulation
34+
program,” EPJ Web of Conferences 295, 05005 (2024),
35+
https://doi.org/10.1051/epjconf/202429505005
36+
37+
4. Names and endorsement. The names “GEMC” and “GEMC: Geant4 Monte-Carlo”
38+
may not be used to endorse or promote software or products derived from
39+
this software except with prior written permission from the copyright
40+
holders. For permissions, contact: gemc@jlab.org. If this software
41+
is redistributed in modified form, the name and reference of the modified
42+
version must be clearly distinguishable from that of this software.
43+
44+
5. Modifications. You are under no obligation to provide anyone with any
45+
modifications of this software that you may develop, including but not
46+
limited to bug fixes, patches, upgrades, or other enhancements or
47+
derivatives of features, functionality, or performance. However, if you
48+
publish or distribute your modifications without contemporaneously
49+
requiring users to enter into a separate written license agreement, then
50+
you are deemed to have granted Maurizio Ungaro, Jefferson Lab, and all
51+
contributors to GEMC a license to your modifications, including
52+
modifications protected by any patent owned or controlled by you, under
53+
the conditions of this license.
54+
55+
6. Patents. You may not include this software, in whole or in part, in any
56+
patent or patent application in respect of any modification of this
57+
software developed by you.
58+
59+
7. Third-party software. This software may be distributed with or may require
60+
third-party components (including, without limitation, Geant4, CLHEP, Qt,
61+
ROOT, SQLite, Assimp, and others) that are separately licensed. Such
62+
components are provided under their respective licenses, and you must
63+
comply with those licenses in addition to this one. Where required (for
64+
example, by the Geant4 license), you must reproduce the applicable notices
65+
and acknowledgments in your redistribution.
66+
67+
8. DISCLAIMER
68+
69+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
70+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
71+
IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, AND FITNESS
72+
FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE COPYRIGHT HOLDERS AND
73+
CONTRIBUTORS MAKE NO REPRESENTATION THAT THE SOFTWARE, OR MODIFICATIONS
74+
THEREOF, WILL NOT INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET, OR OTHER
75+
PROPRIETARY RIGHT.
76+
77+
9. LIMITATION OF LIABILITY
78+
79+
IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
80+
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR
81+
PUNITIVE DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
82+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS,
83+
OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF CONTRACT,
84+
WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, OR OTHERWISE,
85+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
86+
POSSIBILITY OF SUCH DAMAGES.
87+
88+
10. Termination. This license shall terminate with immediate effect and without
89+
notice if you fail to comply with any of its terms, or if you institute
90+
litigation against any copyright holder or contributor with regard to this
91+
software.

README.md

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,28 @@
11
# GEMC: Geant4 Monte-Carlo
22

3-
### Pull requests
4-
5-
[![Almalinux Build](https://github.com/gemc/src/actions/workflows/build_gemc_almalinux.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_almalinux.yml)
6-
[![Fedora Build](https://github.com/gemc/src/actions/workflows/build_gemc_fedora.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_fedora.yml)
7-
[![Ubuntu Build](https://github.com/gemc/src/actions/workflows/build_gemc_ubuntu.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_ubuntu.yml)
8-
[![Sanitize](https://github.com/gemc/src/actions/workflows/sanitize.yaml/badge.svg)](https://github.com/gemc/src/actions/workflows/sanitize.yaml)
9-
10-
### Nightly
11-
12-
[![Nightly Dev Release](https://github.com/gemc/src/actions/workflows/dev_release.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/dev_release.yml)
13-
[![Doxygen](https://github.com/gemc/src/actions/workflows/doxygen.yaml/badge.svg)](https://github.com/gemc/src/actions/workflows/doxygen.yaml)
14-
15-
163

17-
## Installing GEMC with meson
184

195

20-
## Sanitizers
216

22-
- none, address, thread, undefined, memory, leak (meson configure)
237

24-
Working on mac:
258

26-
- undefined
279

28-
## Validation
10+
<hr>
2911

30-
The validation includes the following workflows
12+
<br/>
13+
<br/>
3114

32-
- Compile and install gemc
33-
- Run gemc modules tests
34-
- Run API tests
15+
## CI
3516

17+
### Pull requests
3618

37-
## Multithreading
38-
39-
### Shared classes: geometry and physics tables are shared:
40-
- G4VUserDetectorConstruction,
41-
- G4VUserPhysicsList
42-
- G4VUserActionInitialization
43-
- Pretty sure GRun
44-
45-
### Local thread classes:
46-
- EventManager
47-
- TrackingManager
48-
- SteppingManager
49-
- TransportationManager
50-
- GeometryManager
51-
- FieldManager
52-
- Navigator
53-
- SensitiveDetectorManager
54-
55-
# Validation
56-
19+
[![Almalinux Build](https://github.com/gemc/src/actions/workflows/build_gemc_almalinux.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_almalinux.yml)
20+
[![Fedora Build](https://github.com/gemc/src/actions/workflows/build_gemc_fedora.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_fedora.yml)
21+
[![Ubuntu Build](https://github.com/gemc/src/actions/workflows/build_gemc_ubuntu.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/build_gemc_ubuntu.yml)
22+
[![Sanitize](https://github.com/gemc/src/actions/workflows/sanitize.yaml/badge.svg)](https://github.com/gemc/src/actions/workflows/sanitize.yaml)
5723

24+
### Nightly
5825

59-
### Known issues:
26+
[![Nightly Dev Release](https://github.com/gemc/src/actions/workflows/dev_release.yml/badge.svg)](https://github.com/gemc/src/actions/workflows/dev_release.yml)
27+
[![Doxygen](https://github.com/gemc/src/actions/workflows/doxygen.yaml/badge.svg)](https://github.com/gemc/src/actions/workflows/doxygen.yaml)
6028

61-
- on ubuntuu somehow libz is linked statically, and the compilation fails. Somehow using sanitize 'undefined' fixes this.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM jeffersonlab/geant4:g4v11.3.2-almalinux94
2+
LABEL maintainer="Maurizio Ungaro <ungaro@jlab.org>"
3+
4+
# run shell instead of sh
5+
SHELL ["/bin/bash", "-c"]
6+
ENV AUTOBUILD 1
7+
8+
RUN echo "module load gemc/dev3" >> /etc/profile.d/localSetup.sh
9+
10+
11+
# ceInstall update
12+
RUN cd /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
13+
&& git pull
14+
15+
16+
RUN source /etc/profile.d/localSetup.sh \
17+
&& module use /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
18+
&& module load gemc/dev3 \
19+
&& git clone http://github.com/gemc/src /root/src \
20+
&& cd /root/src \
21+
&& ./ci/build.sh
22+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM jeffersonlab/geant4:g4v11.3.2-fedora36
2+
LABEL maintainer="Maurizio Ungaro <ungaro@jlab.org>"
3+
4+
# run shell instead of sh
5+
SHELL ["/bin/bash", "-c"]
6+
ENV AUTOBUILD 1
7+
8+
RUN echo "module load gemc/dev3" >> /etc/profile.d/localSetup.sh
9+
10+
11+
# ceInstall update
12+
RUN cd /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
13+
&& git pull
14+
15+
16+
RUN source /etc/profile.d/localSetup.sh \
17+
&& module use /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
18+
&& module load gemc/dev3 \
19+
&& git clone http://github.com/gemc/src /root/src \
20+
&& cd /root/src \
21+
&& ./ci/build.sh
22+
23+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM jeffersonlab/geant4:g4v11.3.2-fedora40
2+
LABEL maintainer="Maurizio Ungaro <ungaro@jlab.org>"
3+
4+
# run shell instead of sh
5+
SHELL ["/bin/bash", "-c"]
6+
ENV AUTOBUILD 1
7+
8+
RUN echo "module load gemc/dev3" >> /etc/profile.d/localSetup.sh
9+
10+
11+
# ceInstall update
12+
RUN cd /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
13+
&& git pull
14+
15+
16+
RUN source /etc/profile.d/localSetup.sh \
17+
&& module use /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
18+
&& module load gemc/dev3 \
19+
&& git clone http://github.com/gemc/src /root/src \
20+
&& cd /root/src \
21+
&& ./ci/build.sh
22+
23+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM jeffersonlab/geant4:g4v11.3.2-ubuntu24
2+
LABEL maintainer="Maurizio Ungaro <ungaro@jlab.org>"
3+
4+
# run shell instead of sh
5+
SHELL ["/bin/bash", "-c"]
6+
ENV AUTOBUILD 1
7+
8+
RUN echo "module load gemc/dev3" >> /etc/profile.d/localSetup.sh
9+
10+
11+
# ceInstall update
12+
RUN cd /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
13+
&& git pull
14+
15+
16+
RUN source /etc/profile.d/localSetup.sh \
17+
&& module use /cvmfs/oasis.opensciencegrid.org/jlab/geant4/modules \
18+
&& module load gemc/dev3 \
19+
&& git clone http://github.com/gemc/src /root/src \
20+
&& cd /root/src \
21+
&& ./ci/build.sh
22+
23+

0 commit comments

Comments
 (0)