Keep data in your own bucket
Point an environment at your S3 bucket, so its disks live there and nowhere else.
An environment can keep its data in a bucket you own. The API still runs the branches, commits, searches and billing, but every byte of the environment's disks, and of their search data, is written to your bucket. One bucket holds both:
s3://acme-data/skywake/
fs/ns_…/ a disk: refs/, objects/, chunks/, commits/, …
ix/ix_…/ a disk's search data: refs/, objects/, chunks/, blobs/, …Each folder says what it holds in a small skywake.json. Garbage collection checks that file and refuses any folder of the other kind, so files and search data never collect each other's.
Choose the bucket before you make anything
An environment's bucket can be set, changed or removed only while the environment holds no disks, and no folders still waiting to be deleted. Set it right after you create the environment.
auth="authorization: Bearer $SKYWAKE_API_KEY"
curl -s -X POST "$SKYWAKE_URL/v2/environments" -H "$auth" \
-H "content-type: application/json" -d '{"name": "prod"}'
curl -s "$SKYWAKE_URL/v1/environments/prod/store/trust" -H "$auth"The example creates the environment prod and asks what a role must trust (step 1 below). Setting the bucket has no v2 route, SDK call or CLI command yet, so these steps use /v1, which goes away one release after v2. On your own server, principal is null until you set SKYWAKE_API_BYOB_PRINCIPAL to the role the API runs as.
With an AWS role (recommended)
Skywake assumes a role in your account, so no long-lived key leaves it.
-
Ask what the role must trust:
curl -H "authorization: Bearer $SKYWAKE_API_KEY" $SKYWAKE_URL/v1/environments/prod/store/trust # {"principal": "arn:aws:iam::…:role/skywake-api", "externalId": "skywake-org_…"} -
Create a role whose trust policy lets that
principalcallsts:AssumeRolewhensts:ExternalIdequalsexternalId. Give its3:GetObject,s3:PutObject,s3:DeleteObjectands3:AbortMultipartUploadonarn:aws:s3:::acme-data/skywake/*, ands3:ListBucketon the bucket with the prefixskywake/*. -
Point the environment at the bucket:
curl -X PUT -H "authorization: Bearer $SKYWAKE_API_KEY" -H "content-type: application/json" \ $SKYWAKE_URL/v1/environments/prod/store \ -d '{"store": "s3://acme-data/skywake", "access": {"type": "aws_role", "roleArn": "arn:aws:iam::123456789012:role/skywake", "region": "us-east-1"}}'
The API tries the bucket before it saves anything: it writes, reads and deletes a test branch and checks the bucket supports conditional writes. A bucket that fails answers 400 and nothing changes.
With keys, for any S3 compatible store
R2, MinIO, Google Cloud Storage (HMAC keys) and others take an access key and an endpoint:
{
"store": "s3://acme-data/skywake",
"access": {
"type": "keys",
"accessKeyId": "…",
"secretAccessKey": "…",
"endpoint": "https://<account>.r2.cloudflarestorage.com",
"region": "auto"
}
}The secret is sealed with the server's SKYWAKE_API_SECRET_KEY and never shown again. A server without that key answers 501.
What changes
- New disks in the environment go to your bucket. Asking for a
regionin such an environment answers400. - With an AWS role,
skywake://mounts get short-lived scoped credentials from your role, limited to one disk's folder. With keys, there is no role to scope, so mounts and the CLI read and write through the API instead. - Destroying a disk removes its folders from your bucket. The API keeps trying until it is gone, so remove the role or keys only after that.
- Cache nodes are not used for your bucket yet; each server's own disk cache still is.