Skip to content

Commit

Permalink
build slurm packages and docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-oleynik committed Sep 19, 2024
0 parents commit 9572cb8
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-slurm-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Add Slurm Packages to Release
on:
push:
branches:
- main
tags:
- "*"
jobs:
Create-Release-and-Upload-Dockerimage:
runs-on: debian-latest
steps:
- uses: actions/checkout@v4
- name: "Download Slurm ${{ github.ref_name }}"
command: |
curl https://download.schedmd.com/slurm/slurm-${{ github.ref_name }}.tar.bz2 -o slurm.tar.bz2
- name: "Unpack Slurm Sources"
command: |
tar -xjvf ./slurm.tar.bz2
- name: "Build/Install Dependencies"
working-directory: ./slurm-${{ github.ref_name }}
command: |
yes | mk-build-deps -i debian/control
- name: "Build Packages"
working-directory: ./slurm-${{ github.ref_name }}
command: |
debuild -b -uc -us
- name: "Create Release Artifact"
uses: softprops/action-gh-releases@v2
with:
prerelease: false
draft: false
files: |
slurm-smd*_${{ github.ref_name }}-1_amd64.deb
- name: "Login to Docker Hub"
uses: docker/login-actions@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Build and Push"
uses: docker/build-push-action@v6
with:
push: true
tags: scalableminds/slurmctl:${{ github.ref_name }}
build-args:
- SLURM_VERSION=${{ github.ref_name }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM debian:bookworm

ARG SLURM_VERSION
ARG SLURM_USER=slurm
ARG SLURM_GROUP=slurm

RUN apt-get update && apt-get upgrade --yes \
libpmix-bin

RUN mkdir /build
COPY *.deb /build
RUN apt-get install --yes -f \
/build/slurm-smd_$SLURM_VERSION-1_amd64.deb \
/build/slurm-smd-client_$SLURM_VERSION-1_amd64.deb \
/build/slurm-smd-slurmctld_$SLURM_VERSION-1_amd64.deb \
/build/slurm-smd-slurmdbd_$SLURM_VERSION-1_amd64.deb

RUN groupadd -rg 1001 $SLURM_GROUP && useradd -rg $SLURM_GROUP -u 1001 $SLURM_USER
RUN groupmod -g 1002 munge && \
usermod -g munge -u 1002 munge && \
chown -R munge:munge /var/lib/munge && \
chown -R munge:munge /etc/munge
RUN groupadd -rg 1003 slurmrestd && useradd -rg slurmrestd -u 1003 slurmrestd

0 comments on commit 9572cb8

Please sign in to comment.