Skip to content

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Mar 25, 2021
2 parents ce4d00f + 4b994db commit fec5468
Show file tree
Hide file tree
Showing 79 changed files with 4,504 additions and 381 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ jobs:
- name: integration-rust-sdk
run: ci_run zk test i rust-sdk

- name: integration-withdrawal-helpers
run: ci_run zk test i withdrawal-helpers

- name: Show logs
run: |
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/deploy-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Deploy Apps

on:
deployment:

env:
DEPLOY_APPS: -l name=server -l name=prover -l name=explorer

jobs:
pre:
runs-on: [k8s, stage]
steps:
- uses: actions/checkout@v2
-
id: print
run: echo "::set-output name=shortRev::$(git rev-parse --short HEAD)"
-
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.ref }}
regex: '^refs\/tags\/(v[0-9]+\.[0-9]+\.[0-9](-?.*)?)$'
-
name: Map runtime environment data
uses: kanga333/[email protected]
with:
key: "${{ github.event.deployment.environment }}"
map: |
{
"mainnet": {
"KUBECONF": "KUBECONF_MAINNET",
"HFENV": "zksync-prod",
"RUNNER": "mainnet"
},
"rinkeby": {
"KUBECONF": "KUBECONF_TESTNET",
"HFENV": "zksync-${{ github.event.deployment.environment }}",
"RUNNER": "testnet"
},
"ropsten": {
"KUBECONF": "KUBECONF_TESTNET",
"HFENV": "zksync-${{ github.event.deployment.environment }}",
"RUNNER": "testnet"
},
".*": {
"KUBECONF": "KUBECONF_STAGE",
"HFENV": "zksync-${{ github.event.deployment.environment }}",
"RUNNER": "stage"
}
}
-
name: Cancel deployment (deployment tag missmatch)
if: ${{ steps.regex-match.outputs.group1 == '' }}
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: failure
deployment_id: ${{ github.event.deployment.id }}

outputs:
shortRev: ${{ steps.print.outputs.shortRev }}
kubeConf: ${{ env.KUBECONF }}
hfEnv: ${{ env.HFENV }}
runner: ${{ env.RUNNER }}
isTag: ${{ steps.regex-match.outputs.group1 != '' }}

deploy:
name: Deploy Apps
runs-on: [k8s, deployer, "${{ needs.pre.outputs.runner }}"]
needs: pre
if: ${{ needs.pre.outputs.isTag == 'true' }}

container:
image: dysnix/kubectl:v1.16-gcloud

env:
IMAGE_TAG: ${{ needs.pre.outputs.shortRev }}
KUBECONF: ${{ secrets[needs.pre.outputs.kubeConf] }}
HFENV: ${{ needs.pre.outputs.hfEnv }}

steps:
-
name: Create ~/.kube/config
run: mkdir -p ~/.kube && echo "$KUBECONF" | base64 -d > ~/.kube/config
-
name: Clone helm-infra
uses: actions/checkout@v2
with:
repository: matter-labs/helm-infra
path: helm-infra
ref: master
token: ${{ secrets.GH_TOKEN }}
-
name: Deploy apps
working-directory: helm-infra
run: |
## copy helm plugins over (from dysnix/kubectl, don't forget)!!!
cp -r /dysnix/kubectl/.local /dysnix/kubectl/.cache ~
UPDATE_REPOS=y helmfile -e $HFENV repos
helmfile -e $HFENV $DEPLOY_APPS apply --args "timeout 180s"
-
name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: success
deployment_id: ${{ github.event.deployment.id }}
-
name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: failure
deployment_id: ${{ github.event.deployment.id }}
113 changes: 113 additions & 0 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Deploy Stage

on:
push:
branches:
- dev

env:
DEPLOY_APPS: -l name=server -l name=prover -l name=explorer

jobs:
pre:
runs-on: [k8s, stage]
steps:
- uses: actions/checkout@v2
- id: print
run: echo "::set-output name=shortRev::$(git rev-parse --short HEAD)"

outputs:
shortRev: ${{ steps.print.outputs.shortRev }}

build-images:
name: Build and Push Docker Images
runs-on: [self-hosted, MAIN]
needs: pre

## Required services
services:
postgres:
image: postgres:10.4
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo CI=1 >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: init
run: |
cargo sqlx --version || cargo install --version=0.2.0 sqlx-cli
zk
zk run yarn
cp etc/tokens/{test,localhost}.json
zk run verify-keys unpack
zk db basic-setup
- name: update-images
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
zk docker push rust
zk docker push nginx
deploy:
name: Deploy to the Stage enviroment
runs-on: [k8s, deployer, stage]
needs: [pre, build-images]

container:
image: dysnix/kubectl:v1.16-gcloud

env:
KUBECONF: ${{ secrets.KUBECONF_STAGE }}
IMAGE_TAG: ${{ needs.pre.outputs.shortRev }}
HFENV: zksync-stage

steps:
-
name: Create ~/.kube/config
run: mkdir -p ~/.kube && echo "$KUBECONF" | base64 -d > ~/.kube/config
-
name: Clone helm-infra
uses: actions/checkout@v2
with:
repository: matter-labs/helm-infra
path: helm-infra
ref: master
token: ${{ secrets.GH_TOKEN }}
-
uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment: stage
# TODO fix stage and resume deploy to stage
# -
# name: Deploy apps
# working-directory: helm-infra
# run: |
# copy helm plugins over (from dysnix/kubectl, don't forget)!!!
# cp -r /dysnix/kubectl/.local /dysnix/kubectl/.cache ~
#
# UPDATE_REPOS=y helmfile -e $HFENV repos
# helmfile -e $HFENV $DEPLOY_APPS apply --args "timeout 180s"
-
name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: success
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
-
name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: ${{ github.token }}
state: failure
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
53 changes: 0 additions & 53 deletions .github/workflows/promote-stage.yml

This file was deleted.

28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ members = [
"core/bin/zksync_core",
"core/bin/zksync_eth_sender",
"core/bin/zksync_witness_generator",
"core/bin/zksync_forced_exit_requests",

# Libraries
"core/lib/circuit",
Expand Down
2 changes: 2 additions & 0 deletions changelog/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ All notable changes to the core components will be documented in this file.

- Added a stressing dev fee ticker scenario to the loadtest.
- Added a `--sloppy` mode to the `dev-fee-ticker-server` to simulate bad networks with the random delays and fails.
- Added `forced_exit_requests` functionality, which allows users to pay for ForcedExits from L1. Note that a few env
variables were added that control the behaviour of the tool.
- Possibility to use CREATE2 ChangePubKey and Transfer in a single batch.

### Fixed
Expand Down
Loading

0 comments on commit fec5468

Please sign in to comment.