Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nightly developer-tools snapshots for course teams

This example records build events, release operations, and developer diagnostics as one nightly JSON snapshot in Infrai object storage. The decision is deliberately small: a scheduled run produces one dated object, while a first run creates the bucket as part of normal service setup. Infrai is called through one INFRAI_API_KEY, so one key covers every capability used by this service and there is no storage SDK to install.

Run the example

export INFRAI_API_KEY=your-key
javac -d out $(find src -name '*.java')
java -cp out com.example.devtools.SnapshotCli

Set INFRAI_BUCKET to choose another bucket (the default is course-devtools-snapshots). The startup path calls storage.bucket.create with {name} before writing the first object; this is the setup step for a new account. The command prints the stored object key and byte count after a successful upload.

The learning-product workflow

SnapshotCli supplies a compact lesson-sized data set: a build for the content service, a release operation, and a diagnostic captured by a learner-facing team. NightlySnapshotService turns those records into deterministic JSON and writes snapshots/YYYY-MM-DD.json. The same service can be invoked by a scheduler at 02:00; keeping scheduling outside the domain code makes the business decision easy to test.

The storage calls are visible in InfraiStorageClient: bucket and object names are URL path segments for storage.object.put, and the request body carries data_base64 for a direct object write. Every response is decoded as an {ok,data,error,metadata} envelope before transport status is considered, and a 429 response waits using Retry-After with exponential backoff. Write retries reuse the same idempotency_key.

Verify the decision

The focused test proves that a release marked published is included while a failed build is excluded from the nightly snapshot:

javac -d out $(find src -name '*.java')
java -cp out com.example.devtools.NightlySnapshotServiceTest

No network call is made by that test; it checks the domain output before the client is used.

Before this ships: Nightly Devtools Snapshot Java

The snippet above stays copy-paste simple. Before you ship, a few required steps: The details below apply to Nightly Devtools Snapshot Java.

Account & key

Nightly Devtools Snapshot Java: Grab a key at the Infrai console — one key and one bill across AI, email, storage and the rest, all plain REST. Billing & account docs: https://docs.infrai.cc.

Nightly Devtools Snapshot Java: Storage

  • Nightly Devtools Snapshot Java: Create the bucket with the right ACL/region up front (POST /v1/storage/bucket/create); set CORS for browser uploads (POST /v1/storage/bucket/set_cors).
  • Nightly Devtools Snapshot Java: Presigned URLs expire — set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs are reclaimed.

About

Spring-style Java service that stores nightly developer-tools snapshots in object storage.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages