Skip to content

Commit

Permalink
ci: fix relayer deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Apr 2, 2024
1 parent df61302 commit ff2e971
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,12 @@ if solana or pythnet:

docker_build(
ref = "eth-node",
context = "./ethereum",
context = ".",
only = ["./ethereum", "./ethereum-relayer"],
dockerfile = "./ethereum/Dockerfile",

# ignore local node_modules (in case they're present)
ignore = ["./node_modules"],
ignore = ["./ethereum/node_modules","./ethereum-relayer/node_modules"],
build_args = {"num_guardians": str(num_guardians), "dev": str(not ci)},

# sync external scripts for incremental development
Expand Down
2 changes: 1 addition & 1 deletion devnet/eth-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
command:
- /bin/sh
- -c
- "npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && npm run deploy-relayers-evm1 && nc -lkn 2000"
- "cd ethereum && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../ethereum-relayer && npm run deploy-relayers-evm1 && nc -lkn 2000"
readinessProbe:
periodSeconds: 1
failureThreshold: 300
Expand Down
2 changes: 1 addition & 1 deletion devnet/eth-devnet2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
command:
- /bin/sh
- -c
- "sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && npm run deploy-relayers-evm2 && nc -lkn 2000"
- "cd ethereum && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../ethereum-relayer && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run deploy-relayers-evm2 && nc -lkn 2000"
readinessProbe:
periodSeconds: 1
failureThreshold: 300
Expand Down
30 changes: 26 additions & 4 deletions ethereum/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ WORKDIR /home/node/app
# Fix git ssh error
RUN git config --global url."https://".insteadOf ssh://

WORKDIR /home/node/app
WORKDIR /home/node/app/ethereum

# Only invalidate the npm install step if package.json changed
COPY --chown=node:node package.json .
COPY --chown=node:node package-lock.json .
COPY --chown=node:node ethereum/package.json .
COPY --chown=node:node ethereum/package-lock.json .
COPY --from=const-export --chown=node:node .env.0x .env


Expand All @@ -49,7 +49,29 @@ RUN rm -rf node_modules && mv node_modules_cache node_modules
ARG dev
ENV DEV=$dev

COPY --chown=node:node . .
COPY --chown=node:node ethereum .
RUN make build

### RELAYER ###

WORKDIR /home/node/app/ethereum-relayer

COPY --chown=node:node ethereum-relayer/package.json .
COPY --chown=node:node ethereum-relayer/package-lock.json .
COPY --from=const-export --chown=node:node .env.0x .env


RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
--mount=type=cache,uid=1000,gid=1000,target=node_modules \
npm ci && \
cp -R node_modules node_modules_cache

RUN rm -rf node_modules && mv node_modules_cache node_modules

ARG dev
ENV DEV=$dev

COPY --chown=node:node ethereum-relayer .
RUN make build

ARG num_guardians
Expand Down

0 comments on commit ff2e971

Please sign in to comment.