Repository navigation
feat: mint Vault child tokens, resolve host credential paths, run prepare steps and host suites - #8
Merged
Conversation
…d host suites Co-authored-by: Cursor <cursoragent@cursor.com>
…lock - Use a cached child token by its recorded expiry without asking Vault, and reuse it until half of the lease Vault granted has passed, so a login near its end no longer mints a token on every command. - Pass VAULT_TOKEN through unchecked when there is no ~/.vault-token to fall back to; warn when Vault grants less than vault.ttl. - Name the shared child token "aviary" and say plainly that it carries every policy of the parent login. - Run prepare steps at most once per command and under the stack lock, so `aviary test` no longer prepares twice and parallel commands never race. - Pass container suite env through compose's environment with `--env KEY`, keeping values out of the process list; `$$` is a literal `$`, and env values no longer depend on map order. - `aviary pull` only runs gcloud when an ADC file exists. - README and `aviary test --help` cover pull, prepare, host suites and Vault. Co-authored-by: Cursor <cursoragent@cursor.com>
A first init can sit for several minutes with no output, which looks like a hang. Co-authored-by: Cursor <cursoragent@cursor.com>
…top warnings Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Background
aviarygives each git worktree its own Docker Compose project, volumes, and host ports. In repositories likefdy, running a stack or test suite still required per-shell setup outsideaviary: minting and exporting aVAULT_TOKENin every shell, exporting a host path to Google Application Default Credentials, copying gitignored OpenAPI/codegen artifacts in fresh worktrees, re-seeding the database from scratch for minutes in every new worktree, and translating repo-root file paths to package-relative paths by hand.Problem
VAULT_TOKENvalues go stale.initortestwhen gitignored build artifacts have not been copied yet, and pay minutes re-seeding Postgres even when another worktree already seeded the same data.pnpm/uvwith per-worktree ports) could not be defined asaviary testsuites, and repo-relative test paths (aviary test model_train-file -- workers/model_train/tests/foo.py) failed because the runner's working directory is the subpackage.docker composehealth-wait spinners flood non-TTY agent logs (Second cold walkthrough of fdy under aviary: image pull gaps, noisy run output, TOKEN_FILE undefined #7),compose pullfails non-interactively ongcloudreauth (Cold walkthrough of fdy under aviary: doc gaps and friction (colima, Rosetta check, image pull, OOM) #6, Second cold walkthrough of fdy under aviary: image pull gaps, noisy run output, TOKEN_FILE undefined #7), and Apple silicon laptops without Rosetta or with low VM memory runlinux/amd64containers 4-6x slower without warning.Abstract Solution
Add native zero-ceremony primitives to
aviary.ymland the CLI soaviary test <suite>works from a cold shell with zero environment exports:vault(internal/vault): checks an ambientVAULT_TOKENvialookup-self; when unset or expired alongside a~/.vault-token, mints a non-renewable child token, caches it under$XDG_STATE_HOME/aviary/vault-token.json(0600,flock-locked,fsynced), and reuses it across worktrees and shells until less than half ofttlremains.host_envandprepare(internal/config,internal/stack): fills unset host variables from~/-expanded host paths (failing early withhintwhenrequired: trueand missing), and runspreparecommands once under the stack lock beforeup,init,run, and suites (unlessprepare: false).workdirpath normalization (internal/config,internal/stack): runshost: truesuites directly on the host inworkdirwith${AVIARY_PORT_*}expanded insuite.env, and stripsworkdirprefixes from path arguments for both host and container suites while preserving:lineand::testselectors.internal/snapshot,internal/stack): caches seeded volumes under$XDG_CACHE_HOME/aviary/snapshotskeyed by volume names, mounting images,initsteps, andkey_files, stamped bystamp_files. Restores exact matches directly, or restores a prior stamp and runsafter_restorebefore saving the updated snapshot.internal/dockerdesktop): warns once on Apple silicon whenlinux/amd64compose services run without Apple Virtualization framework + Rosetta or with< 8192 MiBVM memory.aviary pulland quiet non-TTY progress: pulls across--profile *usingCLOUDSDK_AUTH_ACCESS_TOKENfrom Google ADC when available, and setsCOMPOSE_PROGRESS=quietwhenstderris not a terminal.