Skip to content

Commit d0329ae

Browse files
committed
SCHED-907 build Neubuntu image on github runners
1 parent 1c89e38 commit d0329ae

File tree

1 file changed

+97
-13
lines changed

1 file changed

+97
-13
lines changed

.github/workflows/neubuntu.yml

Lines changed: 97 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,120 @@ jobs:
88
runs-on: ubuntu-latest
99
outputs:
1010
daytime: ${{ steps.set_daytime.outputs.daytime }}
11+
image: ${{ steps.set_image.outputs.image }}
1112
steps:
1213
- id: set_daytime
1314
name: Compute shared DAYTIME
1415
run: echo "daytime=$(date -u +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT"
1516

16-
build_and_push:
17-
runs-on: [self-hosted, X64]
17+
- id: set_image
18+
name: Set base image name
19+
run: echo "image=cr.eu-north1.nebius.cloud/ml-containers/neubuntu:noble-${{ steps.set_daytime.outputs.daytime }}" >> "$GITHUB_OUTPUT"
20+
21+
build_single_arch:
22+
name: Build & push single-arch (${{ matrix.arch }})
1823
needs: prepare
24+
runs-on: ${{ matrix.runner }}
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- arch: amd64
31+
platform: linux/amd64
32+
runner: ubuntu-24.04
33+
- arch: arm64
34+
platform: linux/arm64
35+
runner: ubuntu-24.04-arm
1936

20-
name: Building image Nebius ubuntu
2137
env:
22-
DAYTIME: ${{ needs.prepare.outputs.daytime }}
38+
IMAGE: ${{ needs.prepare.outputs.image }}
2339

2440
steps:
2541
- name: Checkout repository
26-
uses: actions/checkout@v6
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
46+
47+
- name: Install Nebius CLI
48+
shell: bash
49+
run: |
50+
set -euo pipefail
51+
curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
52+
echo "$HOME/.nebius/bin" >> "$GITHUB_PATH"
53+
nebius version
2754
28-
- name: Add docker-credential-nebius to PATH
29-
run: echo "/home/ml_containers/.nebius/bin" >> $GITHUB_PATH
55+
- name: Restore Nebius config
56+
shell: bash
57+
run: |
58+
set -euo pipefail
59+
mkdir -p "$HOME/.nebius"
60+
echo "${{ secrets.NEBIUS_CONFIG_YAML_B64 }}" | base64 -d > "$HOME/.nebius/config.yaml"
61+
chmod 600 "$HOME/.nebius/config.yaml"
3062
31-
- name: Get image version name
32-
run: echo "cr.eu-north1.nebius.cloud/ml-containers/neubuntu:noble-${{ env.DAYTIME }}"
63+
- name: Configure Nebius docker credential-helper for auth
64+
shell: bash
65+
run: nebius registry configure-helper
3366

34-
- name: Build and push image
35-
# https://console.eu.nebius.com/project-e00managed-schedulers/registry/registry-e00hrt9na9xsn2px9f
67+
- name: Build and push single-arch image
68+
shell: bash
3669
run: |
70+
set -euo pipefail
71+
ARCH_TAG="${IMAGE}-${{ matrix.arch }}"
72+
echo "Pushing single-arch: ${ARCH_TAG} (${{ matrix.platform }})"
3773
docker buildx build \
38-
--platform linux/amd64,linux/arm64 \
39-
-t cr.eu-north1.nebius.cloud/ml-containers/neubuntu:noble-${{ env.DAYTIME }} \
74+
--platform "${{ matrix.platform }}" \
75+
-t "${ARCH_TAG}" \
4076
--target neubuntu \
4177
--progress=plain \
4278
--push \
4379
.
80+
81+
create_manifest:
82+
name: Create & push multi-arch manifest
83+
needs: [prepare, build_single_arch]
84+
runs-on: ubuntu-24.04
85+
86+
env:
87+
IMAGE: ${{ needs.prepare.outputs.image }}
88+
89+
steps:
90+
- name: Set up Docker Buildx
91+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
92+
93+
- name: Install Nebius CLI
94+
shell: bash
95+
run: |
96+
set -euo pipefail
97+
curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
98+
echo "$HOME/.nebius/bin" >> "$GITHUB_PATH"
99+
nebius version
100+
101+
- name: Restore Nebius config
102+
shell: bash
103+
run: |
104+
set -euo pipefail
105+
mkdir -p "$HOME/.nebius"
106+
echo "${{ secrets.NEBIUS_CONFIG_YAML_B64 }}" | base64 -d > "$HOME/.nebius/config.yaml"
107+
chmod 600 "$HOME/.nebius/config.yaml"
108+
109+
- name: Configure Nebius docker credential-helper for auth
110+
shell: bash
111+
run: nebius registry configure-helper :contentReference[oaicite:3]{index=3}
112+
113+
- name: Create and push manifest list
114+
shell: bash
115+
run: |
116+
set -euo pipefail
117+
AMD="${IMAGE}-amd64"
118+
ARM="${IMAGE}-arm64"
119+
120+
echo "Creating multi-arch manifest: ${IMAGE}"
121+
echo " - ${AMD}"
122+
echo " - ${ARM}"
123+
124+
docker buildx imagetools create \
125+
-t "${IMAGE}" \
126+
"${AMD}" \
127+
"${ARM}"

0 commit comments

Comments
 (0)