Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
e63ad66d
Commit
e63ad66d
authored
4 years ago
by
Charlotte Hausman
Browse files
Options
Downloads
Patches
Plain Diff
misc. clean up
parent
e32d7145
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shared/workspaces/src/workspaces/services.py
+4
-9
4 additions, 9 deletions
shared/workspaces/src/workspaces/services.py
with
4 additions
and
9 deletions
shared/workspaces/src/workspaces/services.py
+
4
−
9
View file @
e63ad66d
...
...
@@ -337,15 +337,10 @@ class CapabilityEngine(CapabilityEngineIF):
cur_step
=
step_sequence
[
int
(
self
.
execution
.
current_step
)]
workflow_name
=
cur_step
.
step_value
workflow_args
=
cur_step
.
step_args
workflow_request
=
WorkflowRequest
(
workflow_name
=
workflow_name
,
argument
=
workflow_args
,
state
=
WorkflowRequestState
.
Created
,
execution_id
=
self
.
execution_id
,
)
# FIXME: Add support for files
files
=
[]
workflow_request
=
self
.
workflow_service
.
info
.
create_workflow_request
(
workflow_name
,
workflow_args
)
self
.
workflow_service
.
execute
(
workflow_request
,
files
)
def
is_complete
(
self
):
...
...
@@ -481,7 +476,7 @@ class WorkflowService(WorkflowServiceIF):
# Start listening for events from the wf_monitor stream
self
.
listener
=
threading
.
Thread
(
target
=
lambda
:
workflow_events
.
listen
(
self
.
on_workflow_event
)
target
=
lambda
:
workflow_events
.
listen
(
self
.
on_workflow_event
,
threaded
=
True
)
)
self
.
listener
.
start
()
...
...
@@ -521,7 +516,7 @@ class WorkflowService(WorkflowServiceIF):
"""
# 1. create a temporary directory
# TODO: decide where to put temp directory and make capo property
temp_folder
=
Path
(
mkdtemp
(
dir
=
str
(
Path
.
home
())))
temp_folder
=
Path
(
mkdtemp
(
dir
=
str
(
Path
.
home
())
+
"
/workspaces_tmp
"
))
# 2. spool each of the temp files to it
for
file
in
files
:
...
...
@@ -623,7 +618,6 @@ class WorkflowInfo(WorkflowInfoIF):
Create new workflow request and save to database
:param workflow: workflow to run
:param argument: workflow arguments
:param execution_id: execution id of parent capability execution (optional for now)
:return: new WorkflowRequest
"""
request
=
WorkflowRequest
(
...
...
@@ -632,6 +626,7 @@ class WorkflowInfo(WorkflowInfoIF):
state
=
WorkflowRequestState
.
Created
.
name
,
)
self
.
save_request
(
request
)
print
(
f
"
Created Workflow Request
{
request
}
"
)
return
request
def
save_request
(
self
,
request
:
WorkflowRequest
):
...
...
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