Skip to content

Commit

Permalink
fix: update sonic blaze chain ID (#163)
Browse files Browse the repository at this point in the history
* fix: update sonic blaze chain ID

* fix: move docker cache to gha
  • Loading branch information
danut13 authored Dec 18, 2024
1 parent 829d88f commit 3256eb4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 46 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ jobs:
uses: docker/setup-buildx-action@v3
id: buildx

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-v1.0-service-node-${{ matrix.arch }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-buildx-v1.0-service-node-${{ matrix.arch }}-
- name: Check docker config and disable live reload
run: |
cat /etc/docker/daemon.json
Expand Down Expand Up @@ -106,8 +98,7 @@ jobs:
- name: Build and load
run: |
mkdir export
make docker-build ARGS='--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \
--set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \
make docker-build ARGS='--set "*.cache-from=type=gha" \
--set "*.platform=linux/${{ matrix.arch }}" \
--builder ${{ steps.buildx.outputs.name }} \
--set "app.output=type=tar,dest=export/app.tar" \
Expand All @@ -133,11 +124,6 @@ jobs:
timeout 1 make docker-logs || true
working-directory: ethereum-contracts

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/docker-vulnerabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,10 @@ jobs:
uses: docker/setup-buildx-action@v3
id: buildx

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-trivy-service-node-${{ matrix.arch }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-trivy-service-node-${{ matrix.arch }}-
- name: Build and load
run: |
docker buildx bake \
--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \
--set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \
--set "*.cache-from=type=gha" \
--set "*.platform=linux/${{ matrix.arch }}" \
--builder ${{ steps.buildx.outputs.name }} \
-f docker-compose.yml \
Expand Down Expand Up @@ -98,9 +90,3 @@ jobs:
with:
category: 'service-node-worker-${{ matrix.arch }}'
sarif_file: 'trivy-worker-results.sarif'

- name: Move cache
if: always()
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
tag: development
environment: main
cache_enabled: true

test:
needs: publish-docker
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
required: false
type: string
default: ""
cache_enabled:
description: 'Enable caching'
required: false
type: boolean
default: false
secrets:
DOCKERHUB_USERNAME:
description: 'Docker Hub username'
Expand Down Expand Up @@ -46,14 +51,6 @@ jobs:
uses: docker/setup-buildx-action@v3
id: buildx

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-to-publish-service-node-${{ matrix.arch }}-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-to-publish-service-node-${{ matrix.arch }}-
- uses: actions/download-artifact@v4
with:
merge-multiple: true
Expand Down Expand Up @@ -87,8 +84,8 @@ jobs:
export EXTRA_TAG=$DOCKER_TAG
fi
docker buildx bake \
--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \
--set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \
--set "*.cache-from=type=gha" \
${{ inputs.cache_enabled && '--set "*.cache-to=type=gha,mode=max" \' || '' }}
--set "*.platform=linux/amd64" \
--builder ${{ steps.buildx.outputs.name }} \
--sbom=true \
Expand Down Expand Up @@ -116,8 +113,3 @@ jobs:
env:
DOCKER_TAG: ${{ inputs.tag }}
COSIGN_EXPERIMENTAL: "true"

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
2 changes: 1 addition & 1 deletion service-node-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ blockchains:
- !ENV ${SONIC_FALLBACK_PROVIDER:https://rpc.blaze.soniclabs.com}
average_block_time: !ENV tag:yaml.org,2002:int ${SONIC_AVERAGE_BLOCK_TIME:1}
provider_timeout: !ENV tag:yaml.org,2002:int ${SONIC_PROVIDER_TIMEOUT:100}
chain_id: !ENV tag:yaml.org,2002:int ${SONIC_CHAIN_ID:64165}
chain_id: !ENV tag:yaml.org,2002:int ${SONIC_CHAIN_ID:57054}
hub: !ENV ${SONIC_HUB:<fill me>}
forwarder: !ENV ${SONIC_FORWARDER:<fill me>}
pan_token: !ENV ${SONIC_PAN_TOKEN:<fill me>}
Expand Down

0 comments on commit 3256eb4

Please sign in to comment.