Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spack 2024 #35

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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
108 changes: 7 additions & 101 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,112 +7,18 @@ on:
required: true
type: string

env:
BUILD_DIR: ${{ github.workspace }}/build
INSTALL_DIR: ${{ github.workspace }}/install

CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 10G

CXX_STANDARD: "20"

jobs:

build:
runs-on: "${{ inputs.os }}"
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: ./dependencies.sh

- name: Cache build
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.job }}

- name: Initial configure
run: >
cmake -S ${{ github.workspace }}
-B ${{ env.BUILD_DIR }}
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
-DCMAKE_BUILD_PARALLEL_LEVEL=3
-DCMAKE_CXX_STANDARD=${{ env.CXX_STANDARD }}


- name: Build
run: >
cmake --build ${BUILD_DIR}

- name: Remove .pyc files and tests from install directory
run: |
find ${INSTALL_DIR} -type f -name *.pyc -delete
rm -rf ${INSTALL_DIR}/python/3.12.2/lib/python3.12/test

- name: Package build
run: |
tar czf install.tar.gz -C ${INSTALL_DIR} .

- uses: actions/upload-artifact@v4
with:
name: install_${{ inputs.os }}
path: |
install.tar.gz

make_tarball:
runs-on: ubuntu-latest # we don't need macOS here
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
name: install_${{ inputs.os }}
path: .

- name: Unpack full bundle
run: |
mkdir -p ${INSTALL_DIR}
tar xf install.tar.gz -C ${INSTALL_DIR}
rm install.tar.gz

- name: Package merged directory
run: |
tar cf - -C ${INSTALL_DIR} . | zstd -o install.tar.zst -19 -T$(nproc)

- name: Upload merged install directory
uses: actions/upload-artifact@v4
with:
name: deps_${{ inputs.os }}
path: |
install.tar.zst

deploy_to_eos:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest # we don't need macOS here
needs:
- make_tarball
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PWD: ${{ secrets.DEPLOY_PWD }}
steps:
- uses: actions/checkout@v4

- name: Install prerequisites
run: >
sudo apt-get install -y krb5-user krb5-config

- uses: actions/download-artifact@v4
with:
name: deps_${{ inputs.os }}
path: .
- name: Set up Spack
uses: spack/setup-spack@v2

- name: Upload
run: |
echo "$DEPLOY_PWD" | kinit $DEPLOY_USER@CERN.CH 2>&1 >/dev/null
sha=$(echo $GITHUB_SHA | head -c 7)
name=deps.$sha.tar.zst
echo $name
echo $sha
mv install.tar.zst $name
scp -F ssh_config $name $DEPLOY_USER@lxplus.cern.ch:/eos/user/a/atsjenkins/www/ACTS/ci/${{ inputs.os }}/cmake
ssh -F ssh_config $DEPLOY_USER@lxplus.cern.ch ln -f -s $name /eos/user/a/atsjenkins/www/ACTS/ci/${{ inputs.os }}/cmake/deps.latest.tar.zst
- run: |
sudo mkdir -p /opt/spack /opt/view
sudo chown $USER /opt/spack
sudo chown $USER /opt/view
- run: spack -e . install --no-check-signature
21 changes: 21 additions & 0 deletions spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
spack:
specs:
- boost@1.86.0
- cmake@3.30.1
- edm4hep@0.10.5
- eigen@3.4.0
- git-lfs@3.5.1
- intel-tbb@2021.12.0
- nlohmann-json@3.11.3
- podio@1.0.1
- root@6.32.02~opengl

config:
install_tree:
# root: /opt/spack
padded_length: 128

mirrors:
local-buildcache:
url: oci://ghcr.io/acts-project/spack-buildcache
signed: false