From 396e0eff6894fcdb2d06afcb8f3ffed05d19d916 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:16:00 +0530 Subject: [PATCH] v2.01 - build workflow docker tag fixed, Dockerfile entrypoint added for GUI * v2.01 - build workflow docker tag fixed, Dockerfile entrypoint added for GUI, version bumped to 2.01 - Docker build dependecy removed on Test workflow stage - workflow updated, version bumped - Docker entrypoint updated - ScreenerTA checks for env var to load pandas_ta on streamlit cloud --------- Co-authored-by: github-actions Co-authored-by: pranjal-joshi --- .github/workflows/workflow-build-matrix.yml | 12 ++++++------ .github/workflows/workflow-test.yml | 2 +- Dockerfile | 5 ++++- src/classes/Changelog.py | 5 ++++- src/classes/ScreenipyTA.py | 11 ++++++++--- src/release.md | 14 +++++++------- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow-build-matrix.yml b/.github/workflows/workflow-build-matrix.yml index e109bd5..56d3573 100644 --- a/.github/workflows/workflow-build-matrix.yml +++ b/.github/workflows/workflow-build-matrix.yml @@ -168,11 +168,10 @@ jobs: - name: Get tag version version id: version run: | - echo "ver=$(grep 'VERSION = ' src/classes/Changelog.py | awk -F'"' '{print $2}')" >> $GITHUB_OUTPUT - if [ -z "$ver" ]; then - echo "ver=latest" >> $GITHUB_OUTPUT - fi - echo $ver + VER=$(grep 'VERSION = ' src/classes/Changelog.py | awk -F'"' '{print $2}') + echo "VERSION=$VER" >> $GITHUB_ENV + # echo "ver=$(grep 'VERSION = ' src/classes/Changelog.py | awk -F'"' '{print $2}')" >> $GITHUB_OUTPUT + echo $VER - name: Streamlit Build and Push uses: docker/build-push-action@v4 @@ -180,5 +179,6 @@ jobs: context: . platforms: linux/amd64, linux/arm64 push: true - tags: joshipranjal/screeni-py:latest, joshipranjal/screeni-py:${{ steps.version.outputs.ver }} + tags: joshipranjal/screeni-py:latest, joshipranjal/screeni-py:${{ env.VERSION }} + # tags: joshipranjal/screeni-py:latest, joshipranjal/screeni-py:${{ steps.version.outputs.ver }} diff --git a/.github/workflows/workflow-test.yml b/.github/workflows/workflow-test.yml index 88e8da8..9079257 100644 --- a/.github/workflows/workflow-test.yml +++ b/.github/workflows/workflow-test.yml @@ -71,7 +71,7 @@ jobs: Dev-Docker-Build: runs-on: ubuntu-latest - needs: [Test-Source] + # needs: [Test-Source] steps: - uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index 8203703..30cc5a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,4 +52,7 @@ ENV SCREENIPY_GUI = TRUE EXPOSE 8501 -HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health \ No newline at end of file +HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health + +WORKDIR /opt/program/src/ +ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] \ No newline at end of file diff --git a/src/classes/Changelog.py b/src/classes/Changelog.py index 2e723e6..c061008 100644 --- a/src/classes/Changelog.py +++ b/src/classes/Changelog.py @@ -7,7 +7,7 @@ from classes.ColorText import colorText -VERSION = "2.00" +VERSION = "2.01" changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + ''' [1.00 - Beta] @@ -207,4 +207,7 @@ 1. Streamlit UI (WebApp) added. 2. Multi-Arch Docker support enabled. +[2.01] +1. Docker build fixed - Versioning critical bug fixed for further OTA updates. + ''' + colorText.END diff --git a/src/classes/ScreenipyTA.py b/src/classes/ScreenipyTA.py index 2d12ac3..8af0382 100644 --- a/src/classes/ScreenipyTA.py +++ b/src/classes/ScreenipyTA.py @@ -1,9 +1,14 @@ import numpy as np +import os -try: - import talib -except ImportError: +if 'STREAMLIT_APP' in os.environ: import pandas_ta as talib + print('[+] Importing pandas_ta as we are running on Streamlit cloud app') +else: + try: + import talib + except ImportError: + import pandas_ta as talib class ScreenerTA: diff --git a/src/release.md b/src/release.md index 689f6ec..7a4685c 100644 --- a/src/release.md +++ b/src/release.md @@ -15,18 +15,18 @@ Celebrating more than 7K+ Downloads - Thank You for your support :tada: ## Downloads | Operating System | Executable File | | :-: | --- | -| ![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) | **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.00/screenipy.exe)** | -| ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) | **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.00/screenipy.bin)** | -| ![Mac OS](https://img.shields.io/badge/mac%20os-D3D3D3?style=for-the-badge&logo=apple&logoColor=000000) | **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.00/screenipy.run)** ([Read Installation Guide](https://github.com/pranjal-joshi/Screeni-py/blob/main/INSTALLATION.md#for-macos)) | +| ![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) | **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.01/screenipy.exe)** | +| ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) | **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.01/screenipy.bin)** | +| ![Mac OS](https://img.shields.io/badge/mac%20os-D3D3D3?style=for-the-badge&logo=apple&logoColor=000000) | **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/2.01/screenipy.run)** ([Read Installation Guide](https://github.com/pranjal-joshi/Screeni-py/blob/main/INSTALLATION.md#for-macos)) | ## [Docker Releases](https://hub.docker.com/r/joshipranjal/screeni-py/tags) | | Tag | Pull Command | Mode | Run Command | |:-: | :-: | --- | --- | --- | -| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `latest` | `docker pull joshipranjal/screeni-py:latest` | Command Line | `docker run -it joshipranjal/screeni-py:latest run_screenipy.sh --cli` | -| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `latest` | `docker pull joshipranjal/screeni-py:latest` | GUI WebApp | `docker run -it -p 8501:8501 joshipranjal/screeni-py:latest run_screenipy.sh --gui` | -| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `dev` | `docker pull joshipranjal/screeni-py:dev` | Command Line | `docker run -it joshipranjal/screeni-py:dev run_screenipy.sh --cli` | -| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `dev` | `docker pull joshipranjal/screeni-py:dev` | GUI WebApp | `docker run -it joshipranjal/screeni-py:dev run_screenipy.sh --gui` | +| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `latest` | `docker pull joshipranjal/screeni-py:latest` | Command Line | `docker run -it --entrypoint /bin/bash joshipranjal/screeni-py:latest -c "run_screenipy.sh --cli"` | +| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `latest` | `docker pull joshipranjal/screeni-py:latest` | GUI WebApp | `docker run -p 8501:8501 joshipranjal/screeni-py:latest` | +| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `dev` | `docker pull joshipranjal/screeni-py:dev` | Command Line | `docker run -it --entrypoint /bin/bash joshipranjal/screeni-py:dev -c "run_screenipy.sh --cli"` | +| ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) | `dev` | `docker pull joshipranjal/screeni-py:dev` | GUI WebApp | `docker run joshipranjal/screeni-py:dev` | **Should I download the Exe/Bin file? Or Should I use Docker?**