-
Notifications
You must be signed in to change notification settings - Fork 4
Replatform on D2 Architecture #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f56c3bb
1f1f64d
1b50806
e787c16
a3fad2e
81df85e
532ca54
f22a81c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: push-artifact | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| paths: | ||
| - 'k8s/**' | ||
|
|
||
| jobs: | ||
| flux-push: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| component: | ||
| - manifests | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write # for pushing | ||
| id-token: write # for signing | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Install flux | ||
| uses: controlplaneio-fluxcd/distribution/actions/setup@main | ||
| - name: Install cosign | ||
| uses: sigstore/cosign-installer@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Push artifact | ||
| uses: controlplaneio-fluxcd/distribution/actions/push@main | ||
| id: push | ||
| with: | ||
| repository: ghcr.io/${{ github.repository }}/${{ matrix.component }} | ||
| path: "./k8s/${{ matrix.component }}" | ||
| diff-tag: latest | ||
| - name: Sign artifact | ||
| if: steps.push.outputs.pushed == 'true' | ||
| run: cosign sign --yes $DIGEST_URL | ||
| env: | ||
| DIGEST_URL: ${{ steps.push.outputs.digest-url }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: push-image | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| paths: | ||
| - 'container/**' | ||
|
|
||
| jobs: | ||
| docker-push: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| component: | ||
| - proxy-chatbot | ||
| - proxy-llm-guard | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write # for pushing | ||
| id-token: write # for signing | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Setup Docker Buildx | ||
| id: buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Install cosign | ||
| uses: sigstore/cosign-installer@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| # inspired by https://github.com/stefanprodan/podinfo/blob/b3396adb98a6a0f5eeedd1a600beaf5e954a1f28/.github/workflows/release.yml#L61-L94 | ||
| - name: Prepare tags | ||
| id: prep | ||
| run: | | ||
| VERSION=sha-${GITHUB_SHA::8} | ||
|
|
||
| echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
| echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||
| - name: Generate images meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| ghcr.io/${{ github.repository }}/${{ matrix.component }} | ||
| tags: | | ||
| type=raw,value=${{ steps.prep.outputs.VERSION }} | ||
| type=raw,value=latest | ||
| - name: Publish multi-arch image | ||
| uses: docker/build-push-action@v6 | ||
| id: push | ||
| with: | ||
| sbom: true | ||
| provenance: true | ||
| push: true | ||
| builder: ${{ steps.buildx.outputs.name }} | ||
| context: "./container/${{ matrix.component }}" | ||
| platforms: linux/amd64,linux/arm/v7,linux/arm64 | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| - name: Sign image | ||
| run: cosign sign --yes ghcr.io/${{ github.repository }}/${{ matrix.component }}@${DIGEST} | ||
| env: | ||
| DIGEST: ${{ steps.push.outputs.digest }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: release-artifact | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'manifests/*' | ||
|
|
||
| jobs: | ||
| flux-push-component: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write # for pushing | ||
| id-token: write # for signing | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Install flux | ||
| uses: controlplaneio-fluxcd/distribution/actions/setup@main | ||
| - name: Install cosign | ||
| uses: sigstore/cosign-installer@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Prepare tags | ||
| id: prep | ||
| env: | ||
| REF_NAME: ${{ github.ref_name }} | ||
| run: | | ||
| if [[ $REF_NAME != */* ]]; then | ||
| echo "Ref name is not in the format component/version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| COMPONENT=$(echo "$REF_NAME" | cut -d'/' -f 1) | ||
| VERSION=$(echo "$REF_NAME" | cut -d'/' -f 2) | ||
|
|
||
| echo "component=${COMPONENT}" >> $GITHUB_OUTPUT | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
| - name: Push artifact | ||
| uses: controlplaneio-fluxcd/distribution/actions/push@main | ||
| id: push | ||
| with: | ||
| repository: ghcr.io/${{ github.repository }}/${{ steps.prep.outputs.component }} | ||
| path: "./k8s/${{ steps.prep.outputs.component }}" | ||
| diff-tag: ${{ steps.prep.outputs.version }} | ||
| tags: latest-stable | ||
| - name: Sign artifact | ||
| if: steps.push.outputs.pushed == 'true' | ||
| run: cosign sign --yes $DIGEST_URL | ||
| env: | ||
| DIGEST_URL: ${{ steps.push.outputs.digest-url }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||
| name: release-image | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| tags: | ||||||
| - 'proxy-llm-guard/*' | ||||||
| - 'proxy-chatbot/*' | ||||||
|
|
||||||
| jobs: | ||||||
| docker-push-component: | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
| packages: write # for pushing | ||||||
| id-token: write # for signing | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
| - name: Set up QEMU | ||||||
| uses: docker/setup-qemu-action@v3 | ||||||
| - name: Setup Docker Buildx | ||||||
| id: buildx | ||||||
| uses: docker/setup-buildx-action@v3 | ||||||
| - name: Install cosign | ||||||
| uses: sigstore/cosign-installer@v3 | ||||||
| - name: Login to GitHub Container Registry | ||||||
| uses: docker/login-action@v3 | ||||||
| with: | ||||||
| registry: ghcr.io | ||||||
| username: ${{ github.actor }} | ||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||
| # inspired by https://github.com/stefanprodan/podinfo/blob/b3396adb98a6a0f5eeedd1a600beaf5e954a1f28/.github/workflows/release.yml#L61-L94 | ||||||
| - name: Prepare tags | ||||||
| id: prep | ||||||
| env: | ||||||
| REF_NAME: ${{ github.ref_name }} | ||||||
| run: | | ||||||
| if [[ $REF_NAME != */* ]]; then | ||||||
| echo "Ref name is not in the format component/version" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| COMPONENT=$(echo "$REF_NAME" | cut -d'/' -f 1) | ||||||
| VERSION=$(echo "$REF_NAME" | cut -d'/' -f 2) | ||||||
|
|
||||||
| echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||||||
| echo "COMPONENT=${COMPONENT}" >> $GITHUB_OUTPUT | ||||||
| echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||||||
| - name: Generate images meta | ||||||
| id: meta | ||||||
| uses: docker/metadata-action@v5 | ||||||
| with: | ||||||
| images: | | ||||||
| ghcr.io/${{ github.repository }}/${{ steps.prep.outputs.COMPONENT }} | ||||||
| tags: | | ||||||
| type=raw,value=${{ steps.prep.outputs.VERSION }} | ||||||
| type=raw,value=latest-stable | ||||||
| - name: Publish multi-arch image | ||||||
| uses: docker/build-push-action@v6 | ||||||
| id: push | ||||||
| with: | ||||||
| sbom: true | ||||||
| provenance: true | ||||||
| push: true | ||||||
| builder: ${{ steps.buildx.outputs.name }} | ||||||
| context: "./container/${{ steps.prep.outputs.COMPONENT }}" | ||||||
| platforms: linux/amd64,linux/arm/v7,linux/arm64 | ||||||
|
||||||
| platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
| platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||||
| kind: Kustomization | ||||
| resources: | ||||
| - 00-namespaces.yaml | ||||
| - 01-fw-prompt.yaml | ||||
| - 02-app-chatbot.yaml | ||||
| - 03-fw-model.yaml | ||||
| - 04-ctrl-prompt-llm-guard.yaml | ||||
| - 05-ctrl-prompt.yaml | ||||
| - 06-pvcs.yaml | ||||
| components: | ||||
| # - ./netpols/ | ||||
|
||||
| # - ./netpols/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
| kind: Component | ||
| resources: | ||
| - 07-netpols.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider using linux/arm64/v8 instead of linux/arm64 for more explicit ARM64 architecture specification, as linux/arm64 is an alias that may be deprecated.