From 65c468742a107ba332960c4f5715affaed96056f Mon Sep 17 00:00:00 2001 From: "M. Witte Paz" Date: Mon, 16 Jun 2025 16:24:06 +0200 Subject: [PATCH 1/3] update repo --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 535f7f3..7503da8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", - "popper.js": "^1.16.1", "array-move": "^2.2.1", "bootstrap": "^4.5.0", "browserify": "^17.0.0", @@ -20,9 +19,10 @@ "evergreen-ui": "^2.0.1", "html2canvas": "^1.3.2", "jquery": "^3.5.1", - "lodash": "^4.17.21", "jspdf": "^2.3.1", - "phylotree": "github:mwittep/phylotree.js", + "lodash": "^4.17.21", + "phylotree": "github:Integrative-Transcriptomics/phylotree.js", + "popper.js": "^1.16.1", "react": "^16.13.1", "react-bootstrap": "^1.0.1", "react-color": "^2.18.1", @@ -38,8 +38,8 @@ "scripts": { "server": "cd server && flask run --no-debugger", "evidente": "run-p server start", - "start": "react-scripts start", - "build": "react-scripts build", + "start": "react-scripts --openssl-legacy-provider start", + "build": "react-scripts --openssl-legacy-provider build", "test": "react-scripts test", "eject": "react-scripts eject" }, From b1d0441f630d4c221622e431bec9fe84730dd68c Mon Sep 17 00:00:00 2001 From: "M. Witte Paz" Date: Fri, 25 Jul 2025 15:28:08 +0200 Subject: [PATCH 2/3] Creates Docker Image Evidente --- .babelrc | 1 - .github/workflows/docker_release.yml | 35 +++++++++++++++++++++ Dockerfile | 46 ++++++++++++++++++++++++++++ package.json | 2 +- requirements.txt | 5 +-- server/__init__.py | 2 +- server/wsgi.py | 4 +++ 7 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/docker_release.yml create mode 100644 Dockerfile create mode 100644 server/wsgi.py diff --git a/.babelrc b/.babelrc index 3fb1574..2380b24 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,3 @@ { "presets": ["es2015", "react"], - "plugins": ["transform-decorators-legacy", "transform-class-properties"] } diff --git a/.github/workflows/docker_release.yml b/.github/workflows/docker_release.yml new file mode 100644 index 0000000..22b66a6 --- /dev/null +++ b/.github/workflows/docker_release.yml @@ -0,0 +1,35 @@ +name: Build and Push Docker Image + +# when to run the workflow +on: + push: + branches: [release] + +# the jobs to run +jobs: + build: + # the os to run the job on + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # build the image now + - name: Build Docker image + + run: | + docker build -t evidente:latest . + + - name: save images + run: | + docker save evidente:latest | gzip > image_evidente.tar.gz + + - name: Release WebImage to Repo + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: image_evidente.tar.gz + asset_name: Evidente + tag: ${{ github.ref }} + overwrite: true + body: "The image for the web app of Evidente" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3755f4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# Use an official Node.js runtime as a parent image +# Using a specific version like '20-bullseye-slim' is reliable +FROM node:20-bullseye-slim + +# Set the working directory in the container +WORKDIR /app + +# Prevent apt-get from asking for user input +ENV DEBIAN_FRONTEND=noninteractive + +# Install Python and pip, then clean up +# 1. Update package lists +# 2. Install python3, python3-pip, and a helper to link 'python' to 'python3' +# 3. Clean up apt cache to reduce image size +RUN apt-get update && \ + apt-get install -y python3 python3-pip python-is-python3 && \ + rm -rf /var/lib/apt/lists/* + +# Install git +RUN apt-get update && \ + apt-get install -y git && \ + rm -rf /var/lib/apt/lists/* + + # install java 17 +RUN apt-get update && \ + apt-get install -y openjdk-17-jre && \ + rm -rf /var/lib/apt/lists/* + +COPY src src +COPY public public +COPY package.json package.json +COPY server server +COPY requirements.txt requirements.txt +COPY setup.py setup.py + +RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir . +RUN npm install +RUN npm run build + +# expose the port the app runs on +EXPOSE 3000 + + +# Define the command to run the app +CMD ["gunicorn", "--bind", "0.0.0.0:3000", "server.wsgi:app"] \ No newline at end of file diff --git a/package.json b/package.json index 7503da8..135530a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "react-dom": "^16.13.1", "react-draggable": "^4.4.3", "react-loading-overlay": "^1.0.1", - "react-scripts": "^4.*.*", + "react-scripts": "^5.0.1", "react-select": "^2.4.4", "react-sortable-hoc": "^1.11.0", "react-virtualized": "^9.21.2", diff --git a/requirements.txt b/requirements.txt index 4bb005a..c8b5a10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,13 @@ charset-normalizer==2.0.8 click==8.0.3 docopt==0.6.2 Flask==2.0.2 -goatools==1.1.6 +goatools==1.4.12 idna==3.3 importlib-metadata==4.8.2 itsdangerous==2.0.1 Jinja2==3.0.3 MarkupSafe==2.0.1 -numpy==1.21.4 +numpy==1.22.0 ordered-set==4.0.2 packaging==21.3 pandas==1.3.4 @@ -32,3 +32,4 @@ wget==3.2 xlrd==1.2.0 XlsxWriter==3.0.2 zipp==3.6.0 +gunicorn==23.0.0 diff --git a/server/__init__.py b/server/__init__.py index 29710e0..25e122e 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -238,4 +238,4 @@ def index(): if __name__ == "__main__": mp.set_start_method('spawn') - app.run(debug=True, port=int("3001")) + app.run(port=int("3001")) diff --git a/server/wsgi.py b/server/wsgi.py new file mode 100644 index 0000000..de91da7 --- /dev/null +++ b/server/wsgi.py @@ -0,0 +1,4 @@ +from server import app + +if __name__ == "__main__": + app.run() \ No newline at end of file From 0e485d4ee81d13e68e12a9138733b5afaaba488c Mon Sep 17 00:00:00 2001 From: "M. Witte Paz" Date: Fri, 25 Jul 2025 15:29:15 +0200 Subject: [PATCH 3/3] updates branch checkout --- .github/workflows/docker_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_release.yml b/.github/workflows/docker_release.yml index 22b66a6..b346798 100644 --- a/.github/workflows/docker_release.yml +++ b/.github/workflows/docker_release.yml @@ -3,7 +3,7 @@ name: Build and Push Docker Image # when to run the workflow on: push: - branches: [release] + branches: [master] # the jobs to run jobs: