Files
floci/.github/workflows/release.yml
T
Hector Ventura 892927ceb5 feat(verifiedpermissions): run Cedar from the floci-sidecar-cedar image (#3799)
* feat(verifiedpermissions): run Cedar from the floci-sidecar-cedar image

The Cedar sidecar now comes from floci-io/floci-sidecars as
floci/floci-sidecar-cedar, pinned to an exact version because a cached
:latest is never re-pulled. CedarSidecarManager reads the contract JSON
that the image's /health returns: a sidecar speaking another contract
major is refused immediately with a message naming the image and the
FLOCI_SERVICES_VERIFIEDPERMISSIONS_CEDAR_IMAGE and _CEDAR_URL settings
to change, instead of polling for thirty seconds or failing later on a
request. A pre-configured URL is probed the same way. A sidecar whose
health body is not JSON predates the contract and is accepted with a
one-time warning.

* test(verifiedpermissions): exercise the published Cedar image

VerifiedPermissionsIntegrationTest no longer boots the in-tree sidecar in
process: CedarSidecarManager starts the pinned image through Docker, the
same path production takes, under a vp-test resource namespace so the
manager's remove-before-start cannot kill a developer's live sidecar. It
is skipped without Docker, and locally when the image is not present; in
CI a missing image fails. VerifiedPermissionsServiceTest keeps its
reject-before-persist coverage against a fake sidecar answering 400, and
CedarSidecarClientTest pins the request shapes and the 200/400/other
mapping Floci owns.

* chore(build): drop the in-tree Cedar sidecar

sidecars/cedar now lives in floci-io/floci-sidecars as cedar/ with its
history. The build-helper test source root and the test-scoped cedar-java
dependency existed only to boot that server inside the test JVM; the
tests now run against the published image, so both go, along with the
.dockerignore allowlist entry that let the sidecar Dockerfile see its
sources from the repository root context.

* ci: stop publishing the Cedar sidecar from this repository

The release, nightly and reusable image workflows no longer build a
Cedar image or record it in the provenance manifest; the sidecar is
released from floci-io/floci-sidecars on its own cadence. The
compatibility workflow no longer builds and starts the sidecar by hand:
Floci pulls the pinned image itself over the mounted socket onto
compat-net, exactly as it already does for floci-duck. The unit-test
shards prefetch the pinned image, reading the tag from application.yml
so the two cannot drift.

The floci/floci:*-cedar tags stop at this change; whether the next
release cut retags the sidecar image under the old name for a
deprecation window is a release decision, not a workflow default.

* docs(verifiedpermissions): document the external Cedar sidecar image

The Verified Permissions page names floci/floci-sidecar-cedar, why it is
pinned to an exact version, how to pre-pull it, where its API and the
sidecar contract are documented, and what a contract mismatch looks
like. The README's Docker integration table gains the Verified
Permissions row it never had. AGENTS.md records the sidecar rule: own
repository, no tag suffix on the Floci image, no :latest default, the
sidecar releases first, and how a sidecar is tested from here.
2026-09-17 09:16:20 -04:00

292 lines
12 KiB
YAML

name: Release
# Triggered when a version tag (e.g. 1.2.3) is pushed.
# Builds native (amd64 + arm64) Docker images and pushes them to Docker Hub
# and Amazon ECR Public.
#
# Published tags:
# Native: floci/floci:1.2.3 floci/floci:latest
# public.ecr.aws/floci/floci:1.2.3 public.ecr.aws/floci/floci:latest
# Baseline: floci/floci:1.2.3-baseline floci/floci:latest-baseline
# public.ecr.aws/floci/floci:1.2.3-baseline public.ecr.aws/floci/floci:latest-baseline
# Compat: floci/floci:1.2.3-compat floci/floci:latest-compat
# public.ecr.aws/floci/floci:1.2.3-compat public.ecr.aws/floci/floci:latest-compat
#
# Required secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN, AWS_ROLE_ARN
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: read
id-token: write
# Per-tag concurrency. Back-to-back tag pushes (e.g. 1.5.3 and 1.6.0 landing
# minutes apart) resolve to different ${{ github.ref }} values, so they run
# in parallel rather than cancelling each other. Re-runs of the same tag
# supersede in-flight builds of that tag.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Build native artifact — amd64 ────────────────────────────────────────
build-native-amd64:
name: Build native artifact (amd64)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: graalvm/setup-graalvm@5298d94fb55a4f185c602eeac5de1b553882abe2 # v1
with:
java-version: '25'
distribution: 'mandrel'
cache: maven
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build native executable
# Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated
# REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the
# single call site of a very large method; inlined, the method outgrows the aarch64
# conditional-branch range and the build dies with BranchTargetOutOfBoundsException.
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-march=x86-64-v2,-H:-AOTSingleCallsiteInline"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: native-amd64
path: |
target/*-runner
target/*.properties
target/*.so
if-no-files-found: warn
retention-days: 1
# ── Build native artifact — arm64 ────────────────────────────────────────
build-native-arm64:
name: Build native artifact (arm64)
runs-on: ubuntu-24.04-arm
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: graalvm/setup-graalvm@5298d94fb55a4f185c602eeac5de1b553882abe2 # v1
with:
java-version: '25'
distribution: 'mandrel'
cache: maven
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build native executable
# Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated
# REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the
# single call site of a very large method; inlined, the method outgrows the aarch64
# conditional-branch range and the build dies with BranchTargetOutOfBoundsException.
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-H:-AOTSingleCallsiteInline"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: native-arm64
path: |
target/*-runner
target/*.properties
target/*.so
if-no-files-found: warn
retention-days: 1
# ── Build baseline native artifact — arm64 only ─────────────────────────
build-native-arm64-baseline:
name: Build baseline native artifact (arm64)
runs-on: ubuntu-24.04-arm
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: graalvm/setup-graalvm@5298d94fb55a4f185c602eeac5de1b553882abe2 # v1
with:
java-version: '25'
distribution: 'mandrel'
cache: maven
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build ARMv8.0 baseline native executable
# Keep the normal arm64 artifact optimized as before. This additional release-only build
# targets ARMv8.0 explicitly so older cores such as Raspberry Pi 4's Cortex-A72 do not
# inherit optional AArch64 features (notably LSE) from the GitHub-hosted build runner.
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-march=armv8-a,-H:-AOTSingleCallsiteInline"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: native-arm64-baseline
path: |
target/*-runner
target/*.properties
target/*.so
if-no-files-found: warn
retention-days: 1
# ── Push native + compat Docker images ───────────────────────────────────
push-native:
name: Push native and compat Docker images
needs: [build-native-amd64, build-native-arm64, build-native-arm64-baseline]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
- name: Set created timestamp
id: created
run: echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
- name: Set SOURCE_DATE_EPOCH
id: source_date
run: echo "epoch=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: native-amd64
path: native/amd64/
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: native-arm64
path: native/arm64/
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: native-arm64-baseline
path: native-baseline/arm64/
- name: Stage binaries under a fixed name
run: |
for arch in amd64 arm64; do
mv native/$arch/*-runner native/$arch/application
done
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Login to Amazon ECR Public
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
with:
registry-type: public
- name: Build and push native multi-arch image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
env:
SOURCE_DATE_EPOCH: ${{ steps.source_date.outputs.epoch }}
with:
context: .
file: docker/Dockerfile.native-package
platforms: linux/amd64,linux/arm64
push: true
provenance: mode=max
sbom: true
tags: |
floci/floci:${{ steps.version.outputs.version }}
floci/floci:latest
public.ecr.aws/floci/floci:${{ steps.version.outputs.version }}
public.ecr.aws/floci/floci:latest
build-args: |
VERSION=${{ steps.version.outputs.version }}
labels: |
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.created.outputs.created }}
version=${{ steps.version.outputs.version }}
build-date=${{ steps.created.outputs.created }}
vcs-ref=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Ordering matters: this step wipes native/ and replaces it with the arm64-only
# baseline binary. It is safe only because it runs AFTER the multi-arch image
# above has been pushed, and nothing that follows reads native/ from the build
# context: the compat image pulls its base (BASE_IMAGE) from the registry.
# Moving this step above
# the multi-arch push would silently publish `latest` from the baseline binary.
- name: Stage ARMv8.0 baseline artifact under the native package path
run: |
rm -rf native/amd64 native/arm64
mkdir -p native/arm64
cp -a native-baseline/arm64/. native/arm64/
mv native/arm64/*-runner native/arm64/application
- name: Build and push ARMv8.0 baseline image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
env:
SOURCE_DATE_EPOCH: ${{ steps.source_date.outputs.epoch }}
with:
context: .
file: docker/Dockerfile.native-package
platforms: linux/arm64
push: true
provenance: mode=max
sbom: true
tags: |
floci/floci:${{ steps.version.outputs.version }}-baseline
floci/floci:latest-baseline
public.ecr.aws/floci/floci:${{ steps.version.outputs.version }}-baseline
public.ecr.aws/floci/floci:latest-baseline
build-args: |
VERSION=${{ steps.version.outputs.version }}
labels: |
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.created.outputs.created }}
version=${{ steps.version.outputs.version }}
build-date=${{ steps.created.outputs.created }}
vcs-ref=${{ github.sha }}
cache-from: type=gha,scope=floci-arm64-baseline
cache-to: type=gha,scope=floci-arm64-baseline,mode=max
- name: Build and push compat multi-arch image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
env:
SOURCE_DATE_EPOCH: ${{ steps.source_date.outputs.epoch }}
with:
context: .
file: docker/Dockerfile.compat
platforms: linux/amd64,linux/arm64
push: true
provenance: mode=max
sbom: true
tags: |
floci/floci:${{ steps.version.outputs.version }}-compat
floci/floci:latest-compat
public.ecr.aws/floci/floci:${{ steps.version.outputs.version }}-compat
public.ecr.aws/floci/floci:latest-compat
build-args: |
VERSION=${{ steps.version.outputs.version }}
labels: |
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.created.outputs.created }}
version=${{ steps.version.outputs.version }}
build-date=${{ steps.created.outputs.created }}
vcs-ref=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max