mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-17 16:20:25 +00:00
* perf: build the ee debug file in the same depot build as the image Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: sign the ee image before uploading its debug files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * TEMP: verify debuglink crc on dispatch * chore: drop the temporary debuglink check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep a failed debug upload from blocking the ee release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
843 lines
31 KiB
YAML
843 lines
31 KiB
YAML
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.event_name != 'pull_request' && github.event_name !=
|
|
'workflow_dispatch' && github.repository || 'windmill-labs/windmill-test' }}
|
|
DEV_SHA: ${{ github.event_name != 'pull_request' && github.event_name !=
|
|
'workflow_dispatch' && 'dev' || github.event.inputs.tag || github.sha }}
|
|
name: Build windmill:main
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["*"]
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
paths:
|
|
- "Dockerfile"
|
|
workflow_dispatch:
|
|
inputs:
|
|
ee:
|
|
description: "Build EE image (true, false)"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
tag:
|
|
description: "Tag the image"
|
|
required: true
|
|
default: "test"
|
|
slim:
|
|
description: "Build slim image (true, false)"
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
concurrency:
|
|
group: ${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
permissions: write-all
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubicloud
|
|
if: (github.event_name != 'workflow_dispatch') || (github.event.inputs &&
|
|
!github.event.inputs.ee)
|
|
# Jobs that build from, extract or retag this image must reference it by
|
|
# this digest: concurrent main-branch runs push :dev too, so a tag run
|
|
# reading :dev can ship a main build under the release version.
|
|
outputs:
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
# GIT_VERSION is `git describe --tags`, which needs the history and
|
|
# tags but no file contents beyond the checked-out tree
|
|
fetch-depth: 0
|
|
filter: blob:none
|
|
|
|
- name: Read EE repo commit hash
|
|
run: |
|
|
echo "ee_repo_ref=$(cat ./backend/ee-repo-ref.txt)" >> "$GITHUB_ENV"
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: windmill-labs/windmill-ee-private
|
|
path: ./windmill-ee-private
|
|
ref: ${{ env.ee_repo_ref }}
|
|
token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }}
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Substitute EE code (EE logic is behind feature flag)
|
|
run: |
|
|
./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private
|
|
|
|
- name: Docker meta
|
|
id: meta-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
flavor: |
|
|
latest=false
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Build and push publicly
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
build-args: |
|
|
features=ce
|
|
WM_BUILD_VERSION=${{ github.sha }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }}
|
|
${{ steps.meta-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-public.outputs.labels }}
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
build_ee:
|
|
runs-on: ubicloud
|
|
if: (github.event_name != 'workflow_dispatch') || github.event.inputs.ee
|
|
outputs:
|
|
digest: ${{ steps.digest.outputs.digest }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
# GIT_VERSION is `git describe --tags`, which needs the history and
|
|
# tags but no file contents beyond the checked-out tree
|
|
fetch-depth: 0
|
|
filter: blob:none
|
|
|
|
- name: Read EE repo commit hash
|
|
run: |
|
|
echo "ee_repo_ref=$(cat ./backend/ee-repo-ref.txt)" >> "$GITHUB_ENV"
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: windmill-labs/windmill-ee-private
|
|
path: ./windmill-ee-private
|
|
ref: ${{ env.ee_repo_ref }}
|
|
token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }}
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-ee-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee
|
|
flavor: |
|
|
latest=false
|
|
tags: |
|
|
type=raw,value=${{ env.DEV_SHA }}
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
labels: |
|
|
org.opencontainers.image.licenses=Windmill-Enterprise-License
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Substitute EE code
|
|
run: |
|
|
./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private
|
|
|
|
- name: Build and push publicly ee
|
|
id: docker_build
|
|
uses: depot/bake-action@v1
|
|
env:
|
|
WM_BUILD_VERSION: ${{ github.sha }}
|
|
SBOM: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
with:
|
|
files: |
|
|
./.github/docker-bake-ee.hcl
|
|
${{ steps.meta-ee-public.outputs.bake-file-tags }}
|
|
${{ steps.meta-ee-public.outputs.bake-file-labels }}
|
|
targets: ${{ (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') && 'image,debuginfo' || 'image' }}
|
|
|
|
- name: Read image digest
|
|
id: digest
|
|
env:
|
|
METADATA: ${{ steps.docker_build.outputs.metadata }}
|
|
run: |
|
|
digest=$(jq -er '.image["containerimage.digest"]' <<<"$METADATA")
|
|
echo "digest=$digest" | tee -a "$GITHUB_OUTPUT"
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee
|
|
digest: ${{ steps.digest.outputs.digest }}
|
|
|
|
# The debug file names every EE function with its source file and line, so it
|
|
# goes to a private bucket, never to the public release. A failed upload must
|
|
# not fail build_ee: every EE image and the release binary wait on it.
|
|
- name: Upload debug files to private bucket
|
|
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
|
|
continue-on-error: true
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: us-east-1
|
|
TAG: ${{ github.ref_name }}
|
|
run: |
|
|
set -euo pipefail
|
|
trap 'echo "::error::EE debug files were not uploaded for $TAG"' ERR
|
|
ls -l ./debuginfo/linux_amd64/windmill.debug ./debuginfo/linux_arm64/windmill.debug
|
|
[[ "$GITHUB_REF" == refs/tags/v* ]] || exit 0
|
|
aws configure set default.s3.multipart_chunksize 64MB
|
|
for arch in amd64 arm64; do
|
|
aws s3 cp "./debuginfo/linux_$arch/windmill.debug" \
|
|
"s3://windmill-ee-debuginfo/$TAG/windmill-ee-$arch.debug" \
|
|
--storage-class GLACIER_IR --only-show-errors
|
|
done
|
|
|
|
attach_amd64_binary_to_release:
|
|
needs: [build, build_ee]
|
|
runs-on: ubicloud
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
env:
|
|
ARCH: amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# The runner disk cannot hold the CE and EE images at once, so each image
|
|
# is pulled, extracted from and removed before the next one is pulled.
|
|
- name: Extract binaries
|
|
env:
|
|
CE_IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }}
|
|
EE_IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }}
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p release
|
|
# extract <image> (<path in image> <release file name>)...
|
|
extract() {
|
|
local image=$1 cid
|
|
shift
|
|
docker pull --platform "linux/$ARCH" "$image"
|
|
docker image inspect --format '{{.Os}}/{{.Architecture}}' "$image"
|
|
cid=$(docker create --platform "linux/$ARCH" "$image")
|
|
while [ $# -gt 0 ]; do
|
|
docker cp "$cid:$1" "release/$2"
|
|
shift 2
|
|
done
|
|
docker rm "$cid"
|
|
docker rmi "$image"
|
|
df -h /
|
|
}
|
|
extract "$CE_IMAGE" \
|
|
/usr/src/app/windmill "windmill-$ARCH" \
|
|
/usr/src/app/windmill_duckdb_runner windmill_duckdb_runner
|
|
extract "$EE_IMAGE" /usr/src/app/windmill "windmill-ee-$ARCH"
|
|
ls -la release
|
|
|
|
- name: Attach binary to release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: release/*
|
|
|
|
# attach_arm64_binary_to_release:
|
|
# needs: [build, build_ee]
|
|
# runs-on: ubicoud
|
|
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
# env:
|
|
# ARCH: arm64
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
|
|
# - run: |
|
|
# # pulling docker image with desired arch so that actions-docker-extract doesn't do it
|
|
# docker pull --platform "linux/$ARCH" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }}
|
|
# docker pull --platform "linux/$ARCH" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }}
|
|
|
|
# - run: |
|
|
# # Checks the image is in docker prior to running actions-docker-extract. It fails if not
|
|
# # Also useful to visually check that the arch is the right opencontainers
|
|
# docker image inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }}
|
|
# docker image inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }}
|
|
|
|
# - uses: shrink/actions-docker-extract@v3
|
|
# id: extract
|
|
# with:
|
|
# image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }}
|
|
# path: "/usr/src/app/windmill"
|
|
|
|
# - uses: shrink/actions-docker-extract@v3
|
|
# id: extract-ee
|
|
# with:
|
|
# image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }}
|
|
# path: "/usr/src/app/windmill"
|
|
|
|
# - name: Rename binary with corresponding architecture
|
|
# run: |
|
|
# mv "${{ steps.extract.outputs.destination }}/windmill" "${{ steps.extract.outputs.destination }}/windmill-${ARCH}"
|
|
# mv "${{ steps.extract-ee.outputs.destination }}/windmill" "${{ steps.extract-ee.outputs.destination }}/windmill-ee-${ARCH}"
|
|
|
|
# - name: Attach binary to release
|
|
# uses: softprops/action-gh-release@v2
|
|
# with:
|
|
# files: |
|
|
# ${{ steps.extract.outputs.destination }}/*
|
|
# ${{ steps.extract-ee.outputs.destination }}/*
|
|
|
|
run_integration_test:
|
|
runs-on: ubicloud
|
|
needs: [build_ee]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
fetch-depth: 0
|
|
- name: Prepare test run
|
|
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
|
|
run: cd integration_tests && ./build.sh
|
|
- name: Test run
|
|
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
|
|
timeout-minutes: 15
|
|
env:
|
|
LICENSE_KEY: ${{ secrets.WM_LICENSE_KEY_CI }}
|
|
run: cd integration_tests && ./run.sh
|
|
- name: Archive logs
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: Windmill Integration Tests Logs
|
|
path: |
|
|
integration_tests/logs
|
|
|
|
tag_latest:
|
|
runs-on: ubicloud
|
|
needs: [run_integration_test, build]
|
|
if:
|
|
github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' ||
|
|
startsWith(github.ref, 'refs/tags/v')) && (github.event_name != 'workflow_dispatch')
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Tag main and latest
|
|
run: |
|
|
docker buildx imagetools create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }} --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
docker buildx imagetools create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }} --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
|
|
|
|
- uses: sigstore/cosign-installer@v4.1.2
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
with:
|
|
cosign-release: "v2.6.5"
|
|
# end-to-end release guard: the version tag pushed by this run must
|
|
# verify against this exact run's identity (the mutable :latest/:dev
|
|
# tags race with concurrent main builds, so they are not asserted here)
|
|
- name: Verify release image is signed
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
cosign verify \
|
|
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
--certificate-identity "https://github.com/windmill-labs/windmill/.github/workflows/docker-image.yml@${GITHUB_REF}" \
|
|
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF_NAME#v}"
|
|
|
|
tag_latest_ee:
|
|
runs-on: ubicloud
|
|
needs: [run_integration_test, build_ee]
|
|
if:
|
|
github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch') && (github.ref == 'refs/heads/main' ||
|
|
startsWith(github.ref, 'refs/tags/v'))
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Tag main and latest for ee
|
|
run: |
|
|
docker buildx imagetools create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }} --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:latest
|
|
docker buildx imagetools create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }} --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:main
|
|
|
|
- uses: sigstore/cosign-installer@v4.1.2
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
with:
|
|
cosign-release: "v2.6.5"
|
|
# end-to-end release guard: the version tag pushed by this run must
|
|
# verify against this exact run's identity (the mutable :latest/:dev
|
|
# tags race with concurrent main builds, so they are not asserted here)
|
|
- name: Verify release ee image is signed
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
cosign verify \
|
|
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
--certificate-identity "https://github.com/windmill-labs/windmill/.github/workflows/docker-image.yml@${GITHUB_REF}" \
|
|
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${GITHUB_REF_NAME#v}"
|
|
|
|
# Scans the digests this run built, never a tag: :main and :latest race with concurrent main
|
|
# builds. Release artifacts are uploaded before the gate so a failing gate still publishes them.
|
|
scan_release_images:
|
|
runs-on: ubicloud
|
|
needs: [build, build_ee, build_slim, build_ee_slim]
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- image: windmill
|
|
suffix: ""
|
|
digest: ${{ needs.build.outputs.digest }}
|
|
- image: windmill-ee
|
|
suffix: "-ee"
|
|
digest: ${{ needs.build_ee.outputs.digest }}
|
|
- image: windmill-slim
|
|
suffix: "-slim"
|
|
digest: ${{ needs.build_slim.outputs.digest }}
|
|
- image: windmill-ee-slim
|
|
suffix: "-ee-slim"
|
|
digest: ${{ needs.build_ee_slim.outputs.digest }}
|
|
env:
|
|
# 0.69.3, pinned by digest so a republished tag cannot change what runs with release credentials.
|
|
TRIVY_IMAGE: aquasec/trivy@sha256:bcc376de8d77cfe086a917230e818dc9f8528e3c852f7b1aff648949b6258d1c
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Image reference
|
|
run: echo "IMAGE_REF=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.suffix }}@${{ matrix.digest }}" >> "$GITHUB_ENV"
|
|
|
|
# The VEX must be built from an unfiltered scan: a statement covers only the CVEs listed in it.
|
|
# amd64 only: both arches install the same package versions from the same sources.
|
|
- name: Trivy scan
|
|
run: |
|
|
mkdir -p scan
|
|
trivy() { docker run --rm -v "$RUNNER_TEMP/trivy-cache:/root/.cache/trivy" -v "$PWD/scan:/out" "$TRIVY_IMAGE" "$@"; }
|
|
trivy image -q --platform linux/amd64 \
|
|
--scanners vuln --format json -o /out/full.json "$IMAGE_REF"
|
|
.github/scripts/kernel-headers-vex.sh \
|
|
"https://github.com/windmill-labs/windmill/releases/tag/${GITHUB_REF_NAME}#${{ matrix.image }}" \
|
|
scan/full.json > "scan/${{ matrix.image }}.openvex.json"
|
|
trivy image -q --platform linux/amd64 \
|
|
--scanners vuln --vex "/out/${{ matrix.image }}.openvex.json" \
|
|
--format json -o "/out/${{ matrix.image }}.trivy.json" "$IMAGE_REF"
|
|
trivy convert --format table \
|
|
--severity CRITICAL,HIGH -o "/out/${{ matrix.image }}.cves.txt" "/out/${{ matrix.image }}.trivy.json"
|
|
|
|
- name: Attach scan results to the release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
scan/${{ matrix.image }}.openvex.json
|
|
scan/${{ matrix.image }}.trivy.json
|
|
scan/${{ matrix.image }}.cves.txt
|
|
|
|
- uses: sigstore/cosign-installer@v4.1.2
|
|
with:
|
|
cosign-release: "v2.6.5"
|
|
|
|
# Lets `trivy image --vex oci` apply the statements without the release page. `cosign
|
|
# attest` has no --recursive, and a scanner may resolve either the index or the platform
|
|
# manifest, so each digest gets its own attestation.
|
|
- name: Attest VEX
|
|
run: |
|
|
repo="${IMAGE_REF%@*}"
|
|
digests="${{ matrix.digest }} $(docker buildx imagetools inspect --raw "$IMAGE_REF" \
|
|
| jq -r '.manifests[]? | select(.platform.os != "unknown") | .digest')"
|
|
for d in $digests; do
|
|
for attempt in 1 2 3; do
|
|
cosign attest --yes --type openvex \
|
|
--predicate "scan/${{ matrix.image }}.openvex.json" "$repo@$d" && continue 2
|
|
echo "::warning::cosign attest of $d failed (attempt $attempt/3)"
|
|
[ "$attempt" -lt 3 ] && sleep $((attempt * 30))
|
|
done
|
|
exit 1
|
|
done
|
|
|
|
- name: Docker Scout report
|
|
uses: docker/scout-action@v1
|
|
with:
|
|
command: cves
|
|
only-severities: critical,high
|
|
image: ${{ env.IMAGE_REF }}
|
|
sarif-file: scout.sarif.json
|
|
summary: true
|
|
dockerhub-user: windmilllabs
|
|
dockerhub-password: ${{ secrets.DOCKER_PAT }}
|
|
|
|
# Filed under main: the Security tab only reads the default branch, so tag-only uploads
|
|
# never close their alerts. `sha` is the release commit, which is on main.
|
|
- name: Upload SARIF result
|
|
uses: github/codeql-action/upload-sarif@v4
|
|
with:
|
|
sarif_file: scout.sarif.json
|
|
category: docker-scout-${{ matrix.image }}
|
|
ref: refs/heads/main
|
|
sha: ${{ github.sha }}
|
|
|
|
# Gates on the VEX-filtered report attached to the release, so the gate and the published
|
|
# results agree on what is not_affected.
|
|
- name: Fail on fixable critical CVEs
|
|
run: |
|
|
fixable="$(jq -r '.Results[]? | (.Vulnerabilities // [])[]
|
|
| select(.Severity == "CRITICAL" and .Status == "fixed")
|
|
| "\(.VulnerabilityID) \(.PkgName) \(.InstalledVersion) -> \(.FixedVersion)"' \
|
|
"scan/${{ matrix.image }}.trivy.json" | sort -u)"
|
|
if [ -n "$fixable" ]; then
|
|
echo "$fixable" | sed 's/^/::error::fixable critical CVE: /'
|
|
exit 1
|
|
fi
|
|
|
|
# docker_scout_ee:
|
|
# runs-on: ubicloud
|
|
# needs: [tag_latest_ee]
|
|
# steps:
|
|
# - name: Docker Scout
|
|
# id: docker-scout
|
|
# uses: docker/scout-action@v1
|
|
# with:
|
|
# dockerhub-
|
|
# command: cves,recommendations,compare
|
|
# to-latest: true
|
|
# ignore-base: true
|
|
# ignore-unchanged: true
|
|
# only-fixed: true
|
|
|
|
publish_ecr_s3:
|
|
needs: [build_ee]
|
|
runs-on: ubicloud-standard-2-arm
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: shrink/actions-docker-extract@v3
|
|
id: extract
|
|
with:
|
|
image: |-
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }}
|
|
path: "/static_frontend/."
|
|
|
|
- uses: reggionick/s3-deploy@v4
|
|
with:
|
|
folder: ${{ steps.extract.outputs.destination }}
|
|
bucket: windmill-frontend
|
|
bucket-region: us-east-1
|
|
|
|
build_ee_cuda:
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
needs: [build_ee]
|
|
runs-on: ubicloud
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-ee-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-cuda
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push publicly ee
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
file: "./docker/DockerfileCuda"
|
|
build-args: |
|
|
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }}
|
|
tags: |
|
|
${{ steps.meta-ee-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-ee-public.outputs.labels }}
|
|
org.opencontainers.image.licenses=Windmill-Enterprise-License
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-cuda
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
build_slim:
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
needs: [build]
|
|
runs-on: ubicloud
|
|
outputs:
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-ee-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-slim
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push publicly ee
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
file: "./docker/DockerfileSlim"
|
|
build-args: |
|
|
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }}
|
|
tags: |
|
|
${{ steps.meta-ee-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-ee-public.outputs.labels }}
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-slim
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
build_ee_slim:
|
|
needs: [build_ee]
|
|
runs-on: ubicloud
|
|
if: (github.event_name != 'pull_request') && ((github.event_name != 'workflow_dispatch') || (github.event.inputs.ee || github.event.inputs.slim))
|
|
outputs:
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-ee-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-slim
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push publicly ee
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
file: "./docker/DockerfileSlimEe"
|
|
build-args: |
|
|
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }}
|
|
tags: |
|
|
${{ steps.meta-ee-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-ee-public.outputs.labels }}
|
|
org.opencontainers.image.licenses=Windmill-Enterprise-License
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-slim
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
build_full:
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
needs: [build]
|
|
runs-on: ubicloud
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-full
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push publicly
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
file: "./docker/DockerfileFull"
|
|
build-args: |
|
|
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.digest }}
|
|
tags: |
|
|
${{ steps.meta-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-public.outputs.labels }}
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-full
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|
|
|
|
build_ee_full:
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
needs: [build_ee]
|
|
runs-on: ubicloud
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# - name: Set up Docker Buildx
|
|
# uses: docker/setup-buildx-action@v2
|
|
|
|
- uses: depot/setup-action@v1
|
|
|
|
- name: Docker meta
|
|
id: meta-ee-public
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-full
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push publicly ee
|
|
id: docker_build
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
sbom: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' }}
|
|
file: "./docker/DockerfileFullEe"
|
|
build-args: |
|
|
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee@${{ needs.build_ee.outputs.digest }}
|
|
tags: |
|
|
${{ steps.meta-ee-public.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta-ee-public.outputs.labels }}
|
|
org.opencontainers.image.licenses=Windmill-Enterprise-License
|
|
|
|
- name: Sign and attest release image
|
|
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
|
|
uses: ./.github/actions/sign-attest-image
|
|
with:
|
|
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee-full
|
|
digest: ${{ steps.docker_build.outputs.digest }}
|