Repository navigation
docs: document failed shell-script jobs and servicekit 2.0 CRUD semantics - #97
Merged
Merged
Conversation
…tics Shell-runner contract and ML workflows now describe the post-#96 behavior: a non-zero train or predict exit code stores the diagnostic workspace artifact under the id from the 202 response and then fails the job, with the artifact id carried in the job error rather than in artifact_id. Adds a "Debugging a failed run" walkthrough. Config and artifact guides note that POST is create-only (409 problem details on a duplicate id), that PUT is the update path applying only the fields sent, and that pagination is opt-in with page >= 1 and size 1-100.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documentation-only follow-up to #96 and the servicekit 2.0.0 upgrade. No code changes.
Failed shell scripts now fail the job (
docs/guides/shell-runner-contract.md,docs/guides/ml-workflows.md)The guides described a non-zero train/predict exit code as producing a completed job whose artifact carried
status: failedmetadata. Since #96 the diagnostic artifact is still stored — under the artifact id the$train/$predict202 response returned, withmetadata.status,exit_code,stdout,stderr— and then the job fails, withartifact_id: null, anerrorof the formtrain script failed with exit code N; diagnostic artifact <ulid> holds the workspace, stdout and stderr; stderr tail: ..., and anerror_traceback. Both guides now say so, with corrected example JSON, and the shell-runner contract gains a "Debugging a failed run" walkthrough (fetch job -> read error -> fetch diagnostic artifact -> download workspace). Also noted: a predict script that exits 0 without writingpredictions.csvstill raises and has no diagnostic artifact, and the predict failure artifact is anml_prediction_workspaceat level 1 under the training artifact.servicekit 2.0.0 CRUD semantics (
docs/guides/configuration-management.md,docs/guides/artifact-storage.md)Both guides described POST without saying what happens for an existing id. Added, next to each endpoint: POST is create-only and a duplicate id returns
409asapplication/problem+json(with a curl example showing the real body); PUT is the update path and applies only the fields sent, with an explicitnullclearing a nullable field; list endpoints takepage(>= 1) andsize(1-100) together, return422outside those bounds, and are ordered by id. The old "default: 1 / default: 50" query-parameter text was wrong — pagination is opt-in, and supplying only one of the two returns the plain unpaginated list. The artifact guide also notes that a failed database constraint (e.g. an unknownparent_id) returns 409 with the generic detail "Entity violates a database constraint" from servicekit 2.0.1 onward.Checked, no change needed
{"detail": "..."}error bodies for chapkit routes anywhere indocs/orREADME.md.src/chapkit/ml/schemas.py(config_id+datafor train;artifact_id+historic+futurefor predict; DataFrame as{columns, data}). The scaffolded-README mistakes fixed in fix: fail jobs on failing shell scripts, emit problem details, correct scaffolded README #96 were not mirrored in the guides.set_scheduler,set_database,get_scheduler(),get_database(),AIOJobScheduler,JobScheduler,_sema, orexclude_noneindocs/orREADME.md.Test plan
make lint— ruff format + check + ty, cleanmake test— 861 passed, 3 skippeduv run mkdocs build --strict— clean; the two new cross-reference anchors (#failed-script-runs,#debugging-a-failed-run) verified present in the built HTML422forpage=0andsize=200, plain list forpagealone, andtests/test_ml_failed_script_jobs.pyfor the failed-job shape