Docs

Release and update

An extension ships inside your release, pinned by digest. You update it with a new release, like anything else in the stack.

alien extensions build

It writes the extension's bundle, everything Alien needs to run it, to target/alien-extension/, and the TypeScript your stack imports to generated/:

acme/
├── generated/
│   └── index.ts                    # the DnsZone builder and the acme export for alien.ts
└── target/alien-extension/
    ├── acme-core.zip               # manifest.json, hooks.wasm, controller.wasm, permissions/, schemas/
    └── acme-controller-darwin-arm64    # the local controller, for alien dev
  • hooks.wasm is the hooks module, with every modifier, interceptor, emitter, importer, and link.
  • controller.wasm is the controller module, with the controller for each cloud. The Alien manager, the Operator, and the setup CLI run it in a sandbox.
  • manifest.json names the extension, its version, its protocol versions, its custom resource types, the origins it declares, and the sha256 of each module and each controller binary.
  • Each acme-controller-<target> is the native binary alien dev runs the local controller from, for one operating system and CPU.

An extension without a controller, such as one with only modifiers, has no controller module and no controller binaries.

The build reads which platforms each custom resource type has a controller for from the controller module, and from the binary for Platform::Local. It refuses a library that registers Platform::Local, and a binary that registers any other platform.

Controller targets

The controller module is one file for every machine. Only the native binary alien dev runs has a target, the operating system and CPU it runs on, one of linux-x64, linux-arm64, darwin-arm64, and windows-x64:

alien extensions build --target linux-x64,linux-arm64,darwin-arm64,windows-x64

Without --target, it builds every target your machine can. A darwin-arm64 controller builds only on a Mac.

Your own machine's target is enough for an extension only you develop. A bundle you publish for other developers needs a target for each machine they run alien dev on.

Release

alien release builds every extension alien.ts lists, uploads each bundle, and pins its digest in the release:

alien release

It refuses the release, before any customer gets it, when:

  • a bundle's hooks module or controller speaks a protocol version other than the one this Alien runs;
  • two extensions in the stack have the same name, or an extension declares a resource type outside its own name (<extension>/<type>), so no two extensions can declare one type;
  • an importer in the extension's workspace has no fixtures, or its fixtures fail the check in Testing;
  • the release removes an extension whose resource types are still in the stack;
  • protected deployments follow the release's channel and the release is promoted: signed releases don't support extensions yet, and a protected deployment runs only signed ones.

In a project that signs its releases, a release that lists extensions goes out unsigned. A stack without extensions releases as it always has.

Bundle delivery

Every Alien process that runs a released extension downloads the bundle by its digest, checks its sha256, and caches it. Nothing in it runs before the check passes.

WhereWhat it downloads
Alien, when it builds a setup packageThe hooks module
The Alien manager, in a push deploymentThe hooks module and the controller module
The Operator, in a pull deploymentThe hooks module and the controller module
The setup CLI, at initial setupThe hooks module and the controller module

The Operator and the setup CLI download from the Alien manager they connect to, which serves the bundle or redirects to where it is stored. A network that limits their egress must let them reach the manager and, behind a redirect, that storage host.

A download whose sha256 doesn't match is refused. The Operator then fails the update to that release with the refusal, which the deployment's status shows, and the resources of the release it runs stay as they are. Retrying the update downloads the bundle once more: if its bytes are fixed, the update goes ahead.

The release also pins the origins the extension declares. Alien refuses a bundle whose origins differ from the ones the stack lists, so the origins the customer reviewed are the ones the controller can call.

Update

A new version of an extension is a release like any other. Change the code, run alien release, and each deployment gets the new extension when it moves to that release, through its channel or a pin.

When each part of the change takes effect:

  • Modifiers and emitters change the setup template. A deployment already set up gets the change when its admin reruns initial setup with the new template.
  • Interceptors apply to every matching call Alien makes after the update. An existing resource gets a new setting the next time Alien sends it a matching call.
  • Controllers run the new module from the deployment's first step on the new release, in the manager, the Operator, and the setup CLI.

Roll back

A new version of your controller must read the state an older version saved. Add fields as optional, and keep state names, as Alien's own controllers do. A rollback to a controller that can't read newer state fails that resource, so roll forward instead.

A rollback with no state change works like any release rollback.

Remove an extension

An extension with only modifiers and interceptors can be removed in any release. Settings it already put on existing resources stay. The next setup template no longer carries its changes, once the admin applies it.

An extension whose custom resources are still in the stack is removed with one release for its resources, then one for the extension:

Remove its resources

Remove the extension's resources from alien.ts and release. The extension's controller deletes live ones. Frozen ones go when the admin reruns initial setup.

Remove the extension

Remove it from .extensions([...]) and release again.

alien release refuses a release that removes the extension first, and names the resources still in the stack.

Third-party extensions

An extension someone else writes ships as an npm package, with its generated TypeScript and the bundle alien extensions build wrote. You install the package, import the extension from it, and list it in .extensions([...]) like your own.

alien render, alien dev, and alien release read each extension from the folder its generated module sits in, whether you built it or installed it.

Next

  • Security: what an extension can reach, and what your customer reviews
  • Testing: the checks alien release runs, on your machine
  • Releases: channels, pins, and releasing from CI

On this page