Slay the Workflow
Closes #1475 (closed)
Implements part of teklia/requests#98 (Process.started)
-
RetrieveWorkflow,UpdateWorkflowandPartialUpdateWorkflowhave been removed entirely; I simply couldn't get them to work with a process properly and it was easier to merge their behaviors intoRetrieveProcess,UpdateProcessandPartialUpdateProcess.- The frontend uses
RetrieveWorkflowto show a process' status. - The CLI uses
RetrieveWorkflowforarkindex process reportandarkindex process recover. - The API client's README uses
RetrieveWorkflowin an example, but this example uses an endpoint that does not exist already (RetrieveTaskLog). - Only the frontend uses
PartialUpdateWorkflow, to stop processes. - Nobody on code.vpn uses
UpdateWorkflow.
- The frontend uses
-
The
workflowfield has been removed from processes returned inListProcessorRetrieveProcess. This was the URL to a workflow, not an UUID.- The CLI uses the
workflowinarkindex process reportandarkindex process recover. - The frontend uses the
workflowfor status polling, as well as to detect whether a process is "configured" or not.
- The CLI uses the
-
The
with_workflowoption ofListProcesseshas been renamed towith_tasks. This only affects the frontend. -
RetrieveProcessnow returns thefarmand thetasks, which were previously returned byRetrieveWorkflow. -
The
workflow_idonCreateTaskis nowprocess_id, which affects the Git import task and the Ponos agent -
The Ponos agent can no longer provide the
PONOS_WORKFLOWenvironment variable, which affects the Git import task -
The task logs and artifacts were stored on S3 using URLs that contain the workflow IDs. They now use only the task ID, to reduce the complexity if we ever have to do other migrations.
- Artifacts
<workflow ID>/<task ID>/*→<task ID>/* - Task logs
<workflow ID>/run_<run>/<task ID>.log→<task ID>.log
⚠ Nothing is provided here to make the migration: the renaming will have to be done on the infra side as discussed on Whereby. - Artifacts
-
The
manage.py cleanupcommand used to remove expired workflows, but not expired processes. It now deletes all tasks on expired processes, but does not delete expired processes since they would imply deleting WorkerRuns or WorkerActivities, which would be a mess.
Follow-ups
- Fix the frontend teklia/arkindex/frontend!1491
- Fix tasks teklia/arkindex/tasks!352
- Fix the Ponos agent teklia/arkindex/ponos-agent!20
- Update the CLI's
arkindex process reportandarkindex process recoverto adapt to theRetrieveWorkflowremoval - Write the Ponos logs and artifacts renaming script, which can also be useful to developers for their local setups
- Restore the behavior of a process retry to what it had before the recipe removal: the tasks should be regenerated via
build_workflow, not cloned. This was not possible without the recipe, but is now possible without theWorkflow. This currently prevents restarting a Repository process.