Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hattivatti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GDP-Public
hattivatti
Commits
fea1db89
Commit
fea1db89
authored
1 year ago
by
Benjamin Wingfield
Browse files
Options
Downloads
Patches
Plain Diff
add namespace to workflow-monitor
parent
5e3db761
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/templates/callback.txt
+3
-1
3 additions, 1 deletion
data/templates/callback.txt
src/slurm/job.rs
+7
-4
7 additions, 4 deletions
src/slurm/job.rs
with
10 additions
and
5 deletions
data/templates/callback.txt
+
3
−
1
View file @
fea1db89
...
...
@@ -8,7 +8,9 @@ set -euxo pipefail
module load python-data/3.10-23.07
# run the monitor in the background
python3 {workflow_monitor_path} &
python3 {workflow_monitor_path} \
--callback_token $CALLBACK_TOKEN \
--namespace {namespace} &
# grab workflow monitor pid
workflow_monitor_pid=$!
...
...
This diff is collapsed.
Click to expand it.
src/slurm/job.rs
+
7
−
4
View file @
fea1db89
...
...
@@ -35,7 +35,7 @@ impl JobRequest {
fs
::
create_dir
(
&
instance_wd
.path
)
.expect
(
"Create working directory"
);
let
header
:
Header
=
render_header
(
&&
self
.pipeline_param
);
let
callback
:
Callback
=
render_callback
(
&&
self
.pipeline_param
);
let
callback
:
Callback
=
render_callback
(
&&
self
.pipeline_param
,
&
namespace
);
let
vars
:
EnvVars
=
read_environment_variables
();
let
workflow
:
Workflow
=
render_nxf
(
&
globus_path
,
&&
self
.pipeline_param
,
&
wd
.path
,
&
namespace
);
let
job
=
JobTemplate
{
header
,
callback
,
vars
,
workflow
};
...
...
@@ -159,7 +159,8 @@ struct NextflowContext {
#[derive(Serialize)]
struct
CallbackContext
{
name
:
String
,
workflow_monitor_path
:
String
workflow_monitor_path
:
String
,
namespace
:
String
}
/// Write nextflow parameters to working directory
...
...
@@ -233,7 +234,7 @@ fn render_nxf(globus_path: &PathBuf, param: &PipelineParam, work_dir: &Path, nam
}
/// Render the callback using TinyTemplate
fn
render_callback
(
param
:
&
PipelineParam
)
->
Callback
{
fn
render_callback
(
param
:
&
PipelineParam
,
namespace
:
&
PlatformNamespace
)
->
Callback
{
/// included callback template
static
CALLBACK
:
&
str
=
include_str!
(
concat!
(
env!
(
"CARGO_MANIFEST_DIR"
),
"/data/templates/callback.txt"
));
let
mut
tt
=
TinyTemplate
::
new
();
...
...
@@ -241,7 +242,9 @@ fn render_callback(param: &PipelineParam) -> Callback {
let
name
:
&
String
=
&
param
.id
;
static
WORKFLOW_MONITOR_PATH
:
&
str
=
"/scratch/project_2004504/bwingfield/workflow-monitor/main.py"
;
let
context
=
CallbackContext
{
name
:
name
.clone
(),
workflow_monitor_path
:
WORKFLOW_MONITOR_PATH
.to_string
()
};
workflow_monitor_path
:
WORKFLOW_MONITOR_PATH
.to_string
(),
namespace
:
namespace
.to_string
()
};
Callback
{
content
:
tt
.render
(
"callback"
,
&
context
)
.expect
(
"Rendered callback"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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