M15 documents the first simple optimization workload recipe using the existing Docker workload flow.
This is not sharding, a new executor, a new WorkType, or new Agent behavior. The optimization code is packaged as a workspace artifact, mounted read-only into the existing Docker workload container, and the script writes results to /output for upload as execution output artifacts.
The M15 flow proves the base path:
workspace package -> Docker workload -> output artifacts
The workload runs as a normal localhive.docker.workload execution:
- Master stores the uploaded workspace ZIP as a
WORKSPACE_PACKAGEartifact. - Master creates a Docker workload execution that references that workspace artifact.
- Agent downloads and safely unpacks the workspace after claiming the execution.
- Docker mounts the workspace read-only at
/workspace. - Docker runs
sh /workspace/optimize.sh. - The script writes results to
/output. - Agent uploads output artifacts back to Master.
M15 does not add shard planning, parent or child executions, merge/reduce, retry, requeue, a dedicated optimization executor, or any Docker runtime behavior change.
Expected ZIP structure:
workspace.zip
└── optimize.sh
The local ZIP is a smoke input and should not be committed.
optimize.sh is expected to:
- run through
sh /workspace/optimize.sh, - write
/output/result.json, - write
/output/summary.txt.
The script should evaluate:
score = 10000 - (x - 37)^2 - (y - 82)^2
x = 0..100
y = 0..100
Expected best result:
{"bestX":37,"bestY":82,"score":10000}Before running the smoke flow:
- Master is running.
- Agent is running.
- Worker is approved.
- Worker is online and available when using
AUTO. - Worker has current capabilities when using M13
AUTOorPREFER. - Agent Docker policy allows
alpine:3.20. - The Docker Work Definition Version for
localhive.docker.workloadexists and is approved. - Workspace artifact upload endpoint is available.
- Output artifact endpoints are available.
The execution uses the existing Docker workload executor:
{
"image": "alpine:3.20",
"command": [
"sh",
"/workspace/optimize.sh"
],
"timeoutSeconds": 30,
"resources": {
"memoryMb": 128,
"cpuCores": 1
},
"gpu": {
"required": false
},
"workspace": {
"artifactId": "{{m15_workspace_artifact_uuid}}",
"mountPath": "/workspace",
"readOnly": true
}
}Workspace rules remain the existing workspace artifact rules:
mountPathmust be/workspace,readOnlymust betrue,- the host path is controlled by the Agent, not by user configuration,
- the workspace mount is read-only inside the container.
- Upload
workspace.zipasWORKSPACE_PACKAGE. - Find the Docker Work Definition Version.
- Optionally run selection diagnostics.
- Create the Docker workload execution.
- Agent claims and runs the container.
- Container runs
sh /workspace/optimize.sh. - Script writes
/output/result.jsonand/output/summary.txt. - Agent uploads output artifacts.
- Admin downloads the result artifact.
- Result matches the expected best point.
POST http://localhost:8080/api/dev/artifacts/workspace-package
Authorization: Bearer {{auth_token}}
Content-Type: multipart/form-data; boundary=LocalHiveBoundary
--LocalHiveBoundary
Content-Disposition: form-data; name="file"; filename="workspace.zip"
Content-Type: application/zip
< E:/LocalHiveSmoke/m15/workspace.zip
--LocalHiveBoundary--Capture the artifact id:
client.global.set("m15_workspace_artifact_uuid", response.body.artifactId);GET http://localhost:8080/api/admin/work-definitions?logicalId=localhive.docker.workload&limit=20&offset=0
Authorization: Bearer {{auth_token}}
Accept: application/jsonCapture the latest approved Docker definition version id:
client.global.set("docker_definition_version_uuid", response.body.items[0].latestVersionId);Diagnostics is optional but useful before creating an AUTO execution.
POST http://localhost:8080/api/admin/executions/selection-diagnostics
Authorization: Bearer {{auth_token}}
Content-Type: application/json
Accept: application/json
{
"workDefinitionVersionId": "{{docker_definition_version_uuid}}",
"assignmentMode": "AUTO",
"displayName": "M15 Simple Optimization Diagnostics",
"configuration": {
"image": "alpine:3.20",
"command": [
"sh",
"/workspace/optimize.sh"
],
"timeoutSeconds": 30,
"resources": {
"memoryMb": 128,
"cpuCores": 1
},
"gpu": {
"required": false
},
"workspace": {
"artifactId": "{{m15_workspace_artifact_uuid}}",
"mountPath": "/workspace",
"readOnly": true
}
}
}Expected diagnostics:
- request is structurally valid,
- at least one worker is eligible for
AUTO, - selected worker has Docker capability for
alpine:3.20, - selected worker fits requested RAM and CPU.
POST http://localhost:8080/api/admin/executions
Authorization: Bearer {{auth_token}}
Content-Type: application/json
Accept: application/json
{
"workDefinitionVersionId": "{{docker_definition_version_uuid}}",
"assignmentMode": "AUTO",
"displayName": "M15 Simple Optimization",
"configuration": {
"image": "alpine:3.20",
"command": [
"sh",
"/workspace/optimize.sh"
],
"timeoutSeconds": 30,
"resources": {
"memoryMb": 128,
"cpuCores": 1
},
"gpu": {
"required": false
},
"workspace": {
"artifactId": "{{m15_workspace_artifact_uuid}}",
"mountPath": "/workspace",
"readOnly": true
}
}
}Capture the execution id:
client.global.set("m15_execution_uuid", response.body.executionId);GET http://localhost:8080/api/admin/executions/{{m15_execution_uuid}}
Authorization: Bearer {{auth_token}}
Accept: application/jsonExpected after Agent completes the execution:
statuseventually becomesSUCCEEDED,displayNameisM15 Simple Optimization,artifacts.outputArtifactCount >= 2.
GET http://localhost:8080/api/admin/executions/{{m15_execution_uuid}}/artifacts
Authorization: Bearer {{auth_token}}
Accept: application/jsonExpected artifacts:
result.json,summary.txt.
Capture result.json:
const result = response.body.find((artifact) => artifact.originalFilename === "result.json");
client.global.set("m15_result_artifact_uuid", result.artifactId);GET http://localhost:8080/api/admin/artifacts/{{m15_result_artifact_uuid}}/download
Authorization: Bearer {{auth_token}}
Accept: application/octet-streamExpected response body:
{"bestX":37,"bestY":82,"score":10000}summary.txt should be a human-readable summary of the same best point.
- single worker only,
- no sharding,
- no parent or child executions,
- no merge/reduce,
- no retry or requeue,
- no dedicated optimization executor,
- no Python, C++, or Java runner images yet,
- no Docker image policy expansion beyond existing allowed images,
- no live Docker health probing,
- no frontend UI,
- no GPU support.
M15 is preparation for future sharding, not an implementation of sharding.
It proves that LocalHive can move a small code package into an Agent-controlled Docker execution and move results back through output artifacts. The proposed sharding model is documented in Sharding ADR.