From 9a9cc31d830a355fcbcfa632203c9efb921b1f62 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 23 Dec 2021 17:01:44 +0100 Subject: [PATCH 1/4] Update docs regarding multiarch builds --- docs/developer.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/developer.md b/docs/developer.md index b69a70aa3..ee4bac5c2 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -324,9 +324,8 @@ jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to markdown freqtrade This documents some decisions taken for the CI Pipeline. * CI runs on all OS variants, Linux (ubuntu), macOS and Windows. -* Docker images are build for the branches `stable` and `develop`. +* Docker images are build for the branches `stable` and `develop`, and are built as multiarch builds, supporting multiple platforms via the same tag. * Docker images containing Plot dependencies are also available as `stable_plot` and `develop_plot`. -* Raspberry PI Docker images are postfixed with `_pi` - so tags will be `:stable_pi` and `develop_pi`. * Docker images contain a file, `/freqtrade/freqtrade_commit` containing the commit this image is based of. * Full docker image rebuilds are run once a week via schedule. * Deployments run on ubuntu. From 61dbb6206fd615c5e7a76f88cf46953781819dfb Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 23 Dec 2021 20:33:13 +0100 Subject: [PATCH 2/4] Slightly reduce verbosity when reload_conf is issued part of #6095 --- freqtrade/worker.py | 7 +++++-- tests/test_worker.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/freqtrade/worker.py b/freqtrade/worker.py index 2fe2de9e1..66f718af0 100755 --- a/freqtrade/worker.py +++ b/freqtrade/worker.py @@ -85,9 +85,12 @@ class Worker: # Log state transition if state != old_state: - self.freqtrade.notify_status(f'{state.name.lower()}') - logger.info(f"Changing state to: {state.name}") + if old_state != State.RELOAD_CONFIG: + self.freqtrade.notify_status(f'{state.name.lower()}') + + logger.info( + f"Changing state{f' from {old_state.name}' if old_state else ''} to: {state.name}") if state == State.RUNNING: self.freqtrade.startup() diff --git a/tests/test_worker.py b/tests/test_worker.py index c3773d296..ddca9525b 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -43,7 +43,7 @@ def test_worker_stopped(mocker, default_conf, caplog) -> None: worker.freqtrade.state = State.STOPPED state = worker._worker(old_state=State.RUNNING) assert state is State.STOPPED - assert log_has('Changing state to: STOPPED', caplog) + assert log_has('Changing state from RUNNING to: STOPPED', caplog) assert mock_throttle.call_count == 1 From 110e48c5416e0cdab1f1eab646f1bb9b436b52a0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 23 Dec 2021 20:38:07 +0100 Subject: [PATCH 3/4] Remove travis config file Travisci seems to no longer offer a free plan for open source repositories, and other repositories report the need to get in touch with support again and again. This complication is not necessary with github actions, which covers our CI needs well. --- .travis.yml | 55 ----------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 15c174bfe..000000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -os: -- linux -dist: bionic -language: python -python: -- 3.8 -services: - - docker -env: - global: - - IMAGE_NAME=freqtradeorg/freqtrade -install: -- cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies; cd .. -- export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH -- export TA_LIBRARY_PATH=${HOME}/dependencies/lib -- export TA_INCLUDE_PATH=${HOME}/dependencies/include -- pip install -r requirements-dev.txt -- pip install -e . -jobs: - - include: - - stage: tests - script: - - pytest --random-order --cov=freqtrade --cov-config=.coveragerc - # Allow failure for coveralls - # - coveralls || true - name: pytest - - script: - - cp config_examples/config_bittrex.example.json config.json - - freqtrade create-userdir --userdir user_data - - freqtrade backtesting --datadir tests/testdata --strategy SampleStrategy - name: backtest - - script: - - cp config_examples/config_bittrex.example.json config.json - - freqtrade create-userdir --userdir user_data - - freqtrade hyperopt --datadir tests/testdata -e 5 --strategy SampleStrategy --hyperopt-loss SharpeHyperOptLossDaily - name: hyperopt - - script: flake8 - name: flake8 - - script: - # Test Documentation boxes - - # !!! : is not allowed! - # !!! "title" - Title needs to be quoted! - - grep -Er '^!{3}\s\S+:|^!{3}\s\S+\s[^"]' docs/*; test $? -ne 0 - name: doc syntax - - script: mypy freqtrade scripts - name: mypy - -notifications: - slack: - secure: bKLXmOrx8e2aPZl7W8DA5BdPAXWGpI5UzST33oc1G/thegXcDVmHBTJrBs4sZak6bgAclQQrdZIsRd2eFYzHLalJEaw6pk7hoAw8SvLnZO0ZurWboz7qg2+aZZXfK4eKl/VUe4sM9M4e/qxjkK+yWG7Marg69c4v1ypF7ezUi1fPYILYw8u0paaiX0N5UX8XNlXy+PBlga2MxDjUY70MuajSZhPsY2pDUvYnMY1D/7XN3cFW0g+3O8zXjF0IF4q1Z/1ASQe+eYjKwPQacE+O8KDD+ZJYoTOFBAPllrtpO1jnOPFjNGf3JIbVMZw4bFjIL0mSQaiSUaUErbU3sFZ5Or79rF93XZ81V7uEZ55vD8KMfR2CB1cQJcZcj0v50BxLo0InkFqa0Y8Nra3sbpV4fV5Oe8pDmomPJrNFJnX6ULQhQ1gTCe0M5beKgVms5SITEpt4/Y0CmLUr6iHDT0CUiyMIRWAXdIgbGh1jfaWOMksybeRevlgDsIsNBjXmYI1Sw2ZZR2Eo2u4R6zyfyjOMLwYJ3vgq9IrACv2w5nmf0+oguMWHf6iWi2hiOqhlAN1W74+3HsYQcqnuM3LGOmuCnPprV1oGBqkPXjIFGpy21gNx4vHfO1noLUyJnMnlu2L7SSuN1CdLsnjJ1hVjpJjPfqB4nn8g12x87TqM1bOm+3Q= -cache: - pip: True - directories: - - $HOME/dependencies From 98f6d2d722340089cd1cf753af030c9988b58b6a Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 23 Dec 2021 21:27:30 +0100 Subject: [PATCH 4/4] Update CI to notify on discord only --- .github/workflows/ci.yml | 78 ++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad76dba46..03a1ab0f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,16 +101,13 @@ jobs: run: | mypy freqtrade scripts - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade CI ${{ matrix.os }}*' - mention: 'here' - mention_if: 'failure' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} + severity: error + details: Freqtrade CI failed on ${{ matrix.os }} + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} build_macos: runs-on: ${{ matrix.os }} @@ -194,17 +191,13 @@ jobs: run: | mypy freqtrade scripts - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade CI ${{ matrix.os }}*' - mention: 'here' - mention_if: 'failure' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} - + severity: error + details: Test Succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} build_windows: @@ -257,16 +250,13 @@ jobs: run: | mypy freqtrade scripts - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade CI windows*' - mention: 'here' - mention_if: 'failure' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} + severity: error + details: Test Failed + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} docs_check: runs-on: ubuntu-20.04 @@ -288,14 +278,13 @@ jobs: pip install mkdocs mkdocs build - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: failure() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade Docs*' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} + severity: error + details: Freqtrade doc test failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} cleanup-prior-runs: runs-on: ubuntu-20.04 @@ -306,7 +295,7 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # Notify on slack only once - when CI completes (and after deploy) in case it's successfull + # Notify only once - when CI completes (and after deploy) in case it's successfull notify-complete: needs: [ build_linux, build_macos, build_windows, docs_check ] runs-on: ubuntu-20.04 @@ -320,14 +309,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: always() && steps.check.outputs.has-permission && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade CI*' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} + severity: info + details: Test Completed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} deploy: needs: [ build_linux, build_macos, build_windows, docs_check ] @@ -400,17 +388,13 @@ jobs: run: | build_helpers/publish_docker_multi.sh - - - name: Slack Notification - uses: lazy-actions/slatify@v3.0.0 + - name: Discord notification + uses: rjstone/discord-webhook-notify@v1 if: always() && ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) with: - type: ${{ job.status }} - job_name: '*Freqtrade CI Deploy*' - mention: 'here' - mention_if: 'failure' - channel: '#notifications' - url: ${{ secrets.SLACK_WEBHOOK }} + severity: info + details: Deploy Succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} deploy_arm: