Logs
Bounded slices of a task's log: failed-only, the tail, a grep with context or a byte range.
Read a log slice
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job's ID. |
context | string | Optional | |
failed_only | string | Optional | |
from_line | string | Optional | |
grep | string | Optional | |
limit | string | Optional | |
lines | string | Optional | |
offset | string | Optional | |
shard | string | Optional | |
tail | string | Optional | |
task | string | Optional |
Response
byte_lengthbyte_offsetfailed_onlyfrom_line- the 0-based index of the first line in
texton a line-addressed slice hintjob_id- uuidv7 rendered as
job_<32 hex> linesnext_byte_offsetnext_line- the line to ask for next; absent at the end of the log
shardk/Nwhen the task is a shard; the slice is of that shard onlytasktexttotal_bytestotal_lines- newlines the task has written so far (0 on logs stored before the index existed)
truncated
curl "$CIRESK_API/v1/ci/jobs/job_0109badfc220cd056b2c0e862ac73d40/log" \
-H "Authorization: Bearer $CIRESK_KEY"Append a log chunk
One log chunk from a worker.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job's ID. |
task | string | Required | The task's name, as the manifest names it (test, apps/web:test). |
Request body
data_b64finallease_id- uuidv7 rendered as
lease_<32 hex> seq- starts at 1 per attempt and must equal the last
next_seq, else409 log_sequence_gap stream- One of
stdout,stderr,system
Response
byte_offsetnext_seqtotal_bytes
curl -X POST "$CIRESK_API/v1/ci/jobs/job_0109badfc220cd056b2c0e862ac73d40/tasks/test/log" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"data_b64": "acme/platform",
"final": true,
"lease_id": "lease_01778d67b48ee630f44b3f03ab6254a8",
"seq": 1,
"stream": "stdout"
}'Start a log segment upload
A presigned put for one log segment the worker writes to the store itself.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job's ID. |
task | string | Required | The task's name, as the manifest names it (test, apps/web:test). |
Request body
digest- sha-256 of the segment's bytes as put
first_seq- the seq of the segment's first chunk; must equal the last
next_seq lease_id- uuidv7 rendered as
lease_<32 hex> size
Response
expires_atheadersmethodurl
curl -X POST "$CIRESK_API/v1/ci/jobs/job_0109badfc220cd056b2c0e862ac73d40/tasks/test/log/segments" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49",
"first_seq": 1,
"lease_id": "lease_01778d67b48ee630f44b3f03ab6254a8",
"size": 18432000
}'Commit a log segment
A log segment the worker put: checked by its head and indexed.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | The job's ID. |
task | string | Required | The task's name, as the manifest names it (test, apps/web:test). |
Request body
chunkschunks[].digest- sha-256 digest as
sha256:<64 hex> chunks[].lenchunks[].lines- newlines in the chunk, for line paging
chunks[].stream- One of
stdout,stderr,system digest- sha-256 digest as
sha256:<64 hex> finalfirst_seqlease_id- uuidv7 rendered as
lease_<32 hex> size
Response
byte_offsetnext_seqtotal_bytes
curl -X POST "$CIRESK_API/v1/ci/jobs/job_0109badfc220cd056b2c0e862ac73d40/tasks/test/log/segments/commit" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"chunks": [
{
"digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49",
"len": 1,
"lines": 3,
"stream": "stdout"
}
],
"digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49",
"final": true,
"first_seq": 1,
"lease_id": "lease_01778d67b48ee630f44b3f03ab6254a8",
"size": 18432000
}'