Skip to content

Build pyxis

Build pyxis #5

Workflow file for this run

name: Build pyxis
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
slurm:
- version: 24.05.5
enroot:
- version: 3.5.0
pyxis:
- version: 0.21.0
image:
- file: pyxis/Dockerfile
push: false
platforms: linux/amd64
load: true
build_args:
BASE_IMAGE=ubuntu:22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
- name: Build docker images
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
file: ${{ matrix.image.file }}
push: ${{ matrix.image.push }}
tags: pyxis_builder:slurm_${{ matrix.slurm.version }}_enroot_${{ matrix.enroot.version }}_pyxis_${{ matrix.pyxis.vesion }}
platforms: ${{ matrix.image.platforms }}
load: ${{ matrix.image.load }}
build-args: |
${{ matrix.image.build_args }}
SLURM_VERSION=${{ matrix.slurm.version }}
ENROOT_VERSION=${{ matrix.enroot.version }}
PYXIS_VERSION=${{ matrix.pyxis.version }}
cache-from: type=local,src=.buildx-cache
cache-to: type=local,dest=.buildx-cache,mode=max
- name: Create pyxis_build_output directory
run: mkdir -p pyxis_build_output
- name: Run Docker container and copy files
run: |
container_id=$(docker pyxis_builder_slurm_${{ matrix.slurm.version }}_enroot_${{ matrix.enroot.version }}:${{ matrix.pyxis.vesion }})
docker start $container_id
docker cp $container_id:/usr/src/debs/ ./pyxis_build_output/
docker rm $container_id
- name: Create GitHub Release and Upload DEB packages
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: pyxis-${{ matrix.pyxis.version }}_slurm_${{ matrix.slurm.version }}_enroot_${{ matrix.enroot.version }}
name: Pyxis ${{ matrix.pyxis.version }}
body: Pyxis ${{ matrix.pyxis.version }} for Slurm ${{ matrix.slurm.version }} and Enroot ${{ matrix.enroot.version }}
draft: false
prerelease: false
files: |
pyxis_build_output/debs/*.deb
- name: Cleanup
run: rm -rf pyxis_build_output/*.deb