Skip to content

Commit

Permalink
Merge pull request #332 from wguanicedew/dev
Browse files Browse the repository at this point in the history
fix transform orm/core functions to add items
  • Loading branch information
wguanicedew authored Aug 28, 2024
2 parents 7e5d559 + 89496a0 commit b6c7e2b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
7 changes: 7 additions & 0 deletions main/lib/idds/core/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def add_transform(request_id, workload_id, transform_type, transform_tag=None, p
new_poll_period=1, update_poll_period=10, retries=0, expired_at=None, transform_metadata=None,
new_retries=0, update_retries=0, max_new_retries=3, max_update_retries=0,
parent_transform_id=None, previous_transform_id=None, current_processing_id=None,
internal_id=None, has_previous_conditions=None, loop_index=None,
cloned_from=None, triggered_conditions=None, untriggered_conditions=None,
workprogress_id=None, session=None):
"""
Add a transform.
Expand Down Expand Up @@ -67,6 +69,11 @@ def add_transform(request_id, workload_id, transform_type, transform_tag=None, p
previous_transform_id=previous_transform_id,
current_processing_id=current_processing_id,
expired_at=expired_at, transform_metadata=transform_metadata,
internal_id=internal_id,
has_previous_conditions=has_previous_conditions,
loop_index=loop_index, cloned_from=cloned_from,
triggered_conditions=triggered_conditions,
untriggered_conditions=untriggered_conditions,
workprogress_id=workprogress_id, session=session)
return transform_id

Expand Down
14 changes: 14 additions & 0 deletions main/lib/idds/orm/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def create_transform(request_id, workload_id, transform_type, transform_tag=None
new_poll_period=1, update_poll_period=10,
new_retries=0, update_retries=0, max_new_retries=3, max_update_retries=0,
parent_transform_id=None, previous_transform_id=None, current_processing_id=None,
internal_id=None, has_previous_conditions=None, loop_index=None,
cloned_from=None, triggered_conditions=None, untriggered_conditions=None,
retries=0, expired_at=None, transform_metadata=None):
"""
Create a transform.
Expand All @@ -58,6 +60,11 @@ def create_transform(request_id, workload_id, transform_type, transform_tag=None
parent_transform_id=parent_transform_id,
previous_transform_id=previous_transform_id,
current_processing_id=current_processing_id,
internal_id=internal_id,
has_previous_conditions=has_previous_conditions,
loop_index=loop_index, cloned_from=cloned_from,
triggered_conditions=triggered_conditions,
untriggered_conditions=untriggered_conditions,
transform_metadata=transform_metadata)
if new_poll_period:
new_poll_period = datetime.timedelta(seconds=new_poll_period)
Expand All @@ -74,6 +81,8 @@ def add_transform(request_id, workload_id, transform_type, transform_tag=None, p
new_poll_period=1, update_poll_period=10, retries=0, expired_at=None,
new_retries=0, update_retries=0, max_new_retries=3, max_update_retries=0,
parent_transform_id=None, previous_transform_id=None, current_processing_id=None,
internal_id=None, has_previous_conditions=None, loop_index=None,
cloned_from=None, triggered_conditions=None, untriggered_conditions=None,
transform_metadata=None, workprogress_id=None, session=None):
"""
Add a transform.
Expand Down Expand Up @@ -106,6 +115,11 @@ def add_transform(request_id, workload_id, transform_type, transform_tag=None, p
parent_transform_id=parent_transform_id,
previous_transform_id=previous_transform_id,
current_processing_id=current_processing_id,
internal_id=internal_id,
has_previous_conditions=has_previous_conditions,
loop_index=loop_index, cloned_from=cloned_from,
triggered_conditions=triggered_conditions,
untriggered_conditions=untriggered_conditions,
transform_metadata=transform_metadata)
new_transform.save(session=session)
transform_id = new_transform.transform_id
Expand Down
9 changes: 7 additions & 2 deletions main/lib/idds/tests/panda_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
# os.environ['PANDA_URL_SSL'] = 'https://panda-doma-k8s-panda.cern.ch/server/panda'
# os.environ['PANDA_URL'] = 'http://panda-doma-k8s-panda.cern.ch:25080/server/panda'

# os.environ['PANDA_URL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'
# os.environ['PANDA_URL_SSL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'
os.environ['PANDA_URL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'
os.environ['PANDA_URL_SSL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda'

# os.environ['PANDA_URL_SSL'] = 'https://pandaserver01.sdcc.bnl.gov:25443/server/panda'
# os.environ['PANDA_URL'] = 'https://pandaserver01.sdcc.bnl.gov:25443/server/panda'

from pandaclient import Client # noqa E402

Expand Down Expand Up @@ -75,6 +78,8 @@
task_ids = [i for i in range(10173, 10204)]
task_ids = [108, 109, 106, 107, 112]
task_ids = [i for i in range(2921, 2927)]
task_ids = [124, 68, 75, 78, 79]
task_ids = [19654]
for task_id in task_ids:
print("Killing %s" % task_id)
ret = Client.killTask(task_id, verbose=True)
Expand Down

0 comments on commit b6c7e2b

Please sign in to comment.