You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spored: support email/webhook notifications when job completes (SPAWN_COMPLETE touched or TTL fires) #107
spored monitors instance lifecycle but has no way to notify users when a workload finishes. Users who close their laptops after launching a job have no way to know when it completes other than polling spawn status.
Use cases
Job completes — user touches /tmp/SPAWN_COMPLETE, spored executes --on-complete stop/terminate, then sends a notification
TTL fires — instance terminates due to deadline; notification includes job name, final status, and any --pre-stop output
Idle timeout — instance stops due to inactivity (possible crash/early completion); notification warns user to check logs
SNS — spored creates/reuses an SNS topic, subscribes the endpoint, publishes on state change. Simple, AWS-native, works with email/SMS/webhook.
Direct email via SES — spored sends email directly via SES when available.
Webhook — spored POSTs a JSON payload to the configured URL on completion.
The SNS approach is cleanest since it composes with EventBridge for more complex routing.
Message format
Should be human-readable, not raw JSON:
BuckAI job "my-job" completed on i-0abc123def456
Status: stopped (SPAWN_COMPLETE signal received)
Runtime: 2h 34m
Instance: r7i.4xlarge in us-east-2
To check outputs:
spawn connect my-job
Context
Discovered while building Tutorial 01 (SageMaker jobs) for BuckAI Observatory. We implemented a workaround using EventBridge + SNS from outside spawn, but it only works for SageMaker-specific events. For EC2 workloads (Tutorials 02–04), users must poll manually. Native spored support would make this first-class for all workload types.
Partial: the event hook already exists, the transports don't
Checked what spored has today against this ask.
Events — already covered. spored has a Notifier (pkg/agent/notifier.go) and already fires Notify(eventType, detail) at exactly the three points this issue lists:
So the lifecycle plumbing — when to notify — is done and in the right place.
Transports — not covered.Notify has exactly one sink: the spore-bot Lambda (Slack), gated on NotifyURL + a Slack workspace ID + the spore-bot infra. There is no email, SNS, or generic webhook path (there's a literal // Future enhancement: Support webhooks, email, SNS marker at agent.go:1019). So the proposed --notify email:… / --notify webhook:… don't exist yet, and a user without spore-bot/Slack gets nothing.
So, to the submitter: does the existing Slack path solve your case? If you're already on spore-bot/Slack, completion/TTL/idle notifications work today — worth confirming. If you need email or a raw webhook (the BuckAI tutorial case sounds like it does, since you used external EventBridge+SNS), that's the real gap.
Scoping if we build it. The architecture is already the right shape — one internal Notify(eventType, detail) seam — so this is a transport-fanout change, not a rearchitecture:
Generalize Notifier to a list of sinks behind a small interface; keep the spore-bot sink as one implementation.
Add webhook (POST the existing notifyRequest JSON to an arbitrary URL — simplest, no AWS deps) and SNS (publish to a topic — composes with EventBridge, AWS-native; SES/email can ride SNS subscriptions rather than spored sending mail directly).
Parse --notify <scheme>:<target> (repeatable) + a spawn config set notify … default into config/tags spored reads — same tag-driven pattern as the other lifecycle settings.
Enrich the completion detail (currently empty at agent.go:1045) with the human-readable runtime/status/type payload this issue mockups — so non-Slack sinks carry it too.
Leaving open as an enhancement. The webhook sink is the cheapest first slice and unblocks the non-Slack case; SNS/email can follow.
Submitter answer: no, the Slack path doesn't cover us — we need email + generic transports
Confirming the requirement, since the triage comment asked.
The Slack/spore-bot path does not solve the motivating case. Prof. Moortgat (BuckAI Observatory, OSU) isn't on spore-bot or any Slack workspace — he's a researcher who launches a job, closes his laptop, and wants an email when it's done. That's the whole reason Tutorial 01 grew an external EventBridge→SNS→email workaround (common/notify.py): spored had no email sink, so we bolted one on outside spawn. It only catches SageMaker job-state events, so the EC2 tutorials (02–04) still leave the user polling spawn status by hand.
Priority order for us:
Email — the actual end-user need. Non-technical researcher, no chat tooling, just wants "your job finished."
Generic webhook — useful for us as integrators (wire completion into our own automation / dashboards without standing up spore-bot).
SNS — nice-to-have; valuable because it composes with EventBridge and because email/SMS can ride SNS subscriptions rather than spored sending mail directly.
So the webhook-first slice you proposed is the right cheapest start, but email is the one that actually unblocks the BuckAI case — whether that's delivered via SNS-subscription or SES directly doesn't matter to us, only that --notify email:[email protected] works without any Slack/spore-bot dependency.
If native email lands, we delete common/notify.py entirely and Tutorial 01's notification story becomes a single --notify flag for all four tutorials instead of SageMaker-only EventBridge plumbing.
Activity
scttfrdmn commentedon Jun 12, 2026
Partial: the event hook already exists, the transports don't
Checked what spored has today against this ask.
Events — already covered. spored has a
Notifier(pkg/agent/notifier.go) and already firesNotify(eventType, detail)at exactly the three points this issue lists:"completion"agent.go:1045"ttl_expired"(+"ttl_warning"at T-5m)agent.go:331/342"idle_stopped"/"idle_hibernated"(+"idle_warning")agent.go:382/385/399So the lifecycle plumbing — when to notify — is done and in the right place.
Transports — not covered.
Notifyhas exactly one sink: the spore-bot Lambda (Slack), gated onNotifyURL+ a Slack workspace ID + the spore-bot infra. There is no email, SNS, or generic webhook path (there's a literal// Future enhancement: Support webhooks, email, SNSmarker atagent.go:1019). So the proposed--notify email:…/--notify webhook:…don't exist yet, and a user without spore-bot/Slack gets nothing.So, to the submitter: does the existing Slack path solve your case? If you're already on spore-bot/Slack, completion/TTL/idle notifications work today — worth confirming. If you need email or a raw webhook (the BuckAI tutorial case sounds like it does, since you used external EventBridge+SNS), that's the real gap.
Scoping if we build it. The architecture is already the right shape — one internal
Notify(eventType, detail)seam — so this is a transport-fanout change, not a rearchitecture:Notifierto a list of sinks behind a small interface; keep the spore-bot sink as one implementation.notifyRequestJSON to an arbitrary URL — simplest, no AWS deps) and SNS (publish to a topic — composes with EventBridge, AWS-native; SES/email can ride SNS subscriptions rather than spored sending mail directly).--notify <scheme>:<target>(repeatable) + aspawn config set notify …default into config/tags spored reads — same tag-driven pattern as the other lifecycle settings.completiondetail (currently empty atagent.go:1045) with the human-readable runtime/status/type payload this issue mockups — so non-Slack sinks carry it too.Leaving open as an enhancement. The webhook sink is the cheapest first slice and unblocks the non-Slack case; SNS/email can follow.
scttfrdmn commentedon Jun 12, 2026
Submitter answer: no, the Slack path doesn't cover us — we need email + generic transports
Confirming the requirement, since the triage comment asked.
The Slack/spore-bot path does not solve the motivating case. Prof. Moortgat (BuckAI Observatory, OSU) isn't on spore-bot or any Slack workspace — he's a researcher who launches a job, closes his laptop, and wants an email when it's done. That's the whole reason Tutorial 01 grew an external EventBridge→SNS→email workaround (
common/notify.py): spored had no email sink, so we bolted one on outside spawn. It only catches SageMaker job-state events, so the EC2 tutorials (02–04) still leave the user pollingspawn statusby hand.Priority order for us:
So the webhook-first slice you proposed is the right cheapest start, but email is the one that actually unblocks the BuckAI case — whether that's delivered via SNS-subscription or SES directly doesn't matter to us, only that
--notify email:[email protected]works without any Slack/spore-bot dependency.If native email lands, we delete
common/notify.pyentirely and Tutorial 01's notification story becomes a single--notifyflag for all four tutorials instead of SageMaker-only EventBridge plumbing.