-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added partial docker verification workflow
Signed-off-by: Matt Peterson <[email protected]>
- Loading branch information
1 parent
03a3807
commit 147179c
Showing
4 changed files
with
94 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ | |
# limitations under the License. | ||
## | ||
name: "ZXC: Verify Docker Build Determinism" | ||
# Here, the ZXC prefix: | ||
# Z - Ensures sort order such that this script appears at the bottom of the UI | ||
# X - Indicates it's not for direct user consumption | ||
# C - Indicates this is a 'workflow_call' based reusable workflow | ||
on: | ||
workflow_call: | ||
inputs: | ||
|
@@ -33,14 +37,6 @@ on: | |
required: false | ||
default: "21.0.4" | ||
|
||
# secrets: | ||
# gradle-cache-username: | ||
# description: "The username used to authenticate with the Gradle Build Cache Node." | ||
# required: true | ||
# gradle-cache-password: | ||
# description: "The password used to authenticate with the Gradle Build Cache Node." | ||
# required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -50,32 +46,99 @@ permissions: | |
contents: read | ||
|
||
env: | ||
# GRADLE_CACHE_USERNAME: ${{ secrets.gradle-cache-username }} | ||
# GRADLE_CACHE_PASSWORD: ${{ secrets.gradle-cache-password }} | ||
DOCKER_MANIFEST_GENERATOR: .github/workflows/support/scripts/generate-docker-artifact-baseline.sh | ||
DOCKER_MANIFEST_PATH: ${{ github.workspace }}/.manifests/docker | ||
DOCKER_REGISTRY: localhost:5000 | ||
DOCKER_IMAGE_NAME: consensus-node | ||
DOCKER_CONTEXT_PATH: hedera-node/infrastructure/docker/containers/production-next/consensus-node | ||
# DOCKER_REGISTRY: localhost:5000 | ||
# DOCKER_IMAGE_NAME: consensus-node | ||
# DOCKER_CONTEXT_PATH: hedera-node/infrastructure/docker/containers/production-next/consensus-node | ||
SKOPEO_VERSION: v1.14.0 | ||
|
||
jobs: | ||
generate-baseline: | ||
name: Generate Baseline | ||
runs-on: block-node-linux-medium | ||
# outputs: | ||
# sha: ${{ steps.commit.outputs.sha }} | ||
# sha-abbrev: ${{ steps.commit.outputs.sha-abbrev }} | ||
# source-date: ${{ steps.commit.outputs.source-date }} | ||
# path: ${{ steps.baseline.outputs.path }} | ||
# file: ${{ steps.baseline.outputs.file }} | ||
# name: ${{ steps.baseline.outputs.name }} | ||
outputs: | ||
sha: ${{ steps.commit.outputs.sha }} | ||
sha-abbrev: ${{ steps.commit.outputs.sha-abbrev }} | ||
source-date: ${{ steps.commit.outputs.source-date }} | ||
path: ${{ steps.baseline.outputs.path }} | ||
file: ${{ steps.baseline.outputs.file }} | ||
name: ${{ steps.baseline.outputs.name }} | ||
|
||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Hello World | ||
run: echo "Testing Docker Build Determinism" | ||
- name: Checkout Code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Authenticate to Google Cloud | ||
id: google-auth | ||
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 | ||
with: | ||
workload_identity_provider: "projects/235822363393/locations/global/workloadIdentityPools/hedera-builds-pool/providers/hedera-builds-gh-actions" | ||
service_account: "[email protected]" | ||
|
||
- name: Setup Google Cloud SDK | ||
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 | ||
|
||
- name: Retrieve Commit Hash | ||
id: commit | ||
run: | | ||
echo "sha=$(git rev-parse HEAD)" >> "${GITHUB_OUTPUT}" | ||
echo "sha-abbrev=$(git rev-parse HEAD | tr -d '[:space:]' | cut -c1-8)" >> "${GITHUB_OUTPUT}" | ||
echo "source-date=$(git log -1 --pretty=%ct)" >> "${GITHUB_OUTPUT}" | ||
- name: Baseline Existence Check | ||
id: baseline | ||
run: | | ||
BASELINE_NAME="${{ steps.commit.outputs.sha }}.tar.gz" | ||
BASELINE_PATH="gs://hedera-ci-ephemeral-artifacts/${{ github.repository }}/docker/baselines" | ||
BASELINE_FILE="${BASELINE_PATH}/${BASELINE_NAME}" | ||
BASELINE_EXISTS="false" | ||
if gsutil ls "${BASELINE_FILE}" >/dev/null 2>&1; then | ||
BASELINE_EXISTS="true" | ||
fi | ||
echo "exists=${BASELINE_EXISTS}" >> "${GITHUB_OUTPUT}" | ||
echo "path=${BASELINE_PATH}" >> "${GITHUB_OUTPUT}" | ||
echo "name=${BASELINE_NAME}" >> "${GITHUB_OUTPUT}" | ||
echo "file=${BASELINE_FILE}" >> "${GITHUB_OUTPUT}" | ||
- name: Setup Java | ||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | ||
if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} | ||
with: | ||
distribution: ${{ inputs.java-distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 | ||
if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} | ||
with: | ||
cache-disabled: true | ||
|
||
- name: Install Skopeo and JQ | ||
if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --yes --no-install-recommends skopeo jq | ||
- name: Setup QEmu Support | ||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | ||
if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} | ||
|
||
- name: Setup Docker Buildx Support | ||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | ||
if: ${{ steps.baseline.outputs.exists == 'false' && !failure() && !cancelled() }} | ||
with: | ||
version: v0.16.2 | ||
driver-opts: network=host | ||
buildkitd-config-inline: | | ||
[registry."docker.io"] | ||
mirrors = ["https://hub.mirror.docker.lat.ope.eng.hashgraph.io"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters