Skip to content

Commit

Permalink
add uses property to Task model creation in Task Service
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Oct 13, 2023
1 parent 95b40c3 commit 3898d6a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/api/src/backend/services/TaskService.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
TASK_TYPE_TAPIS_JOB,
TASK_TYPE_TAPIS_ACTOR,
TASK_TYPE_FUNCTION,
TASK_TYPE_TEMPLATE,
DESTINATION_TYPE_LOCAL,
DESTINATION_TYPE_DOCKERHUB,
)
Expand All @@ -25,6 +26,7 @@
TapisJobTask,
TapisActorTask,
FunctionTask,
TemplateTask,
DockerhubDestination,
LocalDestination,
EnumTaskIOTypes,
Expand All @@ -44,7 +46,8 @@
TASK_TYPE_CONTAINER_RUN: ApplicationTask, # Keep for backwards compatibility. container_run renamed to application
TASK_TYPE_TAPIS_JOB: TapisJobTask,
TASK_TYPE_TAPIS_ACTOR: TapisActorTask,
TASK_TYPE_FUNCTION: FunctionTask
TASK_TYPE_FUNCTION: FunctionTask,
TASK_TYPE_TEMPLATE: TemplateTask
}

DESTINATION_TYPE_REQUEST_MAPPING = {
Expand Down Expand Up @@ -84,6 +87,11 @@ def create(self, pipeline, request):
for key in request.input:
_input[key] = request.input[key].dict()

# Prepare the uses property
uses = getattr(request, "uses", None)
if uses != None:
uses = uses.dict()

# Create task
try:
task = Task.objects.create(
Expand Down Expand Up @@ -122,6 +130,7 @@ def create(self, pipeline, request):
getattr(request, "tapis_actor_message", None)
),
url=getattr(request, "url", None),
uses=uses,
# Exection profile
flavor=request.execution_profile.flavor,
max_exec_time=request.execution_profile.max_exec_time,
Expand Down

0 comments on commit 3898d6a

Please sign in to comment.