From fa7ba4f48cd8fdf1673d3675695141e88e88ac59 Mon Sep 17 00:00:00 2001 From: smcavallo Date: Mon, 29 Jan 2024 08:53:27 -0500 Subject: [PATCH] support for multi-arch (#44) * support for multi-arch Signed-off-by: smcavallo * build rust with cross * update tests --- .github/workflows/rust.yml | 42 ++++++++++++++------- Cargo.lock | 2 +- charts/databricks-kube-operator/Chart.yaml | 4 +- charts/databricks-kube-operator/values.yaml | 1 - databricks-kube/Cargo.toml | 2 +- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b4efad2..cadc71d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,22 +11,33 @@ jobs: with: api-key: ${{secrets.FOSSA_API_KEY}} test: - name: Build, test (x86) + name: Test (x86) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - uses: Swatinem/rust-cache@v2 - - uses: actions-rs/cargo@v1 + - uses: houseabsolute/actions-rust-cross@v0 with: - command: test - args: -- --test-threads=1 - - uses: actions-rs/cargo@v1 + command: "test" + toolchain: stable + args: "--test-threads=1" + build: + name: Build + runs-on: ubuntu-latest + needs: test + strategy: + matrix: + target: [ aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu ] + steps: + - uses: actions/checkout@v4 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 with: - command: build - args: --release --all-features + command: "build" + target: ${{ matrix.target }} + toolchain: stable + args: "--locked --release --all-features" + strip: true - uses: actions/upload-artifact@v4 with: name: crd_gen @@ -34,11 +45,11 @@ jobs: - uses: actions/upload-artifact@v4 with: name: databricks_kube - path: target/release/databricks_kube - publish_image: + path: target/release/databricks_kube + publish: name: Docker runs-on: ubuntu-latest - needs: test + needs: build if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 @@ -48,6 +59,10 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta @@ -68,5 +83,6 @@ jobs: with: context: . push: true + platforms: linux/amd64, linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Cargo.lock b/Cargo.lock index 21249fd..9851236 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -392,7 +392,7 @@ dependencies = [ [[package]] name = "databricks_kube" -version = "0.6.1" +version = "0.6.2" dependencies = [ "assert-json-diff", "async-stream", diff --git a/charts/databricks-kube-operator/Chart.yaml b/charts/databricks-kube-operator/Chart.yaml index 1af1250..d0b1901 100644 --- a/charts/databricks-kube-operator/Chart.yaml +++ b/charts/databricks-kube-operator/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: 0.6.1 +appVersion: 0.6.2 name: databricks-kube-operator description: A kube-rs operator for managing Databricks API resources -version: 0.6.1 +version: 0.6.2 home: https://github.com/mach-kernel/databricks-kube-operator sources: diff --git a/charts/databricks-kube-operator/values.yaml b/charts/databricks-kube-operator/values.yaml index 32af581..9e58873 100644 --- a/charts/databricks-kube-operator/values.yaml +++ b/charts/databricks-kube-operator/values.yaml @@ -9,6 +9,5 @@ image: podAnnotations: {} nodeSelector: kubernetes.io/os: linux - kubernetes.io/arch: amd64 resources: {} affinity: {} diff --git a/databricks-kube/Cargo.toml b/databricks-kube/Cargo.toml index 3051f44..14a64a4 100644 --- a/databricks-kube/Cargo.toml +++ b/databricks-kube/Cargo.toml @@ -5,7 +5,7 @@ path = "src/crdgen.rs" [package] name = "databricks_kube" default-run = "databricks_kube" -version = "0.6.1" +version = "0.6.2" edition = "2021" [dependencies]