From 34cb8a87ef002cdb6647c71829322b542ea8d89a Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Wed, 5 Apr 2023 15:29:45 +0700 Subject: [PATCH 01/10] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5640ac8..ff1f929 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ frontend/npm-debug.log .ropeproject *bundle.js public + +.python-version \ No newline at end of file From 880e2038d44277e71699c9d97d96c6d12a68190c Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Wed, 5 Apr 2023 15:43:10 +0700 Subject: [PATCH 02/10] Bump biopython to 1.76 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 489eabc..3dbc450 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,6 +34,6 @@ django-datatable-view-compat==0.8.2 boto==2.38.0 rpy2==2.8.6 django-registration==2.0.4 -biopython==1.68 +biopython==1.76 mygene==3.0.0 requests-oauthlib==0.8.0 From 3dc1d15d83c1cc67bae382350c72ce0451641607 Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Wed, 5 Apr 2023 16:42:04 +0700 Subject: [PATCH 03/10] Temporary update github worflow --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7f2cdd4..3fc0247 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,8 +1,8 @@ name: Build on: - push: - branches: - - master + push + # branches: + # - master jobs: release: name: Build and release image to Docker Hub From f79be219c843ff53c42c4c8469c924a94bb7f78e Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Wed, 5 Apr 2023 16:42:58 +0700 Subject: [PATCH 04/10] Use python 3.6 in the Dockerfile --- Dockerfile.prod | 4 ++-- compose.prod.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile.prod b/Dockerfile.prod index 75932e2..2c031f5 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,4 +1,4 @@ -FROM python:2.7-slim +FROM python:3.6.9-slim # Install R and its meta package RUN apt-get update && apt-get install -y --no-install-recommends \ r-base-core r-base-dev \ @@ -11,7 +11,7 @@ RUN mkdir -p /app/user /app/logs WORKDIR /app/user RUN pip install --upgrade pip ADD requirements.txt /app/user/requirements.txt -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --exists-action=s -r requirements.txt # Add code ADD . /app/user EXPOSE 8000 diff --git a/compose.prod.yaml b/compose.prod.yaml index f317f42..01d8c32 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -1,3 +1,4 @@ +name: stargeo-prod services: db: image: postgres:9.4 @@ -29,7 +30,7 @@ services: redis: condition: service_healthy ports: - - "8000:8000" + - "8001:8000" env_file: .env.prod celery: From 6d9fad07f6f80acef1aa983da07731cdad523dbd Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Thu, 6 Apr 2023 10:19:12 +0700 Subject: [PATCH 05/10] Fix pandas version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3dbc450..4a07a20 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ tqdm==4.19.5 requests==2.18.4 ftptool==0.7.1 django-cacheops==4.0.5 -pandas==0.22 +pandas==0.22.0 termcolor==1.1.0 numpy==1.16.1 numexpr==2.6.2 # There is an issue with newer version From 74e29a560d4522356d0858092e3d94e2c4e89611 Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Thu, 6 Apr 2023 10:20:26 +0700 Subject: [PATCH 06/10] Update env.example --- .env.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 186ba4a..54c192d 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ DEBUG=True REAL_DATABASE_URL="..." # for `fab pull_db` to work -DATABASE_URL="postgres://postgres@localhost/star" +DATABASE_URL="postgres://postgres:postgres@db/star" SECRET_KEY=nsPna8hFnaNIn32aasd0a21ldM PYTHONUNBUFFERED=True TANGO_API_URL="https://sandbox.tangocard.com/raas/v1/" @@ -11,3 +11,4 @@ AWS_BUCKET_TEMPLATE="%s.yourname.stargeo.io" BIOPORTAL_API_KEY="o239hfnsf-2311-mmas-19204oifna0" FROM_EMAIL="no-reply@stargeo.org" ADMIN="Admin Name:admin.email@gmail.com" +BROKER_URL="redis://redis:6379/0" \ No newline at end of file From 71a39ab26d12297badd217d258cea602592681eb Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Thu, 6 Apr 2023 14:50:40 +0700 Subject: [PATCH 07/10] Add freezed requirements file --- requirements.freezed.txt | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 requirements.freezed.txt diff --git a/requirements.freezed.txt b/requirements.freezed.txt new file mode 100644 index 0000000..13323e2 --- /dev/null +++ b/requirements.freezed.txt @@ -0,0 +1,64 @@ +amqp==1.4.9 +anyjson==0.3.3 +asn1crypto==0.24.0 +bcrypt==3.1.4 +billiard==3.3.0.23 +biopython==1.68 +boto==2.38.0 +celery==3.1.17 +certifi==2018.10.15 +cffi==1.11.5 +chardet==3.0.4 +coreapi==2.3.3 +coreschema==0.0.4 +cryptography==2.3.1 +dj-database-url==0.4.2 +Django==1.11.10 +django-cacheops==4.0.5 +django-datatable-view-compat==0.8.2 +django-filter==1.1.0 +django-jinja==2.4.1 +django-jinja-bootstrap-form==4.0.3 +django-pandas==0.4.5 +django-registration==2.0.4 +django-rest-swagger==2.1.1 +djangorestframework==3.5.3 +easydict==1.7 +Fabric3==1.13.1.post1 +ftptool==0.7.1 +funcy==1.11 +gunicorn==19.7.1 +handy==0.7 +honcho==0.6.4 +idna==2.6 +itypes==1.1.0 +Jinja2==2.10 +kombu==3.0.37 +MarkupSafe==1.0 +mygene==3.0.0 +numexpr==2.6.2 +numpy==1.14.1 +oauthlib==2.1.0 +openapi-codec==1.3.2 +pandas==0.22.0 +paramiko==2.4.2 +patsy==0.5.0 +pkg-resources==0.0.0 +psycopg2==2.7.3.2 +pyasn1==0.4.4 +pycparser==2.19 +PyNaCl==1.3.0 +python-dateutil==2.7.3 +pytz==2018.5 +redis==2.10.6 +requests==2.18.4 +requests-oauthlib==0.8.0 +rpy2==2.9.2 +scipy==1.0.0 +simplejson==3.16.0 +six==1.11.0 +statsmodels==0.8.0 +termcolor==1.1.0 +tqdm==4.19.5 +uritemplate==3.0.0 +urllib3==1.22 From 10e37483118edfb0edcf28e90a619045580cf2b5 Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Fri, 7 Apr 2023 11:25:02 +0700 Subject: [PATCH 08/10] Update db healthcheck and pytest version --- compose.prod.yaml | 6 +++--- requirements-dev.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compose.prod.yaml b/compose.prod.yaml index 01d8c32..e3310b6 100644 --- a/compose.prod.yaml +++ b/compose.prod.yaml @@ -7,9 +7,9 @@ services: - POSTGRES_PASSWORD healthcheck: test: [ "CMD", "pg_isready", "-U", "${PGUSER:-postgres}" ] - interval: 5s - timeout: 5s - retries: 5 + interval: 1s + timeout: 10s + retries: 50 redis: image: redis:3 diff --git a/requirements-dev.txt b/requirements-dev.txt index 9b9a5f8..20c15da 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ flake8>=3.5.0 flake8-print flake8-per-file-ignores pep8-naming -pytest==2.6.4 +pytest~=2.9 pytest-django==3.1.2 lxml cssselect From 87c6c1494b5586baf1bd55cd42622b38f534525d Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Fri, 7 Apr 2023 11:30:15 +0700 Subject: [PATCH 09/10] Update GitHub build workflow --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3fc0247..7f2cdd4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,8 +1,8 @@ name: Build on: - push - # branches: - # - master + push: + branches: + - master jobs: release: name: Build and release image to Docker Hub From 7d521ea4374b4d9dff21a8f1be735c491a10c5e0 Mon Sep 17 00:00:00 2001 From: Dmitry Shutov Date: Fri, 7 Apr 2023 12:10:40 +0700 Subject: [PATCH 10/10] Update build workflow --- .github/workflows/build.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7f2cdd4..e642341 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,6 +7,8 @@ jobs: release: name: Build and release image to Docker Hub runs-on: ubuntu-latest + env: + BUILD_IMAGE: bedasoftware/stargeo:latest steps: - uses: actions/checkout@v3 - name: Set up Docker Buildx @@ -16,11 +18,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.prod - push: true - tags: bedasoftware/stargeo:latest - platforms: linux/amd64,linux/arm64 \ No newline at end of file + - run: >- + docker buildx build --platform linux/arm64,linux/amd64 + -f Dockerfile.prod + --push -t ${{ env.BUILD_IMAGE }} . \ No newline at end of file