|
1 | 1 | FROM ubuntu:20.04 as retesteth |
2 | 2 |
|
| 3 | +ARG BESU_SRC="https://github.com/hyperledger/besu.git" |
| 4 | +ARG PYSPECS_SRC="https://github.com/ethereum/execution-spec-tests" |
| 5 | +ARG ETEREUMJS_SRC="https://github.com/ethereumjs/ethereumjs-monorepo.git" |
| 6 | +ARG RETESTETH_SRC="https://github.com/ethereum/retesteth.git" |
| 7 | +ARG GETH_SRC="https://github.com/ethereum/go-ethereum.git" |
| 8 | +ARG NIMBUS_SRC="https://github.com/status-im/nimbus-eth1.git" |
| 9 | +ARG EVMONE_SRC="https://github.com/ethereum/evmone.git" |
| 10 | + |
| 11 | +# Leave empty to disable the build, can point to commit hash as well |
| 12 | +ARG BESU="main" |
| 13 | +ARG GETH="master" |
| 14 | +ARG NIMBUS="master" |
| 15 | +ARG ETHEREUMJS="master" |
| 16 | +ARG RETESTETH="develop" |
| 17 | +ARG PYSPECS="main" |
| 18 | +ARG EVMONE="master" |
| 19 | + |
| 20 | +SHELL ["/bin/bash", "-c"] |
3 | 21 | ENV TZ=Etc/UTC |
4 | 22 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
5 | 23 |
|
6 | 24 | # Get necessary packages |
7 | 25 | RUN apt-get update \ |
8 | | - && apt-get install --yes git cmake g++ make perl psmisc curl python3 wget libboost-all-dev \ |
| 26 | + && apt install software-properties-common -y \ |
| 27 | + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ |
| 28 | + && add-apt-repository -y ppa:deadsnakes/ppa \ |
| 29 | + && add-apt-repository ppa:linuxuprising/java \ |
| 30 | + && apt-get install --yes git cmake make perl psmisc curl wget gcc-11 g++-11 python3.10 python3.10-venv python3-pip python3-dev \ |
| 31 | + && apt-get install --yes libboost-filesystem-dev libboost-system-dev libboost-program-options-dev libboost-test-dev \ |
| 32 | + && echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | /usr/bin/debconf-set-selections \ |
| 33 | + && apt-get install --yes oracle-java17-installer oracle-java17-set-default \ |
9 | 34 | && rm -rf /var/lib/apt/lists/* |
| 35 | +RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.10 /usr/bin/python3 \ |
| 36 | + && rm /usr/bin/gcc && rm /usr/bin/g++ \ |
| 37 | + && ln -s /usr/bin/gcc-11 /usr/bin/gcc \ |
| 38 | + && ln -s /usr/bin/g++-11 /usr/bin/g++ |
10 | 39 |
|
11 | | -# Retesteth |
12 | | -# ADD . /retesteth |
13 | | -RUN git clone --depth 1 -b master https://github.com/ethereum/retesteth.git /retesteth |
14 | | -RUN mkdir /build && cd /build \ |
15 | | - && cmake /retesteth -DCMAKE_BUILD_TYPE=Release \ |
16 | | - && make -j8 \ |
17 | | - && cp /build/retesteth/retesteth /usr/bin/retesteth \ |
18 | | - && rm -rf /build /retesteth /var/cache/* /root/.hunter/* |
19 | | - |
| 40 | +# Tests |
20 | 41 | #RUN git clone --depth 1 -b master https://github.com/ethereum/tests /tests |
21 | 42 |
|
22 | 43 | # Solidity LLLC |
23 | | -RUN git clone --depth 1 -b master https://github.com/winsvega/solidity.git /solidity |
24 | | -RUN mkdir /build && cd /build \ |
| 44 | +RUN test -n "$RETESTETH" \ |
| 45 | + && git clone --depth 1 -b master https://github.com/winsvega/solidity.git /solidity \ |
| 46 | + && mkdir /build && cd /build \ |
25 | 47 | && cmake /solidity -DCMAKE_BUILD_TYPE=Release -DLLL=1 && make lllc \ |
26 | 48 | && cp /build/lllc/lllc /bin/lllc \ |
27 | | - && rm -rf /build /solidity /var/cache/* /root/.hunter/* |
| 49 | + && rm -rf /build /solidity /var/cache/* /root/.hunter/* \ |
| 50 | + || echo "Retesteth is empty, skip LLLC" |
28 | 51 |
|
29 | 52 | # Solidity solc |
30 | | -# RUN git clone https://github.com/ethereum/solidity.git /solidity |
31 | | -# RUN mkdir /build && cd /build \ |
32 | | -# && cmake /solidity -DCMAKE_BUILD_TYPE=Release && make solc \ |
33 | | -# && cp /build/solc/solc /bin/solc \ |
34 | | -# && rm -rf /build /solidity /var/cache/* /root/.hunter/* |
35 | 53 | RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.17/solc-static-linux \ |
36 | 54 | && cp solc-static-linux /bin/solc \ |
37 | 55 | && chmod +x /bin/solc |
38 | 56 |
|
| 57 | +# Pyspecs |
| 58 | +RUN git clone $PYSPECS_SRC /execution-spec-tests |
| 59 | +RUN cd /execution-spec-tests && git fetch && git checkout $PYSPECS \ |
| 60 | + && python3 -m venv ./venv/ \ |
| 61 | + && source ./venv/bin/activate \ |
| 62 | + && pip install -e . \ |
| 63 | + && wget https://raw.githubusercontent.com/ethereum/retesteth/develop/web/tfinit.sh \ |
| 64 | + && cp tfinit.sh /usr/bin/tfinit.sh \ |
| 65 | + && chmod +x /usr/bin/tfinit.sh |
| 66 | + |
| 67 | + |
39 | 68 | # Geth |
40 | | -RUN git clone --depth 1 -b master https://github.com/ethereum/go-ethereum.git /geth |
41 | | -RUN cd /geth \ |
42 | | - && wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz \ |
43 | | - && tar -xvf go1.19.linux-amd64.tar.gz \ |
44 | | - && mv go /usr/local && ln -s /usr/local/go/bin/go /bin/go \ |
45 | | - && make all && cp /geth/build/bin/evm /bin/evm \ |
46 | | - && cp /geth/build/bin/geth /bin/geth \ |
47 | | - && rm -rf /geth && rm -rf /usr/local/go |
| 69 | +RUN test -n "$GETH" \ |
| 70 | + && git clone $GETH_SRC /geth \ |
| 71 | + && cd /geth && git fetch && git checkout $GETH \ |
| 72 | + && wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz \ |
| 73 | + && tar -xvf go1.19.linux-amd64.tar.gz \ |
| 74 | + && mv go /usr/local && ln -s /usr/local/go/bin/go /bin/go \ |
| 75 | + && make all && cp /geth/build/bin/evm /bin/evm \ |
| 76 | + && cp /geth/build/bin/geth /bin/geth \ |
| 77 | + && rm -rf /geth && rm -rf /usr/local/go \ |
| 78 | + || echo "Geth is empty" |
| 79 | + |
| 80 | +# Nimbus |
| 81 | +RUN test -n "$NIMBUS" \ |
| 82 | + && apt-get update \ |
| 83 | + && apt-get install --yes librocksdb-dev \ |
| 84 | + && rm -rf /var/lib/apt/lists/* \ |
| 85 | + && git clone --recursive $NIMBUS_SRC /nimbus \ |
| 86 | + && cd /nimbus && git fetch && git checkout $NIMBUS && make t8n \ |
| 87 | + && cp /nimbus/tools/t8n/t8n /bin/evm_nimbus \ |
| 88 | + && rm -rf /nimbus \ |
| 89 | + || echo "Nimbus is empty" |
| 90 | + |
| 91 | +# Ethereumjs |
| 92 | +RUN test -n "$ETHEREUMJS" \ |
| 93 | + && wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \ |
| 94 | + && . ~/.nvm/nvm.sh \ |
| 95 | + && nvm install 19 && nvm alias default 19 && nvm use default \ |
| 96 | + && cp -r ~/.nvm/versions/node/v19*/* /usr \ |
| 97 | + && git clone $ETEREUMJS_SRC /ethereumjs \ |
| 98 | + && cd /ethereumjs && git fetch && git checkout $ETHEREUMJS && npm i && npm run build --workspaces \ |
| 99 | + || echo "Ethereumjs is empty" |
| 100 | + |
| 101 | +# Besu |
| 102 | +RUN test -n "$BESU" \ |
| 103 | + && git clone $BESU_SRC /besu \ |
| 104 | + && cd /besu && git fetch && git checkout $BESU \ |
| 105 | + && ./gradlew build \ |
| 106 | + || echo "Besu is empty" |
| 107 | + |
| 108 | +RUN test -n "$BESU" \ |
| 109 | + && cd /besu && ./gradlew ethereum:evmtool:installDist \ |
| 110 | + && ln -s /besu/ethereum/evmtool/build/install/evmtool/bin/evm /usr/bin/besuevm \ |
| 111 | + || echo "Besu is empty" |
| 112 | + |
| 113 | +# Evmone |
| 114 | +RUN test -n "$EVMONE" \ |
| 115 | + && git clone --recursive $EVMONE_SRC /evmone \ |
| 116 | + && cd /evmone && git fetch && git checkout $evmone \ |
| 117 | + && cmake -S . -B build -DEVMONE_TESTING=ON \ |
| 118 | + && cmake --build build \ |
| 119 | + && ln -s /evmone/build/bin/evmone-t8n /usr/bin/evmone \ |
| 120 | + && rm -rf /var/cache/* /root/.hunter/* \ |
| 121 | + || echo "Evmone is empty" |
| 122 | + |
| 123 | +# Retesteth |
| 124 | +RUN test -n "$RETESTETH" \ |
| 125 | + && git clone $RETESTETH_SRC /retesteth \ |
| 126 | + && cd /retesteth && git fetch && git checkout $RETESTETH && mkdir /build && cd /build \ |
| 127 | + && cmake /retesteth -DCMAKE_BUILD_TYPE=Release \ |
| 128 | + && make -j2 \ |
| 129 | + && cp /build/retesteth/retesteth /usr/bin/retesteth \ |
| 130 | + && rm -rf /build /retesteth /var/cache/* /root/.hunter/* \ |
| 131 | + || echo "Retesteth is empty" > /usr/bin/retesteth |
48 | 132 |
|
49 | 133 | ENTRYPOINT ["/usr/bin/retesteth"] |
0 commit comments