Skip to main content

Algorithm Management

Algorithm management maintains reusable custom algorithm templates in the platform. Each template records a Docker image reference, a parameter schema, and a set of resource limits. When a processing rule in Workflow Management matches a dataset, it starts a container from the template on that dataset, mounts the dataset as read-only input, and collects the run report and artifacts.

Algorithm list

Prerequisites

ItemContent
Menu entryManage → Workflow → Pipeline Map → Post-processing Algorithm → Algorithm Library
Alternative entryWorkflow → Processing rule → Run Custom Algorithm step → New next to the algorithm selector
Route/algorithms
Page permissionsView Workflows
API permissionsView Training (list and details), Create Training Job (create, edit, enable/disable, delete)
Writable scopeOnly administrators can write global algorithms; project algorithms require a Project Manager with write permission on the target project
DependenciesThe image is pushed to a registry reachable by the execution nodes; execution nodes have a container runtime

See Module Permissions for how module permissions are configured.

Algorithm Definition and Operations

Algorithm Fields

The create and edit pages maintain the following fields.

FieldTypeRequiredDefaultDescription
NameTextYesNoneUp to 200 characters; processing rules reference the algorithm by name and ID
ScopeEnumYesGlobalGlobal: available platform-wide; project: available only to the selected project
Image ReferenceTextYesNoneregistry/repo:tag or Docker Hub repo:tag; up to 500 characters
DescriptionTextNoEmptyUp to 500 characters
EnableSwitchNoOnProcessing rules cannot select the algorithm when it is disabled
Parameter SchemaJSONYesEmpty objectJSON Schema used to generate the runtime parameter form
Resource LimitsJSONNoSee the table belowContainer resource caps

Create Algorithm

Parameter Schema

The parameter schema describes the runtime form fields, and the platform generates the parameter input controls from it.

ItemValueDescription
Field typesstring, number, integer, boolean, array, objectDefined by the JSON Schema
Enum constraintenumRestricts the allowed values
Default valuedefaultInitial value in the runtime form
Required itemsrequired arrayThe run is rejected when a required value is missing
Numeric rangeminimum, maximumBounds for numeric fields

Example:

{
"type": "object",
"properties": {
"threshold": { "type": "number", "title": "Quality threshold", "default": 0.8, "minimum": 0, "maximum": 1 },
"mode": { "type": "string", "title": "Detection mode", "enum": ["strict", "normal", "loose"], "default": "normal" },
"enable_video": { "type": "boolean", "title": "Generate video", "default": false }
},
"required": ["threshold"]
}

Parameters entered at runtime become container command-line arguments in the form --key value. A boolean true becomes --key, and false is omitted.

Parameter schema and resource limits

Resource Limits

FieldTypeDefaultDescription
memory_mbNumber2048Memory cap in MB
cpusNumber1CPU core cap
pids_limitNumber100Process count cap
timeout_secondsNumber3600Run timeout in seconds
network_enabledBooleanfalseWhether the container can access the network

Example:

{
"memory_mb": 2048,
"cpus": 1,
"pids_limit": 100,
"timeout_seconds": 3600,
"network_enabled": false
}

Image Input and Output Conventions

The platform starts the container with fixed parameters, and the algorithm image reads and writes the following paths.

PathAccessRequiredDescription
/input/dataset.{extension}Read-onlyYesDataset file mounted by the platform; the extension matches the dataset
/output/report.jsonWritableYesRun report, written to the results field of the run record
/output/artifacts/*WritableNoArtifacts such as videos and images; the platform uploads them and records them in the run record
[PROGRESS] 42 message in stdoutOutputNoParsed by the platform as run progress

The platform always passes three parameters: --input, --output, and --mode, where --mode is qc or preprocess.

ModeBehavior
qcLeaves the original data unchanged and only generates the report and artifacts
preprocessAllows new files to be output as artifacts; the platform does not replace the original dataset automatically

List Actions

ActionEffectConstraint
Enable switchToggles the enable state of the algorithmProcessing rules cannot select a disabled algorithm
EditChanges the image, schema, and resource limitsOnly administrators can edit global algorithms
DeleteSoft deletes the algorithmCannot be restored; adjust processing rules first when they still reference it

Constraints and Limits

ItemValueDescription
Name length≤ 200 charactersSaving is rejected when exceeded
Description length≤ 500 charactersSaving is rejected when exceeded
Parameter key namesMust not use input, output, or modeConflicts with the fixed platform parameters
List visibilityWithout a project specified, administrators see everything and non-administrators see global algorithms onlyProject algorithms must be viewed inside the project
Image tagTreated as latest when omittedAn explicit tag is recommended
Custom algorithm imageUses the image reference from the algorithm recordDeployment can override the image of a built-in algorithm
Exit codeA non-zero value is treated as failurestdout/stderr logs are kept on failure

Troubleshooting

SymptomPossible causeActionOwner
Saving reports that the image cannot be pulledThe image is not pushed, or the execution nodes cannot reach the registryPush the image; configure pull credentials for a private registry on the execution nodesAlgorithm developer, Platform Operations
A non-administrator is rejected when saving a global algorithmOnly administrators can write global algorithmsSwitch to project scope and specify a project with write permissionProject Manager
A pipeline run fails with no report.jsonThe image does not write /output/report.json as requiredFix the image per the input and output conventions and rerunAlgorithm developer
The run times outIt exceeds timeout_secondsRaise the timeout cap or optimize the algorithmAlgorithm developer
Parameters have no effectA parameter key collides with a fixed platform parameter, or the image does not parse --key valueRename the parameter key; fix the parameter parsing in the imageAlgorithm developer
A project algorithm cannot be selected in a global workflowThe project scope of the algorithm does not match the target projectSelect an algorithm with the same scope, or have an administrator create a global algorithmProject Manager, Administrator
PagePurpose
Workflow ManagementReference the algorithm in the Run Custom Algorithm action
Data QCExecution of QC rules and result inspection
Operations MonitoringTask queue and run logs