Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MLWorkflowInterface
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
DestinE
MLWorkflowInterface
Commits
d7876758
Commit
d7876758
authored
1 year ago
by
Sabine Schröder
Browse files
Options
Downloads
Patches
Plain Diff
EURAD-IM job on Jureca's ecflow is triggered from GUI
parent
da4be06d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pages/dashboard.py
+28
-4
28 additions, 4 deletions
src/pages/dashboard.py
with
28 additions
and
4 deletions
src/pages/dashboard.py
+
28
−
4
View file @
d7876758
...
...
@@ -14,7 +14,13 @@ from eurad_plot import get_euradim_plot, get_timeseries_plot
import
os
import
zipfile
from
cryptography.fernet
import
Fernet
from
deployment_settings
import
key
import
pyunicore.client
as
uc_client
import
pyunicore.credentials
as
uc_credentials
from
deployment_settings
import
(
KEY
,
UNICORE_BASE
,
UFTP_BASE
,
UNICORE_USER
,
UNICORE_PASSWORD
)
# the following should be done with static files!
APP_HOME
=
Path
.
cwd
()
...
...
@@ -612,7 +618,7 @@ def create_jobs_tab(language_id=0):
),
dbc
.
ModalFooter
([
dbc
.
Button
(
f
"
{
run_label
[
language_id
]
}
"
,
id
=
f
"
{
modal
[
'
id
'
]
}
run
"
,
class_name
=
"
fzj_style_btn
"
,
n_clicks
=
0
f
"
{
run_label
[
language_id
]
}
"
,
id
=
f
"
{
modal
[
'
id
'
]
}
_
run
"
,
class_name
=
"
fzj_style_btn
"
,
n_clicks
=
0
),
dbc
.
Button
(
f
"
{
close_label
[
language_id
]
}
"
,
id
=
f
"
{
modal
[
'
id
'
]
}
_close
"
,
class_name
=
"
fzj_style_btn
"
,
n_clicks
=
0
...
...
@@ -805,7 +811,7 @@ def login_open(lb_click, lc_click, name, password):
if
not
user
:
return
no_update
,
no_update
,
no_update
,
no_update
,
dbc
.
Alert
([
"
No such user!
"
],
color
=
"
danger
"
)
else
:
fernet
=
Fernet
(
key
)
fernet
=
Fernet
(
KEY
)
db_password
=
fernet
.
decrypt
(
user
[
1
]).
decode
()
if
db_password
==
password
:
language_id
=
user
[
2
]
...
...
@@ -855,9 +861,10 @@ def get_user_id(user_dict):
@callback
(
Output
(
"
eurad_im_modal
"
,
"
is_open
"
),
Output
(
"
eurad_im_modal
"
,
"
is_open
"
,
allow_duplicate
=
True
),
Input
(
"
eurad_im_open
"
,
"
n_clicks
"
),
Input
(
"
eurad_im_close
"
,
"
n_clicks
"
),
prevent_initial_call
=
True
)
def
eurad_im_modal
(
open_button
,
close_button
):
if
ctx
.
triggered_id
==
"
eurad_im_open
"
:
...
...
@@ -866,6 +873,23 @@ def eurad_im_modal(open_button, close_button):
return
False
@callback
(
Output
(
"
eurad_im_modal
"
,
"
is_open
"
,
allow_duplicate
=
True
),
Input
(
"
eurad_im_run
"
,
"
n_clicks
"
),
prevent_initial_call
=
True
)
def
eurad_im_job_run
(
run_button
):
base_url
=
f
"
{
UNICORE_BASE
}
JURECA/rest/core
"
credentials
=
uc_credentials
.
UsernamePassword
(
UNICORE_USER
,
UNICORE_PASSWORD
)
client
=
uc_client
.
Client
(
credentials
,
base_url
)
job_description
=
{
'
Executable
'
:
"
/p/project/cjicg21/schroeder5/Destine_AQ/start_destine_demonstrator.sh
"
,
"
Job type
"
:
"
ON_LOGIN_NODE
"
,
'
Arguments
'
:[],
}
job
=
client
.
new_job
(
job_description
)
if
ctx
.
triggered_id
==
"
eurad_im_open
"
:
return
True
else
:
return
False
@callback
(
Output
(
"
eurad_im_download_result
"
,
"
data
"
),
Input
(
"
eurad_im_output_download
"
,
"
n_clicks
"
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment