From 4eb0ed9f2fd3296643e45da462c7867c3a7a2bba Mon Sep 17 00:00:00 2001 From: TL Nguyen Date: Sat, 6 Apr 2019 21:11:14 +0300 Subject: [PATCH 1/4] Add Dockerfile.pi for building docker image for raspberry pi --- Dockerfile.pi | 40 ++++++++++++++++++++++++++++++++++++++++ requirements-pi.txt | 23 +++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 Dockerfile.pi create mode 100644 requirements-pi.txt diff --git a/Dockerfile.pi b/Dockerfile.pi new file mode 100644 index 000000000..5184e2d37 --- /dev/null +++ b/Dockerfile.pi @@ -0,0 +1,40 @@ +FROM balenalib/raspberrypi3-debian:stretch + +RUN [ "cross-build-start" ] + +RUN apt-get update \ + && apt-get -y install wget curl build-essential libssl-dev libffi-dev \ + && apt-get clean + +# Prepare environment +RUN mkdir /freqtrade +WORKDIR /freqtrade + +# Install TA-lib +COPY build_helpers/ta-lib-0.4.0-src.tar.gz /freqtrade/ +RUN tar -xzf /freqtrade/ta-lib-0.4.0-src.tar.gz \ + && cd /freqtrade/ta-lib/ \ + && ./configure \ + && make \ + && make install \ + && rm /freqtrade/ta-lib-0.4.0-src.tar.gz + +ENV LD_LIBRARY_PATH /usr/local/lib + +# Install berryconda +RUN wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda3-2.0.0-Linux-armv7l.sh \ + && bash ./Berryconda3-2.0.0-Linux-armv7l.sh -b \ + && rm Berryconda3-2.0.0-Linux-armv7l.sh + +# Install dependencies +COPY requirements-pi.txt /freqtrade/ +RUN ~/berryconda3/bin/conda install -y numpy pandas scipy \ + && ~/berryconda3/bin/pip install -r requirements-pi.txt --no-cache-dir + +# Install and execute +COPY . /freqtrade/ +RUN ~/berryconda3/bin/pip install -e . --no-cache-dir + +RUN [ "cross-build-end" ] + +ENTRYPOINT ["/root/berryconda3/bin/python","./freqtrade/main.py"] diff --git a/requirements-pi.txt b/requirements-pi.txt new file mode 100644 index 000000000..575107e2d --- /dev/null +++ b/requirements-pi.txt @@ -0,0 +1,23 @@ +ccxt==1.18.270 +SQLAlchemy==1.2.18 +python-telegram-bot==11.1.0 +arrow==0.13.1 +cachetools==3.1.0 +requests==2.21.0 +urllib3==1.24.1 +wrapt==1.11.1 +scikit-learn==0.20.2 +joblib==0.13.2 +jsonschema==2.6.0 +TA-Lib==0.4.17 +tabulate==0.8.3 +coinmarketcap==5.0.3 + +# Required for hyperopt +scikit-optimize==0.5.2 + +# find first, C search in arrays +py_find_1st==1.1.3 + +#Load ticker files 30% faster +python-rapidjson==0.7.0 From e7c8e62d751faaf3abd22742eccb52c0d77abc84 Mon Sep 17 00:00:00 2001 From: TL Nguyen Date: Sun, 7 Apr 2019 10:31:03 +0300 Subject: [PATCH 2/4] Remove requirements-pi.txt, change Dockerfile.pi to utilize the requirements.txt instead --- Dockerfile.pi | 7 ++++--- requirements-pi.txt | 23 ----------------------- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 requirements-pi.txt diff --git a/Dockerfile.pi b/Dockerfile.pi index 5184e2d37..1041b3c87 100644 --- a/Dockerfile.pi +++ b/Dockerfile.pi @@ -27,9 +27,10 @@ RUN wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryco && rm Berryconda3-2.0.0-Linux-armv7l.sh # Install dependencies -COPY requirements-pi.txt /freqtrade/ -RUN ~/berryconda3/bin/conda install -y numpy pandas scipy \ - && ~/berryconda3/bin/pip install -r requirements-pi.txt --no-cache-dir +COPY requirements.txt /freqtrade/ +RUN sed -i -e '/^numpy==/d' -e '/^pandas==/d' -e '/^scipy==/d' ./requirements.txt \ + && ~/berryconda3/bin/conda install -y numpy pandas scipy \ + && ~/berryconda3/bin/pip install -r requirements.txt --no-cache-dir # Install and execute COPY . /freqtrade/ diff --git a/requirements-pi.txt b/requirements-pi.txt deleted file mode 100644 index 575107e2d..000000000 --- a/requirements-pi.txt +++ /dev/null @@ -1,23 +0,0 @@ -ccxt==1.18.270 -SQLAlchemy==1.2.18 -python-telegram-bot==11.1.0 -arrow==0.13.1 -cachetools==3.1.0 -requests==2.21.0 -urllib3==1.24.1 -wrapt==1.11.1 -scikit-learn==0.20.2 -joblib==0.13.2 -jsonschema==2.6.0 -TA-Lib==0.4.17 -tabulate==0.8.3 -coinmarketcap==5.0.3 - -# Required for hyperopt -scikit-optimize==0.5.2 - -# find first, C search in arrays -py_find_1st==1.1.3 - -#Load ticker files 30% faster -python-rapidjson==0.7.0 From c35e5ca7dda865243006b1dd251b8a1eeb82af00 Mon Sep 17 00:00:00 2001 From: TL Nguyen Date: Sun, 7 Apr 2019 14:05:41 +0300 Subject: [PATCH 3/4] Add back requirements-pi.txt file and put it into .pyup.yml --- .pyup.yml | 1 + requirements-pi.txt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 requirements-pi.txt diff --git a/.pyup.yml b/.pyup.yml index 01d4bba2a..462ae5783 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -22,6 +22,7 @@ requirements: - requirements.txt - requirements-dev.txt - requirements-plot.txt + - requirements-pi.txt # configure the branch prefix the bot is using diff --git a/requirements-pi.txt b/requirements-pi.txt new file mode 100644 index 000000000..4fca8b032 --- /dev/null +++ b/requirements-pi.txt @@ -0,0 +1,23 @@ +ccxt==1.18.353 +SQLAlchemy==1.3.1 +python-telegram-bot==11.1.0 +arrow==0.13.1 +cachetools==3.1.0 +requests==2.21.0 +urllib3==1.24.1 +wrapt==1.11.1 +scikit-learn==0.20.3 +joblib==0.13.2 +jsonschema==3.0.1 +TA-Lib==0.4.17 +tabulate==0.8.3 +coinmarketcap==5.0.3 + +# Required for hyperopt +scikit-optimize==0.5.2 + +# find first, C search in arrays +py_find_1st==1.1.3 + +#Load ticker files 30% faster +python-rapidjson==0.7.0 From 3ad4d937c5731bd9ef169684ca72d68a0082ffd0 Mon Sep 17 00:00:00 2001 From: TL Nguyen Date: Sun, 7 Apr 2019 14:07:26 +0300 Subject: [PATCH 4/4] Correct Dockerfile.pi file to use requirements-pi.txt --- Dockerfile.pi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile.pi b/Dockerfile.pi index 1041b3c87..5184e2d37 100644 --- a/Dockerfile.pi +++ b/Dockerfile.pi @@ -27,10 +27,9 @@ RUN wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryco && rm Berryconda3-2.0.0-Linux-armv7l.sh # Install dependencies -COPY requirements.txt /freqtrade/ -RUN sed -i -e '/^numpy==/d' -e '/^pandas==/d' -e '/^scipy==/d' ./requirements.txt \ - && ~/berryconda3/bin/conda install -y numpy pandas scipy \ - && ~/berryconda3/bin/pip install -r requirements.txt --no-cache-dir +COPY requirements-pi.txt /freqtrade/ +RUN ~/berryconda3/bin/conda install -y numpy pandas scipy \ + && ~/berryconda3/bin/pip install -r requirements-pi.txt --no-cache-dir # Install and execute COPY . /freqtrade/