Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins file to build oracle docker image #5

Open
wants to merge 66 commits into
base: bellecour
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3eaaf75
testing dockerfile in bellecour
gfournieriExec Aug 10, 2023
c483290
add jenkins
gfournieriExec Aug 10, 2023
02f7873
update copy contracts build
gfournieriExec Aug 10, 2023
8456812
start with one package.json
gfournieriExec Aug 10, 2023
bf00341
test no workspace
gfournieriExec Aug 10, 2023
0b5eba4
update postinstall
gfournieriExec Aug 10, 2023
92e56e4
add workspace
gfournieriExec Aug 10, 2023
5fc848b
add contract build and commons package
gfournieriExec Aug 10, 2023
70e20fc
no common
gfournieriExec Aug 10, 2023
fc71266
test oracle
gfournieriExec Aug 10, 2023
3017ec6
add insteadOF
gfournieriExec Aug 10, 2023
f1de6b8
test https on git
gfournieriExec Aug 10, 2023
4db9835
nothing ?
gfournieriExec Aug 10, 2023
7e986eb
test empty common
gfournieriExec Aug 10, 2023
b75a306
with commons empty
gfournieriExec Aug 10, 2023
69425e5
upgrade web3-utils version on common
gfournieriExec Aug 10, 2023
2c7d234
update web3 and utils in oracle
gfournieriExec Aug 10, 2023
05703e3
upgrade to 1.6.0
gfournieriExec Aug 10, 2023
aad99ee
new package-lock oracle
gfournieriExec Aug 10, 2023
55addbe
erased package-lock
gfournieriExec Aug 11, 2023
86e5627
no oracle
gfournieriExec Aug 11, 2023
5d4052a
only oracle
gfournieriExec Aug 11, 2023
1ca3468
with package json
gfournieriExec Aug 11, 2023
d3f5b2a
add commons
gfournieriExec Aug 11, 2023
ff776d8
no abi
gfournieriExec Aug 11, 2023
7daba0f
test with yarn add specific libraries
gfournieriExec Aug 11, 2023
3c455f0
erasad all web3 instance and add in docker
gfournieriExec Aug 21, 2023
90899f6
specific version and force ?
gfournieriExec Aug 21, 2023
b8f932f
update ? sha3
gfournieriExec Aug 21, 2023
a1b75ab
install in good folder
gfournieriExec Aug 22, 2023
84a72fc
test node 16
gfournieriExec Aug 22, 2023
6275ff3
test node 14 ?
gfournieriExec Aug 22, 2023
815dded
erased comments
gfournieriExec Aug 22, 2023
53873ef
remove package before upgrade them
gfournieriExec Aug 23, 2023
a4ff0bd
add remove same lvl of yarn
gfournieriExec Aug 23, 2023
9a354fc
update docker compose
gfournieriExec Aug 23, 2023
8703fa2
Merge branch 'feature/bellecour-build-oracle' of https://github.com/i…
gfournieriExec Aug 23, 2023
6b6251b
erased web3 commons
gfournieriExec Aug 23, 2023
63b53a2
update oralce commons
gfournieriExec Aug 23, 2023
f7302a2
test no remove
gfournieriExec Aug 23, 2023
568761b
erase web3 utils oracle
gfournieriExec Aug 23, 2023
cbd3488
test remove without in package.json
gfournieriExec Aug 23, 2023
f2bebe4
add web3 to oracle
gfournieriExec Aug 23, 2023
86cab22
cat package.json
gfournieriExec Aug 23, 2023
2741535
no web3
gfournieriExec Aug 23, 2023
da9da05
add 2 &
gfournieriExec Aug 23, 2023
f4c9ab6
test add back web3-utils
gfournieriExec Aug 24, 2023
afab2fe
test with commons
gfournieriExec Aug 24, 2023
ef980a5
getting previous version
gfournieriExec Aug 24, 2023
bb9984d
add back abi and updated docker compose
gfournieriExec Aug 24, 2023
6613259
get the minimal changes
gfournieriExec Aug 24, 2023
ec30429
erase usless brackets
gfournieriExec Aug 28, 2023
4e85302
update docker image tag in env
gfournieriExec Aug 28, 2023
788b6ae
Update oracle/.env.example
gfournieriExec Aug 28, 2023
57d4728
testing yarn upgrade
gfournieriExec Aug 28, 2023
b205550
Merge branch 'feature/bellecour-build-oracle' of https://github.com/i…
gfournieriExec Aug 28, 2023
44b4402
use workdir instead of cd
gfournieriExec Aug 28, 2023
c90fa4a
update with NOYARNPOSTINSTALL
gfournieriExec Aug 28, 2023
bcfff49
err on yarn add
gfournieriExec Aug 28, 2023
cc33576
update postinstall with import import package.json
gfournieriExec Aug 28, 2023
447ffda
no contracts
gfournieriExec Aug 28, 2023
f3d53e1
remove first workdir
gfournieriExec Aug 28, 2023
38f8050
back to previous version
gfournieriExec Aug 28, 2023
f1ce949
NOYARNPOSTINSTALL
gfournieriExec Aug 28, 2023
9c67eeb
only update yarn install with contracts
gfournieriExec Aug 28, 2023
78675d6
add NOYARNPOSTINSTALL
gfournieriExec Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Library('[email protected]') _

node('docker') {

buildInfo = getBuildInfo()
buildSimpleDocker_v2(
buildInfo: buildInfo,
dockerfileDir: './oracle',
buildContext: '.',
imageprivacy: 'private',
dockerImageRepositoryName : 'oracle'
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing end-of-line :)
Same in (oracle/.env.example)

1 change: 0 additions & 1 deletion commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
"test": "NODE_ENV=test mocha"
},
"dependencies": {
"web3-utils": "1.0.0-beta.30"
}
}
52 changes: 28 additions & 24 deletions oracle/.env.example
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
#BRIDGE_MODE=ERC_TO_ERC
HOME_POLLING_INTERVAL=5000
FOREIGN_POLLING_INTERVAL=1000
ALLOW_HTTP=no
HOME_RPC_URL=https://kovan.infura.io/mew
FOREIGN_RPC_URL=https://kovan.infura.io/mew
HOME_BRIDGE_ADDRESS=0x86b621b839Ff86Bb59fA57015b02318f9a870d80
FOREIGN_BRIDGE_ADDRESS=0x8dDCa2eB86D22FcB93342753515986e258A90169
ERC20_TOKEN_ADDRESS=0x7AA0A62497B5f4120fbe5D26c95bC612c2b96C14
ORACLE_TAG =
BRIDGE_MODE=
HOME_POLLING_INTERVAL=
FOREIGN_POLLING_INTERVAL=
ALLOW_HTTP=
HOME_RPC_URL=
FOREIGN_RPC_URL=
HOME_BRIDGE_ADDRESS=
FOREIGN_BRIDGE_ADDRESS=
ERC20_TOKEN_ADDRESS=

VALIDATOR_ADDRESS=
VALIDATOR_ADDRESS_PRIVATE_KEY=

HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
HOME_GAS_PRICE_SPEED_TYPE=standard
HOME_GAS_PRICE_FALLBACK=1000000000
HOME_GAS_PRICE_UPDATE_INTERVAL=600000
HOME_GAS_PRICE_FACTOR=1
HOME_GAS_PRICE_ORACLE_URL
gfournieriExec marked this conversation as resolved.
Show resolved Hide resolved
HOME_GAS_PRICE_SPEED_TYPE=
HOME_GAS_PRICE_FALLBACK=
HOME_GAS_PRICE_UPDATE_INTERVAL=
HOME_GAS_PRICE_FACTOR=

FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
FOREIGN_GAS_PRICE_SPEED_TYPE=standard
FOREIGN_GAS_PRICE_FALLBACK=1000000000
FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
FOREIGN_GAS_PRICE_FACTOR=1
FOREIGN_GAS_PRICE_ORACLE_URL=
FOREIGN_GAS_PRICE_SPEED_TYPE=
FOREIGN_GAS_PRICE_FALLBACK=
FOREIGN_GAS_PRICE_UPDATE_INTERVAL=
FOREIGN_GAS_PRICE_FACTOR=

QUEUE_URL=amqp://rabbit
REDIS_URL=redis://redis
QUEUE_URL=
REDIS_URL=

HOME_START_BLOCK=
FOREIGN_START_BLOCK=

LOG_LEVEL=debug
MAX_PROCESSING_TIME=20000
LOG_LEVEL=
MAX_PROCESSING_TIME=

FOREIGN_TO_HOME_DECIMAL_SHIFT=

#Uncomment these lines only if you are going to send transaction by testing scripts
#USER_ADDRESS=0x59c4474184579b9c31b5e51445b6eef91cebf370
#USER_ADDRESS_PRIVATE_KEY=
#HOME_MIN_AMOUNT_PER_TX=0.001
#FOREIGN_MIN_AMOUNT_PER_TX=0.001
#HOME_TEST_TX_GAS_PRICE=1000000000
#FOREIGN_TEST_TX_GAS_PRICE=1000000000
#FOREIGN_TEST_TX_GAS_PRICE=1000000000
30 changes: 22 additions & 8 deletions oracle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
FROM node:10
FROM node:10 as contracts

WORKDIR /mono

COPY contracts/package.json contracts/package-lock.json ./contracts/

WORKDIR /mono/contracts
RUN npm install --only=prod

COPY ./contracts/truffle-config.js ./
COPY ./contracts/contracts ./contracts
RUN npm run compile

FROM node:14

RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y libc6-dev
RUN apt-get install -y libc6-dev-i386
RUN apt-get install -y wget
RUN apt-get clean
RUN git config --global url.https://github.com/.insteadOf git://github.com/

WORKDIR /mono
COPY package.json .
COPY contracts/package.json ./contracts/
COPY --from=contracts /mono/contracts/build ./contracts/build

COPY commons/package.json ./commons/
COPY oracle/package.json ./oracle/
COPY yarn.lock .
RUN yarn install --production --frozen-lockfile

COPY ./contracts ./contracts
RUN yarn run compile:contracts
RUN mv ./contracts/build ./ && rm -rf ./contracts/* ./contracts/.[!.]* && mv ./build ./contracts/

COPY yarn.lock .
RUN cd oracle && yarn remove web3 web3-utils && cd ..
RUN NOYARNPOSTINSTALL=1 yarn install --frozen-lockfile --production
RUN cd commons && yarn add [email protected] && cd ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Is it possible to yarn upgrade [email protected] instead of remove & add ?
  2. I don't remember, do we need && cd ..?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to try the point 1 but for 2. since we are working on 2 different package.json file (oracle / commons) I think we need it. But gonna try it as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good approach here might be something like

WORKDIR /bla
RUN bla bla
WORKDIR /blu
RUN blu blu

(?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I just tried upgrade it does not work, I have the same issue msg of the beginning
  2. Going to implement the WORKDIR thing

RUN cd oracle && yarn add [email protected] [email protected] && cd ..
COPY ./commons ./commons

COPY ./oracle ./oracle
Expand Down
20 changes: 5 additions & 15 deletions oracle/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ services:
bridge_request:
cpus: 0.1
mem_limit: 500m
build:
context: ..
dockerfile: oracle/Dockerfile
image : docker-regis.iex.ec/oracle:feature-${ORACLE_TAG}
env_file: ./.env
environment:
- NODE_ENV=production
Expand All @@ -47,9 +45,7 @@ services:
bridge_collected:
cpus: 0.1
mem_limit: 500m
build:
context: ..
dockerfile: oracle/Dockerfile
image : docker-regis.iex.ec/oracle:feature-${ORACLE_TAG}
env_file: ./.env
environment:
- NODE_ENV=production
Expand All @@ -62,9 +58,7 @@ services:
bridge_affirmation:
cpus: 0.1
mem_limit: 500m
build:
context: ..
dockerfile: oracle/Dockerfile
image : docker-regis.iex.ec/oracle:feature-${ORACLE_TAG}
env_file: ./.env
environment:
- NODE_ENV=production
Expand All @@ -77,9 +71,7 @@ services:
bridge_senderhome:
cpus: 0.1
mem_limit: 500m
build:
context: ..
dockerfile: oracle/Dockerfile
image : docker-regis.iex.ec/oracle:feature-${ORACLE_TAG}
env_file: ./.env
environment:
- NODE_ENV=production
Expand All @@ -92,9 +84,7 @@ services:
bridge_senderforeign:
cpus: 0.1
mem_limit: 500m
build:
context: ..
dockerfile: oracle/Dockerfile
image : docker-regis.iex.ec/oracle:feature-${ORACLE_TAG}
env_file: ./.env
environment:
- NODE_ENV=production
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"clean": "rm -rf ./node_modules ./**/node_modules ./**/**/node_modules ./**/build",
"compile:contracts": "yarn workspace token-bridge-contracts run compile",
"install:deploy": "cd contracts/deploy && npm install --unsafe-perm --silent",
"postinstall": "ln -sf $(pwd)/node_modules/openzeppelin-solidity/ contracts/node_modules/openzeppelin-solidity"
"postinstall": "test -n \"$NOYARNPOSTINSTALL\" || ln -sf $(pwd)/node_modules/openzeppelin-solidity/ contracts/node_modules/openzeppelin-solidity"
}
}