Skip to content

Commit

Permalink
Only copying the build tar file rather than the json layer files
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <matt.peterson@swirldslabs.com>
  • Loading branch information
mattp-swirldslabs committed Jan 6, 2025
1 parent a924ffd commit 0002934
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/zxc-verify-docker-build-determinism.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
with:
egress-policy: audit

- name: Standardize Git Line Endings
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -174,9 +179,9 @@ jobs:
# cp -Rvf "${{ github.workspace }}/server/build/libs" "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/data/"
# echo "::endgroup::"

# - name: Write Artifact Version Descriptor
# run: |
# printf "VERSION=%s\nCOMMIT=%s\nDATE=%s" "$(./gradlew -q showVersion)" "$(git log -1 --format='%H' | cut -c1-8)" "$(date -u)" | tee "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/VERSION"
- name: Write Artifact Version Descriptor
run: |
printf "VERSION=%s\nCOMMIT=%s\nDATE=%s" "$(./gradlew -q showVersion)" "$(git log -1 --format='%H' | cut -c1-8)" "$(date -u)" | tee "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/sdk/VERSION"
- name: Extract version
id: extract_version
Expand Down Expand Up @@ -315,26 +320,30 @@ jobs:
env:
CLOUDSDK_PYTHON: ${{ format('{0}{1}', env.pythonLocation, runner.os == 'Windows' && '\python.exe' || '/bin/python3') }}
run: |
STARTING_DIR=$(pwd)
echo "Starting directory: ${STARTING_DIR}"
echo "Making: ${{ env.DOCKER_MANIFEST_PATH }}"
mkdir -p "${{ env.DOCKER_MANIFEST_PATH }}"
cd "${{ env.DOCKER_MANIFEST_PATH }}"
echo "Copying: ${{ needs.generate-baseline.outputs.file }}"
echo "Downloading: ${{ needs.generate-baseline.outputs.file }}"
gsutil cp "${{ needs.generate-baseline.outputs.file }}" .
echo "Extracting: ${{ needs.generate-baseline.outputs.name }}"
tar -xzf "${{ needs.generate-baseline.outputs.name }}"
pwd
ls -la
echo "listing sub dir"
echo "listing sub dir ./server/build/distributions/"
ls -la ./server/build/distributions/
cp *.json "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/"
echo "Creating build directory: ${STARTING_DIR}/server/build/distributions"
# cp *.json "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/"
cd ./server/build/distributions
cp *.tar "${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/"
cp *.tar "${STARTING_DIR}/server/build/distributions/"

echo "Copied files to: ${{ github.workspace }}/${{ env.DOCKER_CONTEXT_PATH }}/"
echo "Copied files to: ${STARTING_DIR}/server/build/distributions"

- name: Determine Home Directory
id: home
Expand All @@ -348,9 +357,6 @@ jobs:
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"]

- name: Setup Local Docker Registry
run: docker run -d -p 5000:5000 --restart=always --name registry registry:latest
Expand Down Expand Up @@ -388,7 +394,7 @@ jobs:
env:
SOURCE_DATE_EPOCH: ${{ needs.generate-baseline.outputs.source-date }}
with:
push: true
push: false
no-cache: true
platforms: linux/amd64,linux/arm64
build-args: |
Expand All @@ -408,7 +414,7 @@ jobs:

- name: Validate Layers (linux/amd64)
run: |
if ! diff -u "${DOCKER_MANIFEST_PATH}/linux-amd64.layers.json" "${{ steps.regen-manifest.outputs.path }}/linux-amd64.layers.json" >/dev/null 2>&1; then
if ! diff -u "${{ env.DOCKER_MANIFEST_PATH }}/linux-amd64.layers.json" "${{ steps.regen-manifest.outputs.path }}/linux-amd64.layers.json" >/dev/null 2>&1; then
echo "::group::Debug Bucket Group"
BASELINE_NAME="${{ steps.commit.outputs.sha }}.tar.gz"
BASELINE_PATH="gs://hedera-ci-ephemeral-artifacts/${{ github.repository }}/docker/baselines"
Expand All @@ -419,7 +425,7 @@ jobs:
echo "::endgroup::"
echo "::group::Layer Differences"
diff -u "${DOCKER_MANIFEST_PATH}/linux-amd64.layers.json" "${{ steps.regen-manifest.outputs.path }}/linux-amd64.layers.json"
diff -u "${{ env.DOCKER_MANIFEST_PATH }}/linux-amd64.layers.json" "${{ steps.regen-manifest.outputs.path }}/linux-amd64.layers.json"
echo "::endgroup::"
exit 1
Expand Down

0 comments on commit 0002934

Please sign in to comment.