Repository navigation
Description
Summary
The SageMaker plugin (added in #238) emulates CreateTrainingJob / DescribeTrainingJob / StopTrainingJob / ListTrainingJobs, and DescribeTrainingJob currently reports a training job as Completed. There's no way to make a job come back Failed with a CapacityError, which is the exact signal a "retry until capacity is available" tool needs to test.
Why it matters
lagotto's SageMaker watch (spore-host/lagotto#14) follows the "the launch is the capacity test" model: it submits the user's training job and retries on CapacityError until SageMaker provisions it. Unlike EC2 (synchronous InsufficientInstanceCapacity), SageMaker reports capacity failure asynchronously:
CreateTrainingJobreturns 200 with an ARN- a later
DescribeTrainingJobreturnsTrainingJobStatus = FailedwithFailureReasoncontaining the literal string:CapacityError: Unable to provision requested ML compute capacity. Please retry using a different ML instance type.
Against substrate today, a submitted job always reports Completed, so we can test the submit → success path but not the submit → CapacityError → retry path (the whole point of the feature). That branch is currently covered only by a pure unit test of the classifier; an end-to-end poller test isn't possible.
Requested
A way to make DescribeTrainingJob return a Failed status with a configurable FailureReason. Options, roughly in order of preference:
- Trigger by instance type / job name convention — e.g. a job requesting a designated "exhausted" instance type, or a job name containing a sentinel (e.g.
*-capacityfail-*), returnsFailed+ aCapacityErrorFailureReason. Zero new API surface; easy for tests to opt into. - A control/seed endpoint — let tests pre-seed "type X in region Y has no capacity," so
DescribeTrainingJobfor a job on that type transitions toFailedwith the CapacityError reason (mirrors how EC2 capacity is seeded, if applicable). - Configurable job outcome — a substrate-specific field/tag on
CreateTrainingJobthat sets the eventual terminal status + FailureReason.
Also useful (secondary): expose the SecondaryStatus field (Starting/Pending/Downloading/Training) so the "Pending = waiting on capacity" intermediate signal can be tested, though the terminal Failed+CapacityError case above is the priority.
Context
- Replace SageMaker EC2-proxy with direct SageMaker capacity testing (the EC2 proxy is meaningless) spore-host/lagotto#14 (direct SageMaker launch + CapacityError retry)
- Related substrate gap from the same lagotto work: DynamoDB: emulate resource tagging APIs (TagResource, UntagResource, ListTagsOfResource) + CreateTable Tags #298 (DynamoDB tagging APIs)
Activity
scttfrdmn commentedon Jun 2, 2026
Implemented in #300 (branch
feat/issues-297-298-299). Will close on merge via the PR'sCloses #299keyword.