Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ derivatives/**

# ignore documentation
docs/**

# ignore CI scripts
ci/**
.github/**
5 changes: 0 additions & 5 deletions .github/interop/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions .github/interop/force-legacy-onnx.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .github/interop/no-testing.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.0.0/force-legacy-onnx.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.0.0/no-testing.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.0.2/force-legacy-onnx.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.0.2/no-testing.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.1.13/force-legacy-onnx.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.1.13/no-testing.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.2.4/force-legacy-onnx.sh

This file was deleted.

1 change: 0 additions & 1 deletion .github/interop/v3.2.4/no-testing.sh

This file was deleted.

69 changes: 18 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,29 @@ jobs:
name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

list-ldmx-sw-to-test:
name: List ldmx-sw Versions to Test
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.read_json.outputs.matrix}}
steps:
- uses: actions/checkout@v4
- id: read_json
run: echo "matrix=$(jq -c . ci/ldmx-sw-to-test.json)" >> $GITHUB_OUTPUT

test:
needs: merge
needs:
- list-ldmx-sw-to-test
- merge
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ldmx_sw_branch: [ trunk, v3.0.0, v3.0.2, v3.1.13, v3.2.4, v3.2.12, v3.3.0, v3.4.0, v4.0.0 ]
matrix: ${{fromJSON(needs.list-ldmx-sw-to-test.outputs.matrix)}}
defaults:
run:
shell: bash
steps:
-
name: Setup QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Download Build Context for Test Script
uses: actions/checkout@v4
Expand All @@ -156,48 +161,10 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Pull down ldmx-sw for testing
uses: actions/checkout@v4
name: Install just
uses: extractions/setup-just@v2
with:
repository: LDMX-Software/ldmx-sw
submodules: recursive
path: ldmx-sw
ref: ${{ matrix.ldmx_sw_branch }}
fetch-depth: 0
just-version: 1.26.0
-
name: Test the Image
run: |
echo "::group::Init Environment"
# extract a single tag to run tests with
tag=$(jq -r .tags[0] <<<"${DOCKER_METADATA_OUTPUT_JSON}")
export LDMX_BASE=$(pwd)
export _docker_parameters="-i -e LDMX_BASE -v $LDMX_BASE:$LDMX_BASE ${tag}"
mkdir ldmx-sw/build
interop_patches=".github/interop/${{ matrix.ldmx_sw_branch }}"
echo "::endgroup::"
if [ -d ${interop_patches} ]; then
echo "::group::Found ldmx-sw patches for ${{ matrix.ldmx_sw_branch }}"
for patch in ${interop_patches}/*; do
echo "running ${patch}"
./${patch}
done
echo "::endgroup::"
else
echo "::group::No patches for ${{ matrix.ldmx_sw_branch }}"
echo "::endgroup::"
fi
echo "::group::Build ldmx-sw"
docker run $_docker_parameters $(pwd)/ldmx-sw/build 'cmake .. && make install'
echo "::endgroup::"
echo "::group::Run python test script"
docker run $_docker_parameters $(pwd) python3 test.py
echo "::endgroup::"
if [ ! -d ${interop_patches} ]; then
echo "::group::ldmx-sw test program"
docker run $_docker_parameters $(pwd)/ldmx-sw/build ctest --verbose
echo "::endgroup::"
echo "::group::run a basic inclusive sim"
docker run $_docker_parameters $(pwd) \
'LDMX_RUN_NUMBER=1 LDMX_NUM_EVENTS=10 fire ldmx-sw/.github/validation_samples/inclusive/config.py'
echo "::endgroup::"
fi
run: ./ci/test-ldmx-sw $(jq -r .tags[0] <<< "${DOCKER_METADATA_OUTPUT_JSON}") ${{ matrix.ldmx_sw }}
36 changes: 36 additions & 0 deletions .github/workflows/ldmx-sw-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---

name: Test ldmx-sw Dependabot

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # every Sunday at midnight

jobs:
check-on-runner-releases:
permissions:
pull-requests: write
contents: write
actions: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: fetch latest releases
run: |
./ci/ldmx-sw-dependabot --apply
git config --global user.name ldmx-sw-test-bot
git config --global user.email ldmx-sw-test-bot@users.noreply.github.com
git switch -c auto-ldmx-sw-test-update
git add ci/ldmx-sw-to-test.json
git commit -m "Auto ldmx-sw Version Update" || exit 0
git push -fu origin auto-runner-update
gh pr create \
--base main \
--head auto-runner-update \
--title "Auto ldmx-sw Version Update" \
--body "Written by custom dependabot script that checks for new updates. PR now free to be modified/closed."
env:
GH_TOKEN: ${{ github.token }}
20 changes: 20 additions & 0 deletions ci/interop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Legacy Interop

The patch files here are intended to patch older versions of ldmx-sw
so that they can be built with newer images that have newer dependencies
and compilers.

They are `git apply`ed within ldmx-sw and are applied before the configuration (`cmake`)
step so that they can modify the build configuration files if need be.

For creating a patch files, there is a small script in this directory
that runs the appropriate `git` commands for you.
```
# inside of the ldmx-sw you have patched
path/to/ci/interop/save-patch
```

Many versions of ldmx-sw require the same patch and so instead of copying the
same file, I have just symlinked a specific version's patch file to the previous
version so that developers only need to update a patch file for the version
where the (now breaking) change was introduced.
67 changes: 67 additions & 0 deletions ci/interop/save-patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
# save the patched version of ldmx-sw into a patch file

set -o nounset
set -o errexit

usage() {
cat <<\HELP

USAGE:
./path/to/ci/interop/save-patch [path/to/ldmx-sw] [-h|--help]

ARGUMENTS
-h|--help : print this help and exit
path/to/ldmx-sw : provide full path to ldmx-sw, otherwise tries to use current directory

HELP
}

ci_interop_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)"
ldmx_sw_dir="${PWD}" # default to current directory
while [ "$#" -gt 0 ]; do
case "$1" in
-h|--help)
usage
exit 0
;;
-*)
echo "ERROR: Unknown option '${1}'"
usage
exit 1
;;
*)
if [ -d "${1}" ]; then
ldmx_sw_dir="$(cd -- "${1}" &> /dev/null && pwd)"
else
echo "ERROR: '${1}' is not a directory."
exit 1
fi
;;
esac
shift
done

cd "${ldmx_sw_dir}"

if ! git rev-parse --git-dir &> /dev/null; then
echo "ERROR: '${ldmx_sw_dir}' is not a git repository."
exit 2
fi

first_remote_url=$(git remote get-url $(git remote))
if ! [[ "${first_remote_url}" =~ .*LDMX-Software/ldmx-sw.* ]]; then
echo "ERROR: '${ldmx_sw_dir}' is not ldmx-sw. It points to '${first_remote_url}'."
exit 2
fi

# inside ldmx-sw
version=$(git describe --tags)
diff_cmd="git diff"
if [[ "${version}" =~ ^v3 ]]; then
diff_cmd="${diff_cmd} --submodule=diff"
fi

rm ${ci_interop_dir}/${version}.patch
${diff_cmd} > ${ci_interop_dir}/${version}.patch

13 changes: 13 additions & 0 deletions ci/interop/v3.3.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Submodule Conditions contains modified content
diff --git a/Conditions/include/Conditions/SimpleTableCondition.h b/Conditions/include/Conditions/SimpleTableCondition.h
index e418c42..79ed3a3 100644
--- a/Conditions/include/Conditions/SimpleTableCondition.h
+++ b/Conditions/include/Conditions/SimpleTableCondition.h
@@ -7,6 +7,7 @@
#define FRAMEWORK_SIMPLETABLECONDITION_H_

#include <vector>
+#include <cstdint>

#include "Framework/ConditionsObject.h"
#include "Framework/Exception/Exception.h"
13 changes: 13 additions & 0 deletions ci/interop/v3.4.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Submodule Conditions contains modified content
diff --git a/Conditions/include/Conditions/SimpleTableCondition.h b/Conditions/include/Conditions/SimpleTableCondition.h
index 467d8b9..632de04 100644
--- a/Conditions/include/Conditions/SimpleTableCondition.h
+++ b/Conditions/include/Conditions/SimpleTableCondition.h
@@ -8,6 +8,7 @@

#include <vector>
#include <ostream>
+#include <cstdint>

#include "Framework/ConditionsObject.h"
#include "Framework/Exception/Exception.h"
12 changes: 12 additions & 0 deletions ci/interop/v4.0.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/Conditions/include/Conditions/SimpleTableCondition.h b/Conditions/include/Conditions/SimpleTableCondition.h
index d34d930d..b69f81c7 100644
--- a/Conditions/include/Conditions/SimpleTableCondition.h
+++ b/Conditions/include/Conditions/SimpleTableCondition.h
@@ -8,6 +8,7 @@

#include <ostream>
#include <vector>
+#include <cstdint>

#include "Framework/ConditionsObject.h"
#include "Framework/Exception/Exception.h"
23 changes: 23 additions & 0 deletions ci/interop/v4.1.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/Conditions/include/Conditions/SimpleTableCondition.h b/Conditions/include/Conditions/SimpleTableCondition.h
index d34d930d..b69f81c7 100644
--- a/Conditions/include/Conditions/SimpleTableCondition.h
+++ b/Conditions/include/Conditions/SimpleTableCondition.h
@@ -8,6 +8,7 @@

#include <ostream>
#include <vector>
+#include <cstdint>

#include "Framework/ConditionsObject.h"
#include "Framework/Exception/Exception.h"
diff --git a/TrigScint/src/TrigScint/Firmware/clusterproducer_sw.cxx b/TrigScint/src/TrigScint/Firmware/clusterproducer_sw.cxx
index 140011d9..0e07b681 100644
--- a/TrigScint/src/TrigScint/Firmware/clusterproducer_sw.cxx
+++ b/TrigScint/src/TrigScint/Firmware/clusterproducer_sw.cxx
@@ -1,5 +1,6 @@
#include <stdio.h>

+#include <array>
#include <iostream>

#include "TrigScint/Firmware/clusterproducer.h"
1 change: 1 addition & 0 deletions ci/interop/v4.2.3.patch
Loading
Loading