Skip to content

Commit

Permalink
Feature/release run docs (0xPolygonHermez#1725)
Browse files Browse the repository at this point in the history
* Update running prod docs, and public testnet config
  • Loading branch information
arnaubennassar authored Mar 6, 2023
1 parent 51275b4 commit 63da3fd
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 462 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/push-docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,3 @@ jobs:
push: true
tags: |
hermeznetwork/zkevm-node:develop
- name: Check changes in zkevmprovermock
id: zkevmprovermock_changes
uses: dorny/paths-filter@v2
with:
filters: |
zkevmprovermock:
- 'tools/zkevmprovermock/**'
- name: Build and push zkevmprovermock
if: steps.zkevmprovermock_changes.outputs.zkevmprovermock == 'true'
id: docker_build_zkevmprovermock
uses: docker/build-push-action@v2
with:
context: .
file: tools/zkevmprovermock/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/zkprover-mock:develop
32 changes: 32 additions & 0 deletions .github/workflows/push-docker-tagged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*' # this action will only run on tags that follow semver

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/zkevm-node:${{ github.ref_name }}
52 changes: 0 additions & 52 deletions .github/workflows/push-docker.yml

This file was deleted.

38 changes: 29 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: goreleaser
name: release

on:
push:
tags:
- 'v*.*.*'
- 'v[0-9]+.[0-9]+.[0-9]+*' # this action will only run on tags that follow semver

jobs:
goreleaser:
releaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -22,13 +22,33 @@ jobs:
- name: Get packr
run: go get -u github.com/gobuffalo/packr/v2/packr2

- name: Prepare
run: git reset --hard

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_RELEASE }}
GITHUB_TOKEN: ${{ secrets.TOKEN_RELEASE }}

- name: Get tag
uses: olegtarasov/[email protected]
id: tagName

- name: Put testnet artifacts into a single zip
run: |
mkdir -p testnet/config/environments/public
mkdir -p testnet/db/scripts
cp config/environments/public/* testnet/config/environments/public
cp docker-compose.yml testnet
cp db/scripts/init_prover_db.sql testnet/db/scripts
mv testnet/config/environments/public/example.env testnet
sed -i -e "s/image: zkevm-node/image: hermeznetwork\/zkevm-node:$GIT_TAG_NAME/g" testnet/docker-compose.yml
zip -r testnet.zip testnet
- name: Publish testnet zip into release
uses: AButler/[email protected]
with:
files: 'testnet.zip'
repo-token: ${{ secrets.TOKEN_RELEASE }}
release-tag: ${{ steps.tagName.outputs.tag }}

6 changes: 6 additions & 0 deletions config/environments/public/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# URL of a JSON RPC for Goerli
ZKEVM_NODE_ETHERMAN_URL = "http://your.L1node.url"
# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_STATEDB_DATA_DIR = "/path/to/persistent/data/stetedb"
# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_POOLDB_DATA_DIR = "/path/to/persistent/data/pooldb"
1 change: 0 additions & 1 deletion config/environments/public/public.genesis.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@
}
]
}

12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ services:
- 8545:8545
- 9091:9091 # needed if metrics enabled
environment:
- ZKEVM_NODE_STATEDB_HOST=zkevm-state-db
- ZKEVM_NODE_POOL_HOST=zkevm-pool-db
- ZKEVM_NODE_RPC_BROADCASTURI=zkevm-broadcast:61090
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_NODE_ETHERMAN_URL}
volumes:
- ./config/environments/public/public.node.config.toml:/app/config.toml
- ./config/environments/public/public.genesis.config.json:/app/genesis.json
Expand All @@ -35,7 +33,7 @@ services:
condition: service_healthy
image: zkevm-node
environment:
- ZKEVM_NODE_STATEDB_HOST=zkevm-state-db
- ZKEVM_NODE_ETHERMAN_URL=${ZKEVM_NODE_ETHERMAN_URL}
volumes:
- ./config/environments/public/public.node.config.toml:/app/config.toml
- ./config/environments/public/public.genesis.config.json:/app/genesis.json
Expand All @@ -62,6 +60,7 @@ services:
- 5432:5432
volumes:
- ./db/scripts/init_prover_db.sql:/docker-entrypoint-initdb.d/init.sql
- ${ZKEVM_NODE_STATEDB_DATA_DIR}:/var/lib/postgresql/data
environment:
- POSTGRES_USER=state_user
- POSTGRES_PASSWORD=state_password
Expand All @@ -84,6 +83,8 @@ services:
memory: 1G
ports:
- 5433:5432
volumes:
- ${ZKEVM_NODE_POOLDB_DATA_DIR}:/var/lib/postgresql/data
environment:
- POSTGRES_USER=pool_user
- POSTGRES_PASSWORD=pool_password
Expand All @@ -93,6 +94,9 @@ services:
zkevm-prover:
container_name: zkevm-prover
image: hermeznetwork/zkevm-prover:798d9e0
depends_on:
zkevm-state-db:
condition: service_healthy
ports:
- 50061:50061 # MT
- 50071:50071 # Executor
Expand Down
Loading

0 comments on commit 63da3fd

Please sign in to comment.