Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dws: Fix NnfDataMovement logging #185

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions src/modules/coral2_dws.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
RABBIT_CRD,
COMPUTE_CRD,
SERVER_CRD,
DATAMOVEMENT_CRD,
)
from flux_k8s.watch import Watchers, Watch
from flux_k8s import directivebreakdown
Expand Down Expand Up @@ -160,23 +159,12 @@ def move_workflow_to_teardown(handle, winfo, k8s_api, workflow=None):
LOGGER.exception(
"Failed to update KVS for job %s: workflow is", winfo.jobid, workflow
)
try:
workflow["metadata"]["finalizers"].remove(_FINALIZER)
except ValueError:
pass
k8s_api.patch_namespaced_custom_object(
*WORKFLOW_CRD,
winfo.name,
{
"spec": {"desiredState": "Teardown"},
"metadata": {"finalizers": workflow["metadata"]["finalizers"]},
},
)
winfo.toredown = True
if LOGGER.isEnabledFor(logging.INFO):
try:
api_response = k8s_api.list_namespaced_custom_object(
*DATAMOVEMENT_CRD,
api_response = k8s_api.list_cluster_custom_object(
group="nnf.cray.hpe.com",
version="v1alpha1",
plural="nnfdatamovements",
label_selector=(
f"dataworkflowservices.github.io/workflow.name={winfo.name},"
"dataworkflowservices.github.io/workflow.namespace=default"
Expand All @@ -191,8 +179,23 @@ def move_workflow_to_teardown(handle, winfo, k8s_api, workflow=None):
else:
for crd in api_response["items"]:
LOGGER.info(
"Found nnfdatamovement crd for workflow '%s': %s", winfo.name, crd
"Found nnfdatamovement crd for workflow '%s': %s",
winfo.name,
json.dumps(crd),
)
try:
workflow["metadata"]["finalizers"].remove(_FINALIZER)
except ValueError:
pass
k8s_api.patch_namespaced_custom_object(
*WORKFLOW_CRD,
winfo.name,
{
"spec": {"desiredState": "Teardown"},
"metadata": {"finalizers": workflow["metadata"]["finalizers"]},
},
)
winfo.toredown = True


def move_workflow_desiredstate(workflow_name, desiredstate, k8s_api):
Expand Down
7 changes: 0 additions & 7 deletions src/python/flux_k8s/crd.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,3 @@
namespace="default",
plural="servers",
)

DATAMOVEMENT_CRD = CRD(
group="dataworkflowservices.github.io",
version="v1alpha2",
namespace="default",
plural="nnfdatamovements",
)
Loading