Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
- name: Verify Streamlit app
run: |
timeout 10s streamlit run index.py || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.nf-env
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pandas==2.2.3
paramiko==3.5.0
paramiko>3.5.0
streamlit==1.39.0
pre-commit==4.0.1
pyalma @ git+https://github.com/ICR-RSE-Group/pyalma.git@main
41 changes: 0 additions & 41 deletions shared/ssh.py

This file was deleted.

18 changes: 10 additions & 8 deletions tabs/tab_command.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import datetime
from contextlib import contextmanager, redirect_stdout
from io import StringIO

import pandas as pd
import streamlit as st

# Initialize session state variables
if "run_pipeline_clicked" not in st.session_state:
st.session_state.run_pipeline_clicked = False
if "check_queue" not in st.session_state:
st.session_state.check_queue = False


@contextmanager
Expand Down Expand Up @@ -77,22 +77,24 @@ def run_nextflow(): # username, MY_SSH, selected_pipeline, selected_project):
) # develop this
st.write("Command used:")
st.code(cmd_pipeline)
out_str, err_str = MY_SSH.run_cmd(cmd_pipeline, string=True)
_dict = MY_SSH.run_cmd(cmd_pipeline)

def check_queue(): # username):
st.session_state.check_queue = True

if st.session_state.check_queue:
cmd_pipeline = pipe_cmd(username, None, None, cmd_num=1)
st.write("Command used:")
st.code(cmd_pipeline)
out_str, err_str = MY_SSH.run_cmd(cmd_pipeline, string=True)
if err_str == "":
_dict = MY_SSH.run_cmd(cmd_pipeline)
if _dict["err"] == None:
st.write("Output:")
st.code(out_str)
st.code(_dict["output"])
st.write(
"If you see '***' job on compute node, that suggests that the job has been sent to the cluster (in the queue (PD) or running (R))"
)

else:
st.error(err_str)
st.error(_dict["err"])

left_column, right_column = st.columns(2)
# disable button once the user click a first time. by default it gets disabled after calling the callback
Expand Down
21 changes: 8 additions & 13 deletions tabs/tab_logon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from io import StringIO

import streamlit as st

import shared.ssh as ssh
from pyalma import LocalFileReader, SshClient


@contextmanager
Expand Down Expand Up @@ -41,21 +40,17 @@ def tab():
OK = True
else:
with st.spinner("Validating login"):
MY_SSH = ssh.SshConnection("remote", username, password, server=server)

MY_SSH = SshClient(server, username, password)
print("Validating login...")
cmd = "cd ~ && ls -l1"
results_str, error_str = MY_SSH.run_cmd(cmd)

if error_str:
print("Errors", error_str)
else:
print("Session validated successfully")

OK = error_str == ""
_dict = MY_SSH.run_cmd("cd ~ &ls -l")
OK = _dict["err"] is None
if OK:
print("Session validated successfully")
st.success("Session validated successfully")
else:
st.error("Correct login details and try again")
print("Errors", _dict["err"])
err_msg = "Connection failed: " + _dict["err"]
st.error(err_msg)

return OK, MY_SSH, username
6 changes: 2 additions & 4 deletions views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import tabs.tab_logon as tl

header = """
<span style="color:black;">
<img src="https://www.icr.ac.uk/assets/img/logo.png"
alt="icr" width="200px"></span><span style=
<span style=
"color:darkred;font-size:40px;"> -🍃 </span><span style=
"color:green;font-size:40px;">RUN-NEXTFLOW</span><span style=
"color:green;font-size:40px;">RUN NEXTFLOW on ALMA</span><span style=
"color:darkred;font-size:40px;">🍃- </span>
"""
st.markdown(header, unsafe_allow_html=True)
Expand Down
6 changes: 2 additions & 4 deletions views/run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ def reset_button_state():


header = """
<span style="color:black;">
<img src="https://www.icr.ac.uk/assets/img/logo.png"
alt="icr" width="200px"></span><span style=
<span style=
"color:darkred;font-size:40px;"> -🍃 </span><span style=
"color:green;font-size:40px;">RUN-NEXTFLOW</span><span style=
"color:green;font-size:40px;">RUN NEXTFLOW on ALMA</span><span style=
"color:darkred;font-size:40px;">🍃- </span>
"""
st.markdown(header, unsafe_allow_html=True)
Expand Down