Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install all dependencies #68

Merged
merged 46 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
178d863
add packaging step
t0mdavid-m Jun 29, 2024
5263bec
use package instead of bin share artifacts
t0mdavid-m Jun 29, 2024
ffd2ed5
add topp tool selection
t0mdavid-m Jun 29, 2024
46ce7c3
copy dlls and create folder
t0mdavid-m Jun 29, 2024
0414325
update delete artifact
t0mdavid-m Jul 2, 2024
3f340bb
adjust packaging flags
t0mdavid-m Jul 4, 2024
f7b12e6
temporarily point to develop
t0mdavid-m Aug 13, 2024
6a0ec70
Merge branch 'only_copy_required_topp_tools' into install_all_depende…
t0mdavid-m Aug 13, 2024
7e06811
update openms version
t0mdavid-m Sep 25, 2024
b132484
Merge branch 'main' into install_all_dependencies
t0mdavid-m Sep 25, 2024
1096eb8
fix ref
t0mdavid-m Sep 25, 2024
ba646be
fix build path
t0mdavid-m Sep 25, 2024
e72f64e
update changed variable name
t0mdavid-m Sep 25, 2024
ec6b928
fix tests
t0mdavid-m Sep 25, 2024
875ba46
swap test and package steps
t0mdavid-m Sep 25, 2024
f8f0e82
switch to experimental branch
t0mdavid-m Nov 12, 2024
9f60ddc
Revert "switch to experimental branch"
t0mdavid-m Nov 14, 2024
4bfaeee
disable gui
t0mdavid-m Nov 15, 2024
c26c871
Merge remote-tracking branch 'origin/main' into install_all_dependencies
t0mdavid-m Nov 19, 2024
e21c253
fix gdpr consent
t0mdavid-m Nov 19, 2024
875085c
add settings json
t0mdavid-m Nov 20, 2024
865c150
add default json
t0mdavid-m Nov 20, 2024
910c72d
add debug
t0mdavid-m Nov 20, 2024
f746c4b
update name
t0mdavid-m Nov 20, 2024
ddaa5e5
update run conditions
t0mdavid-m Nov 20, 2024
c12a2a7
remove dependency
t0mdavid-m Nov 20, 2024
afd7599
fix pattern
t0mdavid-m Nov 20, 2024
8c5525e
fix
t0mdavid-m Nov 20, 2024
c0f91e7
should run now
t0mdavid-m Nov 20, 2024
f9eb657
fix syntax
t0mdavid-m Nov 20, 2024
ee6ac95
remember that we are on windows
t0mdavid-m Nov 20, 2024
fc3138f
update as artifact
t0mdavid-m Nov 20, 2024
ff81a6f
downgrade pyopenms
t0mdavid-m Nov 20, 2024
0f21a8f
use powershell
t0mdavid-m Nov 20, 2024
f483169
include folders
t0mdavid-m Nov 20, 2024
e907c87
use powershell again
t0mdavid-m Nov 20, 2024
f70c3bd
fix weird pyopenms bug
t0mdavid-m Nov 20, 2024
1ca0186
move files outside bin
t0mdavid-m Nov 20, 2024
2ac9ab9
adjust topp tools
t0mdavid-m Nov 20, 2024
9585b47
add docs folder to win installer folder
Arslan-Siraj Nov 20, 2024
3e99aa5
Update build-windows-executable-app-with-pyinstaller.yaml:: docs fold…
Arslan-Siraj Nov 20, 2024
5599c42
remove bin and equalize with pyinstaller
t0mdavid-m Nov 21, 2024
19fd5ef
remove gdpr for local files
t0mdavid-m Nov 21, 2024
01fd515
ensure that offline deployment is selected
t0mdavid-m Nov 21, 2024
9d67f28
fixup! remove gdpr for local files
t0mdavid-m Nov 21, 2024
a7ba5dd
adjust settings mod to powershell
t0mdavid-m Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Build executable for Windows with pyinstaller
on:
workflow_dispatch:
env:
OPENMS_VERSION: 3.2.0
# Define needed TOPP tools here
TOPP_TOOLS: "FeatureFinderMetabo MetaboliteAdductDecharger SiriusExport"

jobs:
build-openms:
runs-on: windows-latest

env:
OPENMS_VERSION: 3.0.0

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -130,6 +131,17 @@ jobs:
CCACHE_COMPRESSLEVEL: 12
CCACHE_MAXSIZE: 400M

- name: Package
shell: bash
run: |
ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/cipackage.cmake
env:
SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS"
PACKAGE_TYPE: zip
SEARCH_ENGINES_DIRECTORY: "${{ github.workspace }}/_thirdparty"
CI_PROVIDER: "GitHub-Actions"
CPACK_PACKAGE_FILE_NAME: "openms-package"

- name: Test Windows
shell: bash
run: $LAUNCHER ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/citest.cmake
Expand All @@ -139,17 +151,11 @@ jobs:
CI_PROVIDER: "GitHub-Actions"
BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}"

- name: Upload TOPP tools as artifact
uses: actions/upload-artifact@v3
- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: OpenMS-bin
path: OpenMS/bld/bin

- name: Upload share as artifact
uses: actions/upload-artifact@v3
with:
name: OpenMS-share
path: OpenMS/share
name: openms-package
path: ${{ github.workspace }}/OpenMS/bld/*.zip

build-executable:
runs-on: windows-latest
Expand All @@ -162,17 +168,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Download TOPP tools as artifact
uses: actions/download-artifact@v3
- name: Download package as artifact
uses: actions/download-artifact@v4
with:
name: OpenMS-bin
path: openms-bin
name: openms-package
path: openms-package

- name: Download share as artifact
uses: actions/download-artifact@v3
with:
name: OpenMS-share
path: share
- name: Extract bin and share from package
run: |
cd openms-package
unzip "*.zip" -d .
cp -r openms-package/bin ../openms-bin
cp -r openms-package/share ../share

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -213,17 +220,34 @@ jobs:
call myenv\Scripts\activate.bat
pyinstaller --onefile --additional-hooks-dir ./hooks run_app.py --clean

- name: Set to offline deployment
run: |
$content = Get-Content -Raw settings.json | ConvertFrom-Json
$content.online_deployment = $false
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json

- name: Copy everything to dist directory
run: |
cp -r .streamlit dist/.streamlit
cp -r content dist/content
cp -r src dist/src
cp -r assets dist/assets
cp -r example-data dist/example-data
cp -r openms-bin dist/bin
cp -r share dist/share
cp app.py dist/
mkdir streamlit_exe

mv python-${{ env.PYTHON_VERSION }} streamlit_exe
mv run_app.bat streamlit_exe
cp -r src streamlit_exe
cp -r content streamlit_exe
cp -r docs streamlit_exe
cp -r assets streamlit_exe
cp -r example-data streamlit_exe
cp openms-bin/*.dll streamlit_exe
cp -r .streamlit streamlit_exe
cp -r share streamlit_exe/share
cp app.py streamlit_exe
cp settings.json streamlit_exe
cp default-parameters.json streamlit_exe

$files = $env:TOPP_TOOLS -split ' '
foreach ($file in $files) {
Copy-Item "openms-bin/${file}.exe" -Destination "streamlit_exe/${file}.exe"
}

- name: Modify .spec file
shell: bash
Expand All @@ -236,15 +260,10 @@ jobs:
call myenv\Scripts\activate.bat
pyinstaller run_app.spec --clean

- name: Delete OpenMS bin artifact
uses: geekyeggo/delete-artifact@v2
with:
name: OpenMS-bin

- name: Delete OpenMS share artifact
uses: geekyeggo/delete-artifact@v2
- name: Delete OpenMS package artifact
uses: geekyeggo/delete-artifact@v5
with:
name: OpenMS-share
name: openms-package

- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
78 changes: 47 additions & 31 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
OPENMS_VERSION: 3.2.0
# Define needed TOPP tools here
TOPP_TOOLS: "FeatureFinderMetabo FeatureLinkerUnlabeledKD SiriusExport"

jobs:
build-openms:
runs-on: windows-latest

env:
OPENMS_VERSION: 3.0.0

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -112,15 +113,15 @@ jobs:
ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/cibuild.cmake
env:
#OS_PREFIX_PATH: "${{ env.Qt5_DIR }}/lib/cmake;${{ env.Qt5_DIR }}"
CONTRIB_BUILD_DIRECTORY: "${{ github.workspace }}/OpenMS/contrib"
OPENMS_CONTRIB_LIBS: "${{ github.workspace }}/OpenMS/contrib"
CI_PROVIDER: "GitHub-Actions"
CMAKE_GENERATOR: "Ninja"
SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS"
BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}"
ENABLE_STYLE_TESTING: "OFF"
ENABLE_TOPP_TESTING: "ON"
ENABLE_CLASS_TESTING: "ON"
WITH_GUI: "ON"
WITH_GUI: "OFF"
ADDRESS_SANITIZER: "Off"
BUILD_TYPE: "Release"
OPENMP: "Off"
Expand All @@ -136,24 +137,28 @@ jobs:

- name: Test Windows
shell: bash
run: $LAUNCHER ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/citest.cmake
run: ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/citest.cmake
env:
LAUNCHER: ""
SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS"
CI_PROVIDER: "GitHub-Actions"
BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}"

- name: Upload TOPP tools as artifact
uses: actions/upload-artifact@v4
with:
name: OpenMS-bin
path: OpenMS/bld/bin
- name: Package
shell: bash
run: |
ctest --output-on-failure -V -S $GITHUB_WORKSPACE/OpenMS/tools/ci/cipackage.cmake
env:
SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS"
PACKAGE_TYPE: zip
SEARCH_ENGINES_DIRECTORY: "${{ github.workspace }}/_thirdparty"
CI_PROVIDER: "GitHub-Actions"
CPACK_PACKAGE_FILE_NAME: "openms-package"

- name: Upload share as artifact
- name: Upload package as artifact
uses: actions/upload-artifact@v4
with:
name: OpenMS-share
path: OpenMS/share
name: openms-package
path: ${{ github.workspace }}/OpenMS/bld/*.zip

build-executable:
runs-on: windows-latest
Expand All @@ -166,17 +171,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Download TOPP tools as artifact
- name: Download package as artifact
uses: actions/download-artifact@v4
with:
name: OpenMS-bin
path: openms-bin
name: openms-package
path: openms-package

- name: Download share as artifact
uses: actions/download-artifact@v4
with:
name: OpenMS-share
path: share
- name: Extract bin and share from package
run: |
cd openms-package
unzip "*.zip" -d .
cp -r openms-package/bin ../openms-bin
cp -r openms-package/share ../share

- name: Setup python embeddable version
run: |
Expand All @@ -202,30 +208,40 @@ jobs:
run: |
echo '@echo off' > run_app.bat
echo '.\\python-${{ env.PYTHON_VERSION }}\\python -m streamlit run app.py local' >> run_app.bat


- name: Set to offline deployment
run: |
$content = Get-Content -Raw settings.json | ConvertFrom-Json
$content.online_deployment = $false
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json

- name: Create All-in-one executable folder
run: |
mkdir streamlit_exe

mv python-${{ env.PYTHON_VERSION }} streamlit_exe
mv run_app.bat streamlit_exe
cp -r src streamlit_exe
cp -r content streamlit_exe
cp -r docs streamlit_exe
cp -r assets streamlit_exe
cp -r example-data streamlit_exe
cp openms-bin/*.dll streamlit_exe
cp -r .streamlit streamlit_exe
cp -r openms-bin streamlit_exe/bin
cp -r share streamlit_exe/share
cp app.py streamlit_exe
cp settings.json streamlit_exe
cp default-parameters.json streamlit_exe

- name: Delete OpenMS bin artifact
uses: geekyeggo/delete-artifact@v5
with:
name: OpenMS-bin
$files = $env:TOPP_TOOLS -split ' '
foreach ($file in $files) {
Copy-Item "openms-bin/${file}.exe" -Destination "streamlit_exe/${file}.exe"
}

- name: Delete OpenMS share artifact
- name: Delete OpenMS bin artifact
uses: geekyeggo/delete-artifact@v5
with:
name: OpenMS-share
name: openms-package

- name: Compress streamlit_exe folder to OpenMS-App.zip
run: |
Expand Down
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import streamlit as st
from pathlib import Path
# For some reason the windows version only works if this is imported here
import pyopenms

if __name__ == '__main__':
pages = {
Expand Down
4 changes: 1 addition & 3 deletions src/common/captcha_.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import os


consent_component = st_components.declare_component("gdpr_consent", path=Path("gdpr_consent"))


def delete_all_pages(main_script_path_str: str) -> None:
"""
Delete all pages except the main page from an app's configuration.
Expand Down Expand Up @@ -203,6 +200,7 @@ def captcha_control():
ga = st.session_state.settings['analytics']['google-analytics']['enabled']
pp = st.session_state.settings['analytics']['piwik-pro']['enabled']
if (ga or pp) and (st.session_state.tracking_consent is None):
consent_component = st_components.declare_component("gdpr_consent", path=Path("gdpr_consent"))
with st.spinner():
# Ask for consent
st.session_state.tracking_consent = consent_component(
Expand Down
Loading