Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ewoksppf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
workflow
ewoks
ewoksppf
Commits
a8371a93
Commit
a8371a93
authored
4 weeks ago
by
Wout De Nolf
Browse files
Options
Downloads
Patches
Plain Diff
set PYPUSHFLOW_OBJECTID to job id when needed
parent
96ed8fbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!115
Resolve "PYPUSHFLOW_OBJECTID (or the db_options) should get the workflow job id"
Pipeline
#224284
passed
4 weeks ago
Stage: test
Stage: style
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
src/ewoksppf/bindings.py
+34
-0
34 additions, 0 deletions
src/ewoksppf/bindings.py
with
38 additions
and
1 deletion
CHANGELOG.md
+
3
−
0
View file @
a8371a93
...
...
@@ -2,7 +2,10 @@
## Unreleased
Changes:
-
Drop Python 3.6 and 3.7
-
Set deprecated environment variable
`PYPUSHFLOW_OBJECTID`
to the Ewoks job id when needed.
## 1.0.0
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
a8371a93
...
...
@@ -15,7 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3"
,
]
requires-python
=
">
=
3.8
"
dependencies
=
[
"ewokscore >=1.0.0"
,
"pypushflow >=1.
0
.0"
]
dependencies
=
[
"ewokscore >=1.0.0"
,
"pypushflow >=1.
1
.0"
]
[project.urls]
Homepage
=
"https://gitlab.esrf.fr/workflow/ewoks/ewoksppf/"
...
...
This diff is collapsed.
Click to expand it.
src/ewoksppf/bindings.py
+
34
−
0
View file @
a8371a93
import
os
import
pprint
from
contextlib
import
contextmanager
from
typing
import
Generator
,
Optional
,
List
,
Sequence
...
...
@@ -592,6 +593,11 @@ def execute_graph(
if
load_options
is
None
:
load_options
=
dict
()
ewoksgraph
=
load_graph
(
graph
,
inputs
=
inputs
,
**
load_options
)
_deprecated_pypushflow_environment_variables
(
db_options
=
db_options
,
**
execute_options
)
ppfgraph
=
EwoksWorkflow
(
ewoksgraph
,
pre_import
=
pre_import
,
...
...
@@ -601,3 +607,31 @@ def execute_graph(
db_options
=
db_options
,
)
return
ppfgraph
.
run
(
**
execute_options
)
def
_deprecated_pypushflow_environment_variables
(
db_options
:
Optional
[
dict
]
=
None
,
execinfo
:
Optional
[
dict
]
=
None
,
**
_
)
->
None
:
if
db_options
and
db_options
.
get
(
"
db_type
"
)
is
not
None
:
return
# We are still using the deprecated PYPUSHFLOW_* environment variables.
if
not
os
.
environ
.
get
(
"
PYPUSHFLOW_MONGOURL
"
,
None
):
return
# pypushflow needs PYPUSHFLOW_OBJECTID to be defined. All the others have defaults.
if
os
.
environ
.
get
(
"
PYPUSHFLOW_OBJECTID
"
,
None
):
return
if
not
execinfo
:
return
job_id
=
execinfo
.
get
(
"
job_id
"
,
None
)
if
not
job_id
:
return
# We do have an Ewoks job ID so use it for PYPUSHFLOW_OBJECTID.
os
.
environ
[
"
PYPUSHFLOW_OBJECTID
"
]
=
str
(
job_id
)
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