|
8 | 8 | runs-on: ubuntu-latest |
9 | 9 | outputs: |
10 | 10 | daytime: ${{ steps.set_daytime.outputs.daytime }} |
| 11 | + image: ${{ steps.set_image.outputs.image }} |
11 | 12 | steps: |
12 | 13 | - id: set_daytime |
13 | 14 | name: Compute shared DAYTIME |
14 | 15 | run: echo "daytime=$(date -u +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT" |
15 | 16 |
|
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 }}) |
18 | 23 | 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 |
19 | 36 |
|
20 | | - name: Building image Nebius ubuntu |
21 | 37 | env: |
22 | | - DAYTIME: ${{ needs.prepare.outputs.daytime }} |
| 38 | + IMAGE: ${{ needs.prepare.outputs.image }} |
23 | 39 |
|
24 | 40 | steps: |
25 | 41 | - 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 |
27 | 54 |
|
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" |
30 | 62 |
|
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 |
33 | 66 |
|
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 |
36 | 69 | run: | |
| 70 | + set -euo pipefail |
| 71 | + ARCH_TAG="${IMAGE}-${{ matrix.arch }}" |
| 72 | + echo "Pushing single-arch: ${ARCH_TAG} (${{ matrix.platform }})" |
37 | 73 | 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}" \ |
40 | 76 | --target neubuntu \ |
41 | 77 | --progress=plain \ |
42 | 78 | --push \ |
43 | 79 | . |
| 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