From c8d7c2caac6d4d8ba13896579a05d55dcd15a159 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 16 Aug 2022 09:26:02 +0200 Subject: [PATCH] Update CI to build and push freqAI images --- build_helpers/publish_docker_arm64.sh | 8 ++++++++ build_helpers/publish_docker_multi.sh | 4 ++++ docker/Dockerfile.freqai | 8 -------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build_helpers/publish_docker_arm64.sh b/build_helpers/publish_docker_arm64.sh index 70f99e54b..4c66f4483 100755 --- a/build_helpers/publish_docker_arm64.sh +++ b/build_helpers/publish_docker_arm64.sh @@ -6,10 +6,12 @@ export DOCKER_BUILDKIT=1 # Replace / with _ to create a valid tag TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g") TAG_PLOT=${TAG}_plot +TAG_FREQAI=${TAG}_freqai TAG_PI="${TAG}_pi" TAG_ARM=${TAG}_arm TAG_PLOT_ARM=${TAG_PLOT}_arm +TAG_FREQAI_ARM=${TAG_FREQAI}_arm CACHE_IMAGE=freqtradeorg/freqtrade_cache echo "Running for ${TAG}" @@ -38,8 +40,10 @@ fi docker tag freqtrade:$TAG_ARM ${CACHE_IMAGE}:$TAG_ARM docker build --cache-from freqtrade:${TAG_ARM} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_PLOT_ARM} -f docker/Dockerfile.plot . +docker build --cache-from freqtrade:${TAG_ARM} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG_ARM} -t freqtrade:${TAG_FREQAI_ARM} -f docker/Dockerfile.freqai . docker tag freqtrade:$TAG_PLOT_ARM ${CACHE_IMAGE}:$TAG_PLOT_ARM +docker tag freqtrade:$TAG_FREQAI_ARM ${CACHE_IMAGE}:$TAG_FREQAI_ARM # Run backtest docker run --rm -v $(pwd)/config_examples/config_bittrex.example.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG_ARM} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3 @@ -53,6 +57,7 @@ docker images # docker push ${IMAGE_NAME} docker push ${CACHE_IMAGE}:$TAG_PLOT_ARM +docker push ${CACHE_IMAGE}:$TAG_FREQAI_ARM docker push ${CACHE_IMAGE}:$TAG_ARM # Create multi-arch image @@ -66,6 +71,9 @@ docker manifest push -p ${IMAGE_NAME}:${TAG} docker manifest create ${IMAGE_NAME}:${TAG_PLOT} ${CACHE_IMAGE}:${TAG_PLOT_ARM} ${CACHE_IMAGE}:${TAG_PLOT} docker manifest push -p ${IMAGE_NAME}:${TAG_PLOT} +docker manifest create ${IMAGE_NAME}:${TAG_FREQAI} ${CACHE_IMAGE}:${TAG_FREQAI_ARM} ${CACHE_IMAGE}:${TAG_FREQAI} +docker manifest push -p ${IMAGE_NAME}:${TAG_FREQAI} + # Tag as latest for develop builds if [ "${TAG}" = "develop" ]; then docker manifest create ${IMAGE_NAME}:latest ${CACHE_IMAGE}:${TAG_ARM} ${IMAGE_NAME}:${TAG_PI} ${CACHE_IMAGE}:${TAG} diff --git a/build_helpers/publish_docker_multi.sh b/build_helpers/publish_docker_multi.sh index fd5f0ef93..1168a63f6 100755 --- a/build_helpers/publish_docker_multi.sh +++ b/build_helpers/publish_docker_multi.sh @@ -5,6 +5,7 @@ # Replace / with _ to create a valid tag TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g") TAG_PLOT=${TAG}_plot +TAG_FREQAI=${TAG}_plot TAG_PI="${TAG}_pi" PI_PLATFORM="linux/arm/v7" @@ -49,8 +50,10 @@ fi docker tag freqtrade:$TAG ${CACHE_IMAGE}:$TAG docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG} -t freqtrade:${TAG_PLOT} -f docker/Dockerfile.plot . +docker build --cache-from freqtrade:${TAG} --build-arg sourceimage=${CACHE_IMAGE} --build-arg sourcetag=${TAG} -t freqtrade:${TAG_FREQAI} -f docker/Dockerfile.freqai . docker tag freqtrade:$TAG_PLOT ${CACHE_IMAGE}:$TAG_PLOT +docker tag freqtrade:$TAG_FREQAI ${CACHE_IMAGE}:$TAG_FREQAI # Run backtest docker run --rm -v $(pwd)/config_examples/config_bittrex.example.json:/freqtrade/config.json:ro -v $(pwd)/tests:/tests freqtrade:${TAG} backtesting --datadir /tests/testdata --strategy-path /tests/strategy/strats/ --strategy StrategyTestV3 @@ -64,6 +67,7 @@ docker images docker push ${CACHE_IMAGE} docker push ${CACHE_IMAGE}:$TAG_PLOT +docker push ${CACHE_IMAGE}:$TAG_FREQAI docker push ${CACHE_IMAGE}:$TAG diff --git a/docker/Dockerfile.freqai b/docker/Dockerfile.freqai index 98e6e31d5..9a2f75700 100644 --- a/docker/Dockerfile.freqai +++ b/docker/Dockerfile.freqai @@ -2,16 +2,8 @@ ARG sourceimage=freqtradeorg/freqtrade ARG sourcetag=develop FROM ${sourceimage}:${sourcetag} -USER root - -RUN apt-get install -y libgomp1 - -USER ftuser - # Install dependencies COPY requirements-freqai.txt /freqtrade/ RUN pip install -r requirements-freqai.txt --user --no-cache-dir -# Temporary step - as the source image will contain the wrong (non-freqai) sourcecode -COPY --chown=ftuser:ftuser . /freqtrade/