Skip to content
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

feat: Deterministic Gradle build #425

Merged
merged 29 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
423afc3
fix: gradle and docker determinism working
mattp-swirldslabs Jan 6, 2025
cb33f74
fix: trimmed out debugging info
mattp-swirldslabs Jan 6, 2025
e39cdbb
Removed GH Container Registry directives
mattp-swirldslabs Jan 6, 2025
a88c4b6
Enabling other supported linux versions
mattp-swirldslabs Jan 6, 2025
10338a1
Removed other linux version as they are not supported in hedera-servi…
mattp-swirldslabs Jan 6, 2025
d71e491
fix: updated to use java 21.0.5+11
mattp-swirldslabs Jan 6, 2025
2b4028a
Fixed missing ESUM
mattp-swirldslabs Jan 6, 2025
bd2283d
Use the dynamic tag
mattp-swirldslabs Jan 7, 2025
2a40ac7
fix: fixed the sha abbrev image ref
mattp-swirldslabs Jan 8, 2025
732c077
fix: changed docker version parameter to use sha
mattp-swirldslabs Jan 8, 2025
80123a7
fix: restored VERSION and changed SHA param
mattp-swirldslabs Jan 8, 2025
5ee0dfe
moved useradd up in the layers
mattp-swirldslabs Jan 8, 2025
da26594
Removed env vars during useradd
mattp-swirldslabs Jan 8, 2025
ae7b9cd
moved the useradd above the workaround
mattp-swirldslabs Jan 8, 2025
9db6525
removed backslash char
mattp-swirldslabs Jan 8, 2025
5e38522
moved some operations up
mattp-swirldslabs Jan 8, 2025
7ed4867
fixed /app ownership
mattp-swirldslabs Jan 8, 2025
a3fdbcb
fix: added buildx caching support
mattp-swirldslabs Jan 8, 2025
cfcf03b
added caching support to the main publish buildx
mattp-swirldslabs Jan 8, 2025
164bcf5
removed debugging code
mattp-swirldslabs Jan 8, 2025
96adbd1
Added workflow_dispatch for both zxc files
mattp-swirldslabs Jan 8, 2025
c9e1ba0
Merge branch 'main' into 00408-deterministic-gradle-changes-3
jjohannes Jan 10, 2025
4bc480d
ci: fix new extract version steps
jjohannes Jan 10, 2025
8b03b5e
ci: checkout fix for spotless in 'release-push-image.yaml'
jjohannes Jan 10, 2025
ee0d9ef
fix: pushing to a local registry
mattp-swirldslabs Jan 10, 2025
a311d63
fix: added a workflow dependency
mattp-swirldslabs Jan 10, 2025
7fd7756
fix: added the determinism workflow checks for PRs
mattp-swirldslabs Jan 10, 2025
80a4cac
fix: added id-token perm
mattp-swirldslabs Jan 10, 2025
662aeb4
fix: added packages write
mattp-swirldslabs Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Run Acceptance Tests
id: acceptance-tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Cache Gradle packages
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
Expand Down
43 changes: 27 additions & 16 deletions .github/workflows/release-push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ defaults:
shell: bash

permissions:
id-token: write
contents: read
packages: write

Expand All @@ -29,21 +30,21 @@ env:
REGISTRY: ghcr.io

jobs:
# check-gradle:
# name: Gradle
# uses: ./.github/workflows/zxc-verify-gradle-build-determinism.yaml
# with:
# ref: ${{ github.event.inputs.ref || '' }}
# java-distribution: ${{ inputs.java-distribution || 'temurin' }}
# java-version: ${{ inputs.java-version || '21.0.4' }}

# check-docker:
# name: Docker
# uses: ./.github/workflows/zxc-verify-docker-build-determinism.yaml
# with:
# ref: ${{ github.event.inputs.ref || '' }}
# java-distribution: ${{ inputs.java-distribution || 'temurin' }}
# java-version: ${{ inputs.java-version || '21.0.4' }}
check-gradle:
name: Gradle
uses: ./.github/workflows/zxc-verify-gradle-build-determinism.yaml
with:
ref: ${{ github.event.inputs.ref || '' }}
java-distribution: ${{ inputs.java-distribution || 'temurin' }}
java-version: ${{ inputs.java-version || '21.0.5' }}

check-docker:
name: Docker
uses: ./.github/workflows/zxc-verify-docker-build-determinism.yaml
with:
ref: ${{ github.event.inputs.ref || '' }}
java-distribution: ${{ inputs.java-distribution || 'temurin' }}
java-version: ${{ inputs.java-version || '21.0.5' }}

publish:
runs-on: block-node-linux-medium
Expand All @@ -61,7 +62,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Build
run: ./gradlew clean build
Expand All @@ -80,13 +81,22 @@ jobs:
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
with:
driver-opts: network=host
buildkitd-config-inline: |
[registry."docker.io"]
mirrors = ["https://hub.mirror.docker.lat.ope.eng.hashgraph.io"]

- name: Extract version
id: extract_version
run: |
VERSION=$(cat version.txt)
echo "VERSION=${VERSION}" >> $GITHUB_ENV

- name: Extract Source Date Epoch
id: extract_source_date_epoch
run: |
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
echo "SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}" >> $GITHUB_ENV

- name: Server - Build and push image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
Expand All @@ -99,6 +109,7 @@ jobs:
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.VERSION }}
build-args: |
VERSION=${{ env.VERSION }}
SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }}
build-contexts: |
distributions=./server/build/distributions

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: "temurin"
java-version: "21.0.4"
java-version: "21.0.5"

- name: Install grpcurl
run: |
Expand Down
Loading
Loading