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
d32f2726
Commit
d32f2726
authored
2 years ago
by
Charlotte Hausman
Browse files
Options
Downloads
Patches
Plain Diff
fixing initial weblog ingestion
parent
97c325e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1130
fixing initial weblog ingestion
Pipeline
#7254
passed
2 years ago
Stage: cache-build
Stage: build
Stage: unit-test
Stage: test-coverage
Stage: push
Stage: deploy-coverage-page
Stage: generate-pex-yaml
Stage: pex-trigger
Stage: deploy
Stage: .post
Pipeline: workspaces
#7255
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/cli/executables/pexable/ingest_envoy/ingest_envoy/solicitor.py
+14
-7
14 additions, 7 deletions
...xecutables/pexable/ingest_envoy/ingest_envoy/solicitor.py
with
14 additions
and
7 deletions
apps/cli/executables/pexable/ingest_envoy/ingest_envoy/solicitor.py
+
14
−
7
View file @
d32f2726
...
...
@@ -81,10 +81,18 @@ class Solicitor:
current_execution_url
=
f
"
{
self
.
capability_url
}
/capability/request/execution/
{
wf_id
}
"
current_execution
=
requests
.
get
(
current_execution_url
)
initial_execution_url
=
(
f
"
{
self
.
capability_url
}
/capability/request/
"
f
"
{
current_execution
.
json
()[
'
capability_request_id
'
]
}
/version/1/execution
"
capability_req_id
=
current_execution
.
json
()[
"
capability_request_id
"
]
current_version_number
=
current_execution
.
json
()[
"
version_number
"
]
current_version_url
=
(
f
"
{
self
.
capability_url
}
/capability/request/
{
capability_req_id
}
/version/
{
current_version_number
}
"
)
current_version
=
requests
.
get
(
current_version_url
)
# UI only updates the *current* version parameters, not the workflow arguments or other versions.
# pull srdp status from current version
srdp_status
=
current_version
.
json
()[
"
parameters
"
][
"
metadata
"
][
"
is_srdp
"
]
initial_execution_url
=
f
"
{
self
.
capability_url
}
/capability/request/
{
capability_req_id
}
/version/1/execution
"
initial_execution
=
requests
.
get
(
initial_execution_url
)
wf_request_url
=
(
...
...
@@ -93,23 +101,22 @@ class Solicitor:
)
wf_request
=
requests
.
get
(
wf_request_url
)
if
self
.
verify_valid_initial_version
(
wf_request
.
json
()):
if
self
.
verify_valid_initial_version
(
wf_request
.
json
()
,
srdp_status
):
initial_path
=
pathlib
.
Path
(
wf_request
.
json
()[
"
results_dir
"
])
return
initial_path
.
stem
else
:
self
.
logger
.
error
(
"
Error: Invalid initial version! No weblog found. Running Single Version Ingestion...
"
)
return
INVALID_INITIAL_VERSION
def
verify_valid_initial_version
(
self
,
wf_request
:
dict
)
->
bool
:
def
verify_valid_initial_version
(
self
,
wf_request
:
dict
,
srdp_flag
:
bool
)
->
bool
:
"""
Ping the weblog display endpoint to verify the existence of an initial version weblog
* Ingestion fails if this is unavailable
:param wf_request: the initial workflow request to verify
:param srdp_flag: Is this request SRDP?
:return: True if weblog exists, False otherwise
"""
srdp_flag
=
wf_request
[
"
argument
"
][
"
metadata
"
][
"
is_srdp
"
]
# only run ingestion with initial version weblog if this is SRDP
if
srdp_flag
is
True
:
# if this is SRDP, verify the initial weblog exists
...
...
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