Attention: Data Proxy will be migrated from SWIFT to S3 storage at Friday, the 9th of May 2025 starting from 9pm CEST (my timezone). For more details, please join the rocket chat channel https://chat.ebrains.eu/channel/data-proxy-user-group


Changes for page User documentation

Last modified by alexisdurieux on 2022/01/27 15:00

From version 7.1
edited by alexisdurieux
on 2022/01/27 14:53
Change comment: There is no comment for this version
To version 1.1
edited by evareill
on 2021/04/28 11:57
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.alexisdurieux
1 +XWiki.evareill
Content
... ... @@ -17,6 +17,8 @@
17 17  
18 18  Why does each service provider need a Fenix service account? The reason is that the Principal Investigator who gets the Fenix service account is legally responsible for the jobs being run on the supercomputers and for not enabling the end-user to run unintended executables.
19 19  
20 +[[image:HPC Job Proxy diagram.jpg]]
21 +
20 20  == Use case ==
21 21  
22 22  1. Bob wants to do use an EBRAINS Application that requires supercomputing.
... ... @@ -38,10 +38,12 @@
38 38  1. The HPC Job Proxy logs the job results, and pushes the actual cost of the job run for Bob to the EBRAINS Quota Manager.
39 39  1. The HPC Job Proxy notifies the Application of the results of the job.
40 40  
43 +
41 41  == Sample transaction diagram ==
42 42  
43 -[[image:Collabs.ebrains-unicore-job-proxy.User documentation.WebHome@ebrains-job-proxy-Job sequence.png]]
46 +[[image:ebrains-job-proxy-Job sequence.png]]
44 44  
48 +
45 45  == API of the HPC Job Proxy ==
46 46  
47 47  The API provides 3 endpoints described below. The Swagger documentation for the API is available here.
... ... @@ -48,7 +48,7 @@
48 48  
49 49  * Submit a job: **POST /api/jobs/**
50 50  
51 -To submit a job to the proxy, you need to provide the following information as part of the POST JSON body:
55 +​​​​​​​To submit a job to the proxy, you need to provide the following information as part of the POST JSON body:
52 52  
53 53  * **job_def** - JSON: The Unicore job definition. For more information, please visit the [[__Unicore documentation__>>url:https://sourceforge.net/p/unicore/wiki/Job_Description/]]
54 54  * **site** - string: The Fenix site on which to run the job.
... ... @@ -68,6 +68,7 @@
68 68  JURON
69 69  )))
70 70  
75 +
71 71  * Fetch a job's details: **GET /api/jobs/<job_id>**
72 72  
73 73  The proxy will query Unicore on-the-fly for the job’s latest details. Fenix sites retain the information of past jobs for a set amount of days (30 days at CSCS). If the request is made after that delay, the information returned is that which has been stored in the HPC Job Proxy. The full information retrieved and stored is the following:
... ... @@ -91,9 +91,9 @@
91 91  {{/code}}
92 92  {{/info}}
93 93  
94 -* Fetch a file present in the job's execution directory: **GET /api/jobs/<job_id>/<filename>**
99 +* Fetch a job's file: **GET /api/jobs/<job_id>/<filename>**
95 95  
96 -​​​​​​​Out of convenience, you can fetch the files that are present in the job's execution directory. The output, error and exit code of a job are placed by Unicore in the job’s working directory. The filenames available are: stdout, stderr, UNICORE_SCRIPT_EXIT_CODE. If the job has pre commands or post commands, the following filenames are also available: stdout and stderr respectively under the folders .UNICORE_POST_0/ or .UNICORE_PRE_0/. If your job is creating files than they are too available to be fetched.
101 +​​​​​​​Out of convenience, you can fetch the output of a job (placed by Unicore in the job’s working directory). The filenames available are: stdout, stderr, UNICORE_SCRIPT_EXIT_CODE. If the job has pre commands or post commands, the following filenames are also available: stdout and stderr respectively under the folders .UNICORE_POST_0/ or .UNICORE_PRE_0/
97 97  
98 98  The proxy will respond with the //raw content// of the requested file. These files are available as long as the site does not delete them (30 days for CSCS PIZ DAINT).
99 99  
... ... @@ -101,7 +101,7 @@
101 101  
102 102  == Sample usage ==
103 103  
104 -[[A Jupyter Notebook provides sample code for the Application’s access to the HPC Job Proxy.>>https://lab.ch.ebrains.eu/user-redirect/lab/tree/shared/EBRAINS%20HPC%20job%20proxy/HPC_job_proxy_usage.ipynb]]
109 +A Jupyter Notebook provides sample code for the Application’s access to the HPC Job Proxy.
105 105  
106 106  == Source code ==
107 107  
... ... @@ -113,13 +113,13 @@
113 113  
114 114  Your application needs an EBRAINS IAM service account. You should contact EBRAINS __support__ to create it. You will need to provide a username and an email address which is not linked to another EBRAINS account. The mapping between the EBRAINS service account and the Fenix service account is done automatically based on the linked email addresses which need to be identical.
115 115  
116 -Your application needs an EBRAINS IAM OIDC client. See the [[__instructions__>>https://wiki.ebrains.eu/bin/view/Collabs/the-collaboratory/Documentation%20IAM/FAQ/OIDC%20Clients%20explained/1.%20Registering%20an%20OIDC%20client/#HCreatingyourOpenIDConnectclient]].
121 +Your application needs an EBRAINS IAM OIDC client. See the __instructions__.
117 117  
118 -Your application needs a Fenix project and a Fenix service account. See the [[__instructions__>>https://fenix-ri.eu/access]] to get a project. Then the Principal Investigator in your lab can request a Fenix service account via EBRAINS [[__support__>>https://ebrains.eu/support/]].
123 +Your application needs a Fenix project and a Fenix service account. See the __instructions__ to get a project. Then the Principal Investigator in your lab can request a Fenix service account via EBRAINS __support__.
119 119  
120 -Then in your app, you should retrieve the access token linked to your service account user. This requires the OIDC client ID, client Secret, EBRAINS service account's username and password. See the [[__instructions__>>https://wiki.ebrains.eu/bin/view/Collabs/the-collaboratory/Documentation%20IAM/FAQ/OIDC%20Clients%20explained/1.%20Registering%20an%20OIDC%20client/#HFetchingyourdeveloperaccesstoken]].
125 +Then in your app, you should retrieve the access token linked to your service account user. This requires the OIDC client ID, client Secret, EBRAINS service account's username and password. See the __instructions__.
121 121  
122 -When requesting a job on behalf of an end-user, your app gives this access token in the field "**user_info**" of the payload alongside the job request. Note that the access token expires (typically after one week), so your application should generate a new token.
127 +When requesting a job on behalf of an end user, your app gives this access token in the field "**user_info**" of the payload alongside the job request. Note that the access token expires (typically after one week), so your application should generate a new token. See the __instructions__.
123 123  
124 124  
125 125  __Example__: