Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into upstream_nase
Browse files Browse the repository at this point in the history
  • Loading branch information
poshul committed Jul 2, 2024
2 parents 5fdb824 + 3dcbe0c commit 7375d38
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build-windows-executable-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: OpenMS/OpenMS
ref: release/${{ env.OPENMS_VERSION }}
path: 'OpenMS'

- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2' # 5.12.7 is broken https://bugreports.qt.io/browse/QTBUG-81715, > 5.15.2 is not available on official archives (https://github.com/miurahr/aqtinstall/issues/636)
host: 'windows' # default: win64_msvc2017_64
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Cache contrib
id: cache-contrib-win
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/OpenMS/contrib
key: ${{ runner.os }}-contrib3
Expand All @@ -77,7 +77,7 @@ jobs:
ls
- name: Setup ccache cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-ccache-${{ env.RUN_NAME }}-${{ github.run_number }}
Expand Down Expand Up @@ -144,13 +144,13 @@ jobs:
BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}"

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

- name: Upload share as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: OpenMS-share
path: OpenMS/share
Expand All @@ -164,16 +164,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Download share as artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: OpenMS-share
path: share
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
cp app.py streamlit_exe
- name: Delete OpenMS bin artifact
uses: geekyeggo/delete-artifact@v2
uses: geekyeggo/delete-artifact@v4
with:
name: OpenMS-bin

Expand All @@ -232,7 +232,7 @@ jobs:
7z a OpenMS-App.zip ./streamlit_exe/* -r
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: OpenMS-App
path: OpenMS-App.zip
Expand Down
3 changes: 2 additions & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
developmentMode = false

[server]
port = 8502
port = 8501 # should be same as configured in deployment repo
maxUploadSize = 500


[theme]

# The preset Streamlit theme that your custom theme inherits from. One of "light" or "dark".
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ COPY src/ /app/src
COPY assets/ /app/assets
COPY example-data/ /app/example-data
COPY pages/ /app/pages
# For streamlit configuration
COPY .streamlit/config.toml /app/.streamlit/config.toml
COPY clean-up-workspaces.py /app/clean-up-workspaces.py

# add cron job to the crontab
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile_simple
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ COPY src/ /app/src
COPY assets/ /app/assets
COPY example-data/ /app/example-data
COPY pages/ /app/pages
# For streamlit configuration
COPY .streamlit/config.toml /app/.streamlit/config.toml

COPY clean-up-workspaces.py /app/clean-up-workspaces.py

Expand Down
78 changes: 78 additions & 0 deletions pages/4_📖_Windows_executable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import streamlit as st
import requests

import streamlit as st

# Define CSS styles
css = '''
<style>
/* Add space between tabs */
.stTabs [data-baseweb="tab-list"] button {
margin-right: 20px;
border-radius: 5px;
transition: background-color 0.3s ease, color 0.3s ease; /* Add smooth transition */
}
/* Style active tab */
.stTabs [data-baseweb="tab-list"] button:focus {
background-color: #f0f0f0; /* Change background color of active tab */
color: #333333; /* Change text color of active tab */
border-width: 3px; /* Increase thickness of blue line */
}
/* Style tab text */
.stTabs [data-baseweb="tab-list"] button [data-testid="stMarkdownContainer"] p {
font-size: 2rem;
font-weight: bold;
}
/* Add hover effect */
.stTabs [data-baseweb="tab-list"] button:hover {
background-color: #f8f8f8; /* Change background color on hover */
}
</style>
'''


st.markdown(css, unsafe_allow_html=True)

st.markdown("""
# 💻 How to package everything for Windows executables
This guide explains how to package OpenMS apps into Windows executables using two different methods:
""")

def fetch_markdown_content(url):
response = requests.get(url)
if response.status_code == 200:
# Remove the first line from the content
content_lines = response.text.split("\n")
markdown_content = "\n".join(content_lines[1:])
return markdown_content
else:
return None

tabs = ["embeddable Python", "PyInstaller"]
tabs = st.tabs(tabs)

# window executable with embeddable python
with tabs[0]:
markdown_url = "https://raw.githubusercontent.com/OpenMS/streamlit-template/main/win_exe_with_embed_py.md"

markdown_content = fetch_markdown_content(markdown_url)

if markdown_content:
st.markdown(markdown_content, unsafe_allow_html=True)
else:
st.error("Failed to fetch Markdown content from the specified URL.", markdown_url)

# window executable with pyinstaller
with tabs[1]:
# URL of the Markdown document
markdown_url = "https://raw.githubusercontent.com/OpenMS/streamlit-template/main/win_exe_with_pyinstaller.md"

markdown_content = fetch_markdown_content(markdown_url)

if markdown_content:
st.markdown(markdown_content, unsafe_allow_html=True)
else:
st.error("Failed to fetch Markdown content from the specified URL. ", markdown_url)


0 comments on commit 7375d38

Please sign in to comment.