Move SLURM script to jinja template

This commit is contained in:
Benoît Seignovert 2024-03-13 18:38:29 +01:00
parent d091a6fd99
commit 8217d63c41
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
7 changed files with 108 additions and 68 deletions

View file

@ -9,10 +9,11 @@ from pathlib import Path
from traceback import format_exc
from flask import Flask, render_template, request
from glicid_spawner.form import TEMPLATES, options_from_form
from glicid_spawner.form import options_from_form
from glicid_spawner.micromamba import MicromambaEnv
from glicid_spawner.resources import CPU, MEMORY, get_folders, gpu_max_duration
from glicid_spawner.slurm import gres, sinfo_from_file
from glicid_spawner.templates import render_template as glicid_template
from livereload import Server
# Dummy username and python environments
@ -58,7 +59,7 @@ def home():
"""Form spawner home page."""
return render_template(
'form.html',
spawner_options_form=TEMPLATES.get_template('spawner_form.jinja').render(**OPTIONS),
spawner_options_form=glicid_template('spawner_form.jinja', **OPTIONS),
options=OPTIONS,
)