Skip to content

add a local-setup phase that can be run from the creating system#16

Open
rjbs wants to merge 7 commits into
fastmail:mainfrom
rjbs:local-setup
Open

add a local-setup phase that can be run from the creating system#16
rjbs wants to merge 7 commits into
fastmail:mainfrom
rjbs:local-setup

Conversation

@rjbs
Copy link
Copy Markdown
Member

@rjbs rjbs commented May 25, 2026

No description provided.

rjbs and others added 7 commits May 24, 2026 16:12
Don't require that something be passed in.  If we get neither
taskstream_cb nor logsnippet_cb, create a TaskStream callback just in
time.  I want this because I want to add a second use of the callback,
and we can't reuse one that's been finalized.  This is a bit of a cop
out.  The correct refactoring would change BoxManager to expect a
callback factory, not a callback.  This one just lets it act like one if
we got no specific callback.  Something to fix later...

This also corrects a bug in the verbose_setup callback.  It wasn't
returning a Future, so couldn't be properly awaited.
First, only log the process status of the ssh process if it wasn't 0.
All zeroes are alike.

Then, stop saying a box is all done, because it might go on to need
locally-run setup (see the next commit).
A local setup program is run after the box is created, up, and has had
its remote custom setup run.  This is useful for copying elements to the
box that can only be retrieved from the local operator's environment.
Threads an optional env hash through _run_process_streaming via
IO::Async::Process's setup parameter, then uses it on the local setup
invocation to (a) signal FM_TASKSTREAM=1 like the remote ssh path does,
and (b) replace the NAME:/LABEL:/USERNAME: argv entries with BOX_NAME,
BOX_LABEL, BOX_USERNAME env vars -- which is what the original
never-committed design was using.

Co-authored-by: Claude <noreply@anthropic.com>
_mk_taskstream references Dobby::Boxmate::TaskStream, but the class
wasn't loaded by BoxManager itself; in production it worked only because
Dobby::Boxmate::App happens to load TaskStream first.  Add an explicit
use so BoxManager is self-sufficient.

Co-authored-by: Claude <noreply@anthropic.com>
After the BUILD constraint was relaxed to allow neither cb, the
no-cb-given case (where _mk_taskstream synthesizes a fresh TaskStream)
had no test coverage.  Add one.

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant