feat(application): add Environment field and inject into Slurm job submission
This commit is contained in:
@@ -276,6 +276,14 @@ func (s *TaskService) ProcessTask(ctx context.Context, taskID int64) error {
|
||||
}
|
||||
}
|
||||
|
||||
// 15a. Parse app environment
|
||||
var appEnv map[string]string
|
||||
if len(app.Environment) > 0 {
|
||||
if err := json.Unmarshal(app.Environment, &appEnv); err != nil {
|
||||
return fail(model.TaskStepSubmitting, fmt.Sprintf("parse application environment: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
// 16. Parse task values
|
||||
values := make(map[string]string)
|
||||
if len(task.Values) > 0 {
|
||||
@@ -413,6 +421,7 @@ func (s *TaskService) ProcessTask(ctx context.Context, taskID int64) error {
|
||||
Dependency: task.Dependency,
|
||||
Requeue: task.Requeue,
|
||||
KillOnNodeFail: task.KillOnNodeFail,
|
||||
Environment: appEnv,
|
||||
})
|
||||
if err != nil {
|
||||
return fail(model.TaskStepSubmitting, fmt.Sprintf("submit job: %v", err))
|
||||
|
||||
Reference in New Issue
Block a user