Create build
Runs a Fusefile’s setup phase on the orchestrator: resolves the setup layer cache, boots a builder (seeded from the deepest stored layer), runs each remaining setup step (snapshotting each cacheable one as a layer), snapshots the result as the build artifact and destroys the builder. A failure destroys the builder too; layers already snapshotted stay, so a retry resumes from the last good one.
The client plans the setup: it renders the scripts and derives
each step’s layer key, since only it can read the files a step’s
inputs name. fuse build does this from a Fusefile.
Answers 202 with the build at once and keeps running when the
caller goes away; follow it with GET /v1/builds/{buildId}. The
build runs as the restate Build/{build_id} workflow (secrets
sealed with TOKEN_ENCRYPTION_KEY) and resumes at the step it was
on after an orchestrator restart.
setup.prelude and setup.files are each ended with a newline if
they lack one, so the next fragment starts a command of its own.
An Idempotency-Key names the build: a retry with the same key
and body returns it (with Idempotent-Replayed: true) instead of
starting another, and the same key with a different body is a 409.
/v1/buildsAuthorizationBearer token · headerrequiredfuse_sessionAPI key · cookierequiredIdempotency-Keystringapplication/jsonnamestringrequiredspecResourceSpecShow propertiesHide properties
cpusinteger<int32>ram_mbinteger<int32>storage_gbinteger<int32>gpusinteger<int32>gpu_kindstringgpu_profilestringimagestringimage_digeststringregionstringhost_idstringlabelsobjecthuge_pagesbooleanmax_runtime_secondsinteger<int64>idle_timeout_secondsinteger<int64>manifest_inlinestringsecretsobjectarchstringkeepbooleansetupBuildSetuprequiredShow propertiesHide properties
preludestringrequiredfilesstringstepsBuildStep[]requiredShow propertiesHide properties
BuildStepscriptstringrequiredkeystringidstringrequirednamestringrequiredstatestringrequiredrunningsucceededfailedstepstringbuilder_idstringarchstringcache_hitsintegerrequiredseed_snapshot_idstringlayersBuildLayer[]requiredShow propertiesHide properties
BuildLayerindexintegerrequiredkeystringstatusstringrequiredhitmissskipsnapshot_idstringsnapshot_idstringerrorstringoutputstringcreated_atstring<date-time>requiredupdated_atstring<date-time>requiredfinished_atstring<date-time>errorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjectcurl -X POST "http://localhost:8080/v1/builds" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"spec": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"gpus": 0,
"gpu_kind": "string",
"gpu_profile": "string",
"image": "string",
"image_digest": "string",
"region": "string",
"host_id": "string",
"labels": {},
"huge_pages": true,
"max_runtime_seconds": 0,
"idle_timeout_seconds": 0
},
"manifest_inline": "string",
"secrets": {},
"arch": "string",
"keep": true,
"setup": {
"prelude": "string",
"files": "string",
"steps": [
{
"script": "string",
"key": "string"
}
]
}
}'const response = await fetch("http://localhost:8080/v1/builds", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "string",
"spec": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"gpus": 0,
"gpu_kind": "string",
"gpu_profile": "string",
"image": "string",
"image_digest": "string",
"region": "string",
"host_id": "string",
"labels": {},
"huge_pages": true,
"max_runtime_seconds": 0,
"idle_timeout_seconds": 0
},
"manifest_inline": "string",
"secrets": {},
"arch": "string",
"keep": true,
"setup": {
"prelude": "string",
"files": "string",
"steps": [
{
"script": "string",
"key": "string"
}
]
}
})
});import requests
response = requests.post(
"http://localhost:8080/v1/builds",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"name": "string",
"spec": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"gpus": 0,
"gpu_kind": "string",
"gpu_profile": "string",
"image": "string",
"image_digest": "string",
"region": "string",
"host_id": "string",
"labels": {},
"huge_pages": True,
"max_runtime_seconds": 0,
"idle_timeout_seconds": 0
},
"manifest_inline": "string",
"secrets": {},
"arch": "string",
"keep": True,
"setup": {
"prelude": "string",
"files": "string",
"steps": [
{
"script": "string",
"key": "string"
}
]
}
},
){
"id": "string",
"name": "string",
"state": "running",
"step": "string",
"builder_id": "string",
"arch": "string",
"cache_hits": 0,
"seed_snapshot_id": "string",
"layers": [
{
"index": 0,
"key": "string",
"status": "hit",
"snapshot_id": "string"
}
],
"snapshot_id": "string",
"error": "string",
"output": "string",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"finished_at": "2024-01-01T00:00:00Z"
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}