execution-server

command
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Execution server

This example turns the CreateOS Go SDK into a small HTTP execution service. A POST /v1/execute request creates a fresh sandbox, runs one command, captures its output, destroys the sandbox, and returns JSON. See main.go for the code.

Run the server:

export CREATEOS_API_KEY="your-api-key"
go run ./examples/execution-server

It listens on 127.0.0.1:8080 by default. Send a command without shell interpolation:

curl --fail-with-body http://127.0.0.1:8080/v1/execute \
  --header 'Content-Type: application/json' \
  --data '{"command":"python3","arguments":["-c","print(sum(range(10)))"]}'

The response includes command output even when the command exits nonzero:

{
  "stdout": "45\n",
  "stderr": "",
  "exitCode": 0,
  "executionMilliseconds": 154.48
}

The example limits request bodies to 1 MiB and permits four concurrent executions. Excess requests receive HTTP 429. Invalid input receives HTTP 400, control-plane failures receive HTTP 502, and timeouts receive HTTP 504.

[!WARNING] This endpoint runs arbitrary commands and intentionally binds only to localhost. Add authentication, authorization, rate limiting, audit logging, and workload policy before exposing a similar service to any network.

Set EXECUTION_SERVER_ADDRESS to override the listen address.

Documentation

Overview

Command execution-server exposes a small HTTP API that executes commands in a fresh CreateOS sandbox for every request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL