Skip to content
Snippets Groups Projects
Verified Commit 82ad8087 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Set workflow parameters as CLI parameters

#46
parent e4009ede
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ repos: ...@@ -21,7 +21,7 @@ repos:
files: app files: app
args: [--check] args: [--check]
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.286' rev: 'v0.0.287'
hooks: hooks:
- id: ruff - id: ruff
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
......
...@@ -160,8 +160,7 @@ async def start_workflow_execution( ...@@ -160,8 +160,7 @@ async def start_workflow_execution(
nextflow_command = nextflow_command_template.render( nextflow_command = nextflow_command_template.render(
repo=git_repo, repo=git_repo,
params_file_name=params_file_name, parameters=parameters,
params_mount_path=settings.PARAMS_BUCKET_MOUNT_PATH,
execution_id=execution.execution_id, execution_id=execution.execution_id,
configuration=settings.NX_CONFIG, configuration=settings.NX_CONFIG,
nx_bin=settings.NX_BIN, nx_bin=settings.NX_BIN,
......
import logging
import httpx
from fastapi import status
from tenacity import after_log, before_log, retry, stop_after_attempt, wait_fixed
from app.core.config import settings
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
max_tries = 60 * 3 # 3 minutes
wait_seconds = 2
@retry(
stop=stop_after_attempt(max_tries),
wait=wait_fixed(wait_seconds),
before=before_log(logger, logging.INFO),
after=after_log(logger, logging.WARN),
)
def init() -> None:
headers = {"X-SLURM-USER-TOKEN": settings.SLURM_TOKEN, "X-SLURM-USER-NAME": settings.SLURM_USER}
try:
response = httpx.get(
f"{settings.SLURM_ENDPOINT}slurm/v0.0.38/ping", timeout=5.0, follow_redirects=False, headers=headers
)
assert response.status_code == status.HTTP_200_OK
except Exception as e:
logger.error(e)
raise e
def main() -> None:
logger.info("Check Slurm Cluster connection")
init()
logger.info("Slurm Cluster connection established")
if __name__ == "__main__":
main()
...@@ -17,4 +17,6 @@ ${nx_bin} run ${repo.repo_url} \ ...@@ -17,4 +17,6 @@ ${nx_bin} run ${repo.repo_url} \
-c ${configuration} \ -c ${configuration} \
% endif % endif
-revision ${repo.git_commit_hash} \ -revision ${repo.git_commit_hash} \
-params-file ${params_mount_path}/${params_file_name} % for param_name, param_value in parameters.items():
--${param_name} "${param_value}" \
% endfor
...@@ -12,4 +12,4 @@ mypy>=1.5.0,<1.6.0 ...@@ -12,4 +12,4 @@ mypy>=1.5.0,<1.6.0
boto3-stubs-lite[s3]>=1.28.0,<1.29.0 boto3-stubs-lite[s3]>=1.28.0,<1.29.0
types-requests types-requests
# Miscellaneous # Miscellaneous
pre-commit>=3.3.0,<3.4.0 pre-commit>=3.4.0,<3.5.0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
clowmdb>=2.2.0,<2.3.0 clowmdb>=2.2.0,<2.3.0
# Webserver packages # Webserver packages
anyio>=3.7.0,<3.8.0 anyio>=3.7.0,<4.0.0
fastapi>=0.103.0,<0.104.0 fastapi>=0.103.0,<0.104.0
pydantic>=2.3.0,<2.4.0 pydantic>=2.3.0,<2.4.0
pydantic-settings pydantic-settings
......
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
# Check Connection to Ceph RGW # Check Connection to Ceph RGW
python app/check_ceph_connection.py python app/check_ceph_connection.py
# Check Connection to Slurm Cluster
python app/check_slurm_connection.py
# Let the DB start # Let the DB start
python app/check_database_connection.py python app/check_database_connection.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment