Skip to content

Commit

Permalink
refactoring docker-compose (0xPolygonHermez#1228)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclemos authored Oct 24, 2022
1 parent 4a2e825 commit 491f6c3
Show file tree
Hide file tree
Showing 46 changed files with 946 additions and 614 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- 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
with:
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,30 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

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

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
run: make test-e2e-group-${{ matrix.e2e-group }}
working-directory: test

from-fork-test-e2e:
if:
Expand All @@ -53,19 +64,30 @@ jobs:
uses: actions/checkout@v2
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

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

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
run: CONFIG_MODE="test" make test-e2e-group-${{ matrix.e2e-group }}
run: make test-e2e-group-${{ matrix.e2e-group }}
working-directory: test

# Update check run
- uses: actions/github-script@v5
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test-from-prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,13 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
run: make test-full-non-e2e
working-directory: test
19 changes: 19 additions & 0 deletions .github/workflows/test-full-non-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,29 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

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

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
env:
ZKPROVER_URI: 127.0.0.1
run: make test-full-non-e2e
working-directory: test

from-fork-test-full-non-e2e:
if:
Expand All @@ -53,21 +61,32 @@ jobs:
uses: actions/checkout@v2
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

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

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
env:
ZKPROVER_URI: 127.0.0.1
run: make test-full-non-e2e
working-directory: test

# Update check run
- uses: actions/github-script@v5
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/updatedeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,29 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Go
uses: actions/setup-go@v1
with:
go-version: "1.17.x"
env:
GOARCH: "amd64"

- name: Install Protoc
uses: arduino/setup-protoc@v1

- name: Install protoc-gen-go
run: |
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Update deps
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: make update-external-dependencies

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# CONTAINER FOR BUILDING BINARY
FROM golang:1.17 AS build

ENV CGO_ENABLED=0

# INSTALL DEPENDENCIES
RUN go install github.com/gobuffalo/packr/v2/[email protected]
COPY go.mod go.sum /src/
Expand All @@ -16,6 +14,6 @@ RUN cd /src && make build
# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0
COPY --from=build /src/dist/zkevm-node /app/zkevm-node
COPY --from=build /src/config/config.local.toml /app/config.local.toml
COPY --from=build /src/config/environments/local/local.node.config.toml /app/example.config.toml
EXPOSE 8123
CMD ["/bin/sh", "-c", "/app/zkevm-node run"]
Loading

0 comments on commit 491f6c3

Please sign in to comment.