Skip to content

Commit

Permalink
Fix building and running docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Nov 9, 2020
1 parent 62acd7f commit d2de409
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
!docker/nginx/nginx.conf
!bin/
!core/
!yarn.lock
!package.json
!Cargo.lock
!Cargo.toml
!contracts/build
!infrastructure/explorer/index.html
!infrastructure/explorer/dist
!infrastructure/fee-seller
!infrastructure/tok_cli
!infrastructure/zk
!sdk/zksync-rs
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: zk
run: zk

- name: check-docker-images
run: zk docker build rust

- name: lints
run: |
zk db setup # So database will be created for compilation.
Expand Down
2 changes: 0 additions & 2 deletions docker/exit-tool/exit-tool-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

USAGE="exit_tool_entry.sh init|restart|run|continue network account_id token web3_url"

. .setup_env

cd $ZKSYNC_HOME

if [ -z $ZKSYNC_ENV ];
Expand Down
8 changes: 5 additions & 3 deletions docker/prover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo build --release

FROM debian:buster-slim
RUN apt-get update && apt-get install -y axel ca-certificates && rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get install -y axel ca-certificates nodejs npm \
&& npm install -g yarn && rm -rf /var/lib/apt/lists/*
# Docs of env variables used for this image
# to test this locally just run
# docker build -t tmp_prover -f =(f envsubst < ./docker/prover/Dockerfile) .; docker run --rm tmp_prover:latest
Expand All @@ -35,8 +37,8 @@ COPY --from=builder /usr/src/zksync/target/release/plonk_step_by_step_prover /bi
COPY --from=builder /usr/src/zksync/target/release/dummy_prover /bin/
COPY docker/prover/prover-entry.sh /bin/
COPY keys/packed /keys/packed
COPY contracts/build/ /contracts/build/
COPY infrastructure/zk/ infrastructure/zk/
COPY contracts/build /contracts/build
COPY infrastructure/zk /infrastructure/zk
COPY bin/zk /bin/

CMD ["prover-entry.sh"]
3 changes: 2 additions & 1 deletion docker/prover/prover-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function get_required_plonk_setup_powers() {
# we download only keys used in node (defined by $BLOCK_CHUNK_SIZES)
REQUIRED_SETUP_POWS=`get_required_plonk_setup_powers`
# install zk
zk
echo installing zk
cd /infrastructure/zk && yarn install && yarn build

if [ "$PROVER_DOWNLOAD_SETUP" == "false" ]; then
echo Downloading setup powers $REQUIRED_SETUP_POWS
Expand Down
4 changes: 1 addition & 3 deletions infrastructure/zk/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export async function build() {
async function prepareTestContracts() {
const inDir = 'contracts/contracts';
const outDir = 'contracts/dev-contracts/generated';
if (fs.existsSync(outDir)) {
fs.rmdirSync(outDir, { recursive: true });
}
fs.rmSync(outDir, { recursive: true, force: true });
fs.mkdirSync(outDir, { recursive: true });

await Promise.all([
Expand Down

0 comments on commit d2de409

Please sign in to comment.