Skip to content
Open
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
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
branches:
- master
pull_request:

env:
IMAGE_PREFIX: ghcr.io/fairrootgroup/odc-ci

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read

strategy:
fail-fast: false
matrix:
include:
- fedora: fedora39
label: fedora-39-x86_64-gcc-13
- fedora: fedora40
label: fedora-40-x86_64-gcc-14
- fedora: fedora41
label: fedora-41-x86_64-gcc-14
- fedora: fedora42
label: fedora-42-x86_64-gcc-15
- fedora: fedora42-boost190
label: fedora-42-x86_64-gcc-15-boost-1.90
- fedora: fedora42
label: sanitizers
extra: -DENABLE_SANITIZERS=ON

container:
image: ${{ format('{0}:{1}', 'ghcr.io/fairrootgroup/odc-ci', matrix.fedora) }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build and test
env:
LABEL: ${{ matrix.label }}
run: ctest -S ODCTest.cmake -VV --output-on-failure ${{ matrix.extra }}

- name: Collect logs on failure
if: failure()
run: |
mkdir -p build/logs
cp -r ~/.ODC/ build/logs/ODC 2>/dev/null || true
cp -r ~/.DDS/ build/logs/DDS 2>/dev/null || true

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.label }}
path: |
build/logs/
build/tmp/
if-no-files-found: ignore
retention-days: 7
65 changes: 65 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Docker Images

on:
push:
branches:
- master
paths:
- 'utils/ci/Dockerfile.*'
pull_request:
paths:
- 'utils/ci/Dockerfile.*'
workflow_dispatch:
Comment thread
rbx marked this conversation as resolved.

env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/fairrootgroup/odc-ci

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
include:
- image: fedora39
build-args: FEDORA_VERSION=39
- image: fedora40
build-args: FEDORA_VERSION=40
- image: fedora41
build-args: FEDORA_VERSION=41
- image: fedora42
build-args: FEDORA_VERSION=42
- image: fedora42-boost190
build-args: |
FEDORA_VERSION=42
BOOST_VERSION=90

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
context: utils/ci
file: utils/ci/Dockerfile.fedora
build-args: ${{ matrix.build-args }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.IMAGE_PREFIX }}:${{ matrix.image }}
cache-from: type=registry,ref=${{ env.IMAGE_PREFIX }}:${{ matrix.image }}-cache
cache-to: type=registry,ref=${{ env.IMAGE_PREFIX }}:${{ matrix.image }}-cache,mode=max
5 changes: 4 additions & 1 deletion tests/odc-fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ struct TopologyFixture
path.erase(pos);
}
mSession.mCollectionDetails.emplace(res.m_collectionID, CollectionDetails{res.m_agentID, res.m_collectionID, path, res.m_host, res.m_wrkDir, "unknown_job_id"});
mSession.mRuntimeCollectionIndex.at(res.m_collectionID)->mRuntimeCollectionAgents[res.m_collectionID] = res.m_agentID;
auto it = mSession.mRuntimeCollectionIndex.find(res.m_collectionID);
if (it != mSession.mRuntimeCollectionIndex.end()) {
it->second->mRuntimeCollectionAgents[res.m_collectionID] = res.m_agentID;
}
}
}
}
Expand Down
79 changes: 79 additions & 0 deletions utils/ci/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Usage:
# docker build -f Dockerfile.fedora .
# docker build -f Dockerfile.fedora --build-arg FEDORA_VERSION=41 --build-arg DDS_VERSION=3.17 .
# docker build -f Dockerfile.fedora --build-arg BOOST_VERSION=90 .

# Stage 1: Common build environment with shared dnf packages.
ARG FEDORA_VERSION=42
FROM fedora:${FEDORA_VERSION} AS buildenv

RUN dnf -y update && \
dnf -y install abseil-cpp-devel \
asio-devel \
ca-certificates \
cmake \
flatbuffers-devel \
flatbuffers-compiler \
fmt-devel \
gcc-c++ \
git \
grpc-devel \
grpc-plugins \
libxml2 \
ninja-build \
patch \
wget \
zeromq-devel

# Stage 2: Build custom dependencies from source into /usr/local.
# Source and build trees are discarded with this stage.
FROM buildenv AS build

ARG BOOST_VERSION=
ARG FAIRCMAKEMODULES_VERSION=v1.0.0
ARG FAIRLOGGER_VERSION=v2.3.1
ARG FAIRMQ_VERSION=v1.10.1
ARG DDS_VERSION=3.18

RUN if [ -n "${BOOST_VERSION}" ]; then \
wget -O /boost.tar.gz "https://archives.boost.io/release/1.${BOOST_VERSION}.0/source/boost_1_${BOOST_VERSION}_0.tar.gz" && \
tar xzf /boost.tar.gz && \
cd /boost_1_${BOOST_VERSION}_0 && \
./bootstrap.sh --prefix=/usr/local && \
./b2 install -j$(nproc) --without-python --without-mpi && \
cd / && rm -rf /boost.tar.gz /boost_1_${BOOST_VERSION}_0; \
else \
dnf -y install boost-devel; \
fi

ADD --keep-git-dir=true https://github.com/FairRootGroup/FairCMakeModules.git#${FAIRCMAKEMODULES_VERSION} /FairCMakeModules
RUN cmake -GNinja -S FairCMakeModules -B FairCMakeModules_build -DCMAKE_INSTALL_PREFIX=/usr/local && \
cmake --build FairCMakeModules_build --target install

ADD --keep-git-dir=true https://github.com/FairRootGroup/FairLogger.git#${FAIRLOGGER_VERSION} /FairLogger
RUN cmake -GNinja -S FairLogger -B FairLogger_build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release && \
cmake --build FairLogger_build --target install

ADD --keep-git-dir=true https://github.com/FairRootGroup/FairMQ.git#${FAIRMQ_VERSION} /FairMQ
RUN cmake -GNinja -S FairMQ -B FairMQ_build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release && \
cmake --build FairMQ_build --target install

ADD https://github.com/FairRootGroup/DDS.git#${DDS_VERSION} /DDS
RUN echo "${DDS_VERSION}" > /DDS/version && \
cmake -GNinja -S DDS -B DDS_build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DBUILD_dds-tutorials=OFF && \
cmake --build DDS_build --target wn_bin && \
cmake --build DDS_build --target install

# Stage 3: Final image with ODC-specific build dependencies
# and the install trees of the custom-built dependencies from stage 2.
FROM buildenv AS final

ARG BOOST_VERSION=
RUN if [ -z "${BOOST_VERSION}" ]; then dnf -y install boost-devel; fi && \
dnf -y install clang-tools-extra \
libasan \
liblsan \
libubsan && \
dnf -y clean all

COPY --from=build /usr/local /usr/local
27 changes: 0 additions & 27 deletions utils/ci/centos.8stream.alice.def

This file was deleted.

35 changes: 0 additions & 35 deletions utils/ci/fedora36_dds3.7.22.def

This file was deleted.

35 changes: 0 additions & 35 deletions utils/ci/fedora37_dds3.7.22.def

This file was deleted.

48 changes: 0 additions & 48 deletions utils/ci/fedora38_dds3.12.def

This file was deleted.

Loading