-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (115 loc) · 4.25 KB
/
slurm.yml
File metadata and controls
138 lines (115 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Slurm image build
on:
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
daytime: ${{ steps.set_daytime.outputs.daytime }}
steps:
- id: set_daytime
name: Compute shared DAYTIME
run: echo "daytime=$(date -u +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT"
build_single_arch:
name: Build slurm=${{ matrix.slurm_version }} arch=${{ matrix.arch }}
needs: prepare
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
slurm_version: ["25.05.6", "25.11.3"]
arch: ["amd64", "arm64"]
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-24.04
- arch: arm64
platform: linux/arm64
runner: ubuntu-24.04-arm
env:
DAYTIME: ${{ needs.prepare.outputs.daytime }}
# https://console.eu.nebius.com/project-e00managed-schedulers/registry/registry-e00hrt9na9xsn2px9f
IMAGE_BASE: cr.eu-north1.nebius.cloud/ml-containers/slurm
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Install Nebius CLI
shell: bash
run: |
set -euo pipefail
curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
echo "$HOME/.nebius/bin" >> "$GITHUB_PATH"
- name: Restore Nebius config
shell: bash
run: |
set -euo pipefail
mkdir -p "$HOME/.nebius"
echo "${{ secrets.NEBIUS_CONFIG_YAML_B64 }}" | base64 -d > "$HOME/.nebius/config.yaml"
chmod 600 "$HOME/.nebius/config.yaml"
- name: Configure Nebius docker credential-helper for auth
shell: bash
run: nebius registry configure-helper
- name: Build and push single-arch image
shell: bash
run: |
set -euo pipefail
IMAGE="${IMAGE_BASE}:${{ matrix.slurm_version }}-${DAYTIME}"
ARCH_TAG="${IMAGE}-${{ matrix.arch }}"
CACHE_REF="${IMAGE_BASE}:${{ matrix.slurm_version }}-${{ matrix.arch }}"
echo "Pushing: ${ARCH_TAG} (${{matrix.platform}}) with cache ${CACHE_REF}"
docker buildx build \
--platform "${{ matrix.platform }}" \
--build-arg SLURM_VERSION="${{ matrix.slurm_version }}" \
-t "${ARCH_TAG}" \
--target slurm \
--progress=plain \
--cache-from=type=registry,ref="${CACHE_REF}" \
--cache-to=type=registry,ref="${CACHE_REF}",mode=max \
--push \
.
create_manifest:
name: Create manifest slurm=${{ matrix.slurm_version }}
needs: [prepare, build_single_arch]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
slurm_version: ["25.05.6", "25.11.3"]
env:
DAYTIME: ${{ needs.prepare.outputs.daytime }}
IMAGE_BASE: cr.eu-north1.nebius.cloud/ml-containers/slurm
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Install Nebius CLI
shell: bash
run: |
set -euo pipefail
curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
echo "$HOME/.nebius/bin" >> "$GITHUB_PATH"
- name: Restore Nebius config
shell: bash
run: |
set -euo pipefail
mkdir -p "$HOME/.nebius"
echo "${{ secrets.NEBIUS_CONFIG_YAML_B64 }}" | base64 -d > "$HOME/.nebius/config.yaml"
chmod 600 "$HOME/.nebius/config.yaml"
- name: Configure Nebius docker credential-helper for auth
shell: bash
run: nebius registry configure-helper
- name: Create and push manifest list
shell: bash
run: |
set -euo pipefail
IMAGE="${IMAGE_BASE}:${{ matrix.slurm_version }}-${DAYTIME}"
AMD="${IMAGE}-amd64"
ARM="${IMAGE}-arm64"
echo "Creating multi-arch manifest: ${IMAGE}"
echo " - ${AMD}"
echo " - ${ARM}"
docker buildx imagetools create \
-t "${IMAGE}" \
"${AMD}" \
"${ARM}"