From 58ec49a34da85b71fe5f82b263986faa2b570eaa Mon Sep 17 00:00:00 2001 From: sveneh Date: Sun, 25 Jan 2015 22:52:38 +0100 Subject: added EC2 provisioning, optimised docker for EC2, added python and cppjit client (python not yet working) --- ansible/test-files/docker-cppjit/Dockerfile | 44 +++++++++++++++ ansible/test-files/docker-python/Dockerfile | 14 +++++ ansible/test-files/testrunner.sh | 86 ++++++++++++++--------------- 3 files changed, 101 insertions(+), 43 deletions(-) create mode 100644 ansible/test-files/docker-cppjit/Dockerfile create mode 100644 ansible/test-files/docker-python/Dockerfile (limited to 'ansible/test-files') diff --git a/ansible/test-files/docker-cppjit/Dockerfile b/ansible/test-files/docker-cppjit/Dockerfile new file mode 100644 index 000000000..7b4416cb8 --- /dev/null +++ b/ansible/test-files/docker-cppjit/Dockerfile @@ -0,0 +1,44 @@ +# adjusted from https://github.com/ethereum/cpp-ethereum/blob/develop/docker/Dockerfile +FROM ubuntu:14.04 + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update +RUN apt-get upgrade -y + +# Ethereum dependencies +RUN apt-get install -qy build-essential g++-4.8 git cmake libboost-all-dev libcurl4-openssl-dev wget +RUN apt-get install -qy automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons +RUN apt-get install -qy libjsoncpp-dev libargtable2-dev + +# NCurses based GUI (not optional though for a succesful compilation, see https://github.com/ethereum/cpp-ethereum/issues/452 ) +RUN apt-get install -qy libncurses5-dev + +# Qt-based GUI +# RUN apt-get install -qy qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev + +RUN sudo apt-get -y install software-properties-common + +# LLVM-3.5 +RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add - +RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main\ndeb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main" > /etc/apt/sources.list.d/llvm-trusty.list +RUN apt-get update +RUN apt-get install -qy llvm-3.5 libedit-dev + +# Fix llvm-3.5 cmake paths +RUN mkdir -p /usr/lib/llvm-3.5/share/llvm && ln -s /usr/share/llvm-3.5/cmake /usr/lib/llvm-3.5/share/llvm/cmake + + +# Ethereum PPA +RUN apt-get install -qy software-properties-common +RUN add-apt-repository ppa:ethereum/ethereum +RUN apt-get update +RUN apt-get install -qy libcryptopp-dev libjson-rpc-cpp-dev + +# Build Ethereum (HEADLESS) +RUN git clone --depth=1 --branch develop https://github.com/ethereum/cpp-ethereum +RUN mkdir -p cpp-ethereum/build +RUN cd cpp-ethereum/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DHEADLESS=1 -DEVMJIT=1 && make -j $(cat /proc/cpuinfo | grep processor | wc -l) && make install +RUN ldconfig + +ENTRYPOINT ["/cpp-ethereum/build/test/checkRandomTest"] + diff --git a/ansible/test-files/docker-python/Dockerfile b/ansible/test-files/docker-python/Dockerfile new file mode 100644 index 000000000..0265f120b --- /dev/null +++ b/ansible/test-files/docker-python/Dockerfile @@ -0,0 +1,14 @@ +FROM sveneh/pyethereum-base + +RUN git clone --branch master https://github.com/ethereum/pyethereum.git + +RUN cd pyethereum && curl https://bootstrap.pypa.io/bootstrap-buildout.py | python + +RUN cd pyethereum && bin/buildout + +#default port for incoming requests +EXPOSE 30303 + +WORKDIR /pyethereum/bin + +ENTRYPOINT ["./python", "../tests/test_vm.py"] diff --git a/ansible/test-files/testrunner.sh b/ansible/test-files/testrunner.sh index 2c9608dd4..db02db873 100755 --- a/ansible/test-files/testrunner.sh +++ b/ansible/test-files/testrunner.sh @@ -4,53 +4,53 @@ #cd ~/software/Ethereum/pyethereum (python has local dependencies so only works from within the directory) while [ 1 ] do - TEST="$(docker run --rm cpp)" + TEST="$(docker run --rm --entrypoint="/cpp-ethereum/build/test/createRandomTest" cppjit)" # echo "$TEST" - - # test pyethereum - #OUTPUT_PYTHON="$(python ./tests/test_vm.py "$TEST")" - #RESULT_PYTHON=$? + # test pyethereum + #OUTPUT_PYTHON="$(python ./tests/test_vm.py "$TEST")" + #RESULT_PYTHON=$? # test go - OUTPUT_GO="$(docker run --rm go "$TEST")" - RESULT_GO=$? - + OUTPUT_GO="$(docker run --rm go "$TEST")" + RESULT_GO=$? + # test cpp-jit - #OUTPUT_CPPJIT="$(~/software/Ethereum/cpp-ethereum/build/test/checkRandomTest "$TEST")" - #RESULT_CPPJIT=$? - -# go fails -if [ "$RESULT_GO" -ne 0 ]; then - echo Failed: - echo Output_GO: - echo $OUTPUT_GO - echo Test: - echo "$TEST" - echo "$TEST" > FailedTest.json - mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")GO.json # replace with scp to central server -fi - -# python fails -#if [ "$RESULT_PYTHON" -ne 0 ]; then -# echo Failed: -# echo Output_PYTHON: -# echo $OUTPUT_PYTHON -# echo Test: -# echo "$TEST" -# echo "$TEST" > FailedTest.json -# mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")PYTHON.json -#fi - -# cppjit fails -#if [ "$RESULT_CPPJIT" -ne 0 ]; then -# echo Failed: -# echo Output_CPPJIT: -# echo $OUTPUT_CPPJIT -# echo Test: -# echo "$TEST" -# echo "$TEST" > FailedTest.json -# mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")CPPJIT.json -#fi + OUTPUT_CPPJIT="$(docker run --rm cppjit "$TEST")" + RESULT_CPPJIT=$? + + # go fails + if [ "$RESULT_GO" -ne 0 ]; then + echo Failed: + echo Output_GO: + echo $OUTPUT_GO + echo Test: + echo "$TEST" + echo "$TEST" > FailedTest.json + mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")GO.json # replace with scp to central server + fi + + # python fails + #if [ "$RESULT_PYTHON" -ne 0 ]; then + # echo Failed: + # echo Output_PYTHON: + # echo $OUTPUT_PYTHON + # echo Test: + # echo "$TEST" + # echo "$TEST" > FailedTest.json + # mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")PYTHON.json + #fi + + # cppjit fails + if [ "$RESULT_CPPJIT" -ne 0 ]; then + echo Failed: + echo Output_CPPJIT: + echo $OUTPUT_CPPJIT + echo Test: + echo "$TEST" + echo "$TEST" > FailedTest.json + mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")CPPJIT.json + fi + exit done -- cgit v1.2.3