Web UI with FirecREST¶
Goal¶
Create a Flask web application that interfaces HPC services at CSCS using the FirecREST API.
Edit src/client.py and replace the body of every function with the _with_f7t suffix using PyFirecREST (recommended) or the FirecREST API directly.
Prerequisites¶
Configuration¶
-
Copy and edit the configuration file:
-
Fill in your credentials in
config.py:class DevConfig(Config): OIDC_CLIENT_ID = "<CLIENT_ID>" OIDC_CLIENT_SECRET = "<CLIENT_SECRET>" USER_GROUP = "<GROUP>" OIDC_AUTH_BASE_URL = "https://auth.cscs.ch" OIDC_AUTH_REALM = "firecrest-clients" FIRECREST_URL = "https://api.cscs.ch/hpc/firecrest/v2" SYSTEM_NAME = "daint" SYSTEM_RESERVATION = "<RESERVATION>"
Tip
For debugging, leave the default values for SBATCH_TEMPLATE, PROBLEM_INI_FILE, PROBLEM_MSH_FILE, and POST_TEMPLATE.
For a real test case, use:
PROBLEM_INI_FILE = 'inc-cylinder.ini'
PROBLEM_MSH_FILE = 'inc-cylinder.msh'
SBATCH_TEMPLATE = "cylinder.sh.tmpl"
POST_TEMPLATE = "post_proc.sh.tmpl"
Build and Run¶
Note
The Makefile uses the docker command. To use podman instead, replace docker with podman in the Makefile.
The application runs at http://localhost:9091. Logs are written to log/client.log:
Using the Application¶
- Open http://localhost:9091 in your browser.
- Set the simulation parameters (number of steps, nodes, job name, etc.).
- Click Submit Jobs to run the simulation. New jobs appear in the list and result files in the working directory.
- Click Start Postprocessing to launch a post-processing job and view the animated GIF result.