Skip to content

spored: support email/webhook notifications when job completes (SPAWN_COMPLETE touched or TTL fires) #107

Description

@scttfrdmn

Summary

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

  1. Job completes — user touches /tmp/SPAWN_COMPLETE, spored executes --on-complete stop/terminate, then sends a notification
  2. TTL fires — instance terminates due to deadline; notification includes job name, final status, and any --pre-stop output
  3. Idle timeout — instance stops due to inactivity (possible crash/early completion); notification warns user to check logs

Proposed flags

spawn launch my-job \
    --notify email:user@example.com \
    --notify webhook:https://hooks.slack.com/... \
    --ttl 4h --on-complete stop

Or a global config:

spawn config set notify email:user@example.com

Implementation options

  1. SNS — spored creates/reuses an SNS topic, subscribes the endpoint, publishes on state change. Simple, AWS-native, works with email/SMS/webhook.
  2. Direct email via SES — spored sends email directly via SES when available.
  3. 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.


Migrated from spore-host/spore-host#346 — spawn issues belong on this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lifecycleTTL / idle / on-complete / hibernation / reaperarea:sporedon-node agent: lifecycle, telemetry, readinessenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions