OXYGENHUB
# e2189ffef8ff oxygenflow / images / tofu / README.md
1.5 KiB · Markdown · last changed The OpenTofu image for deploy jobs 21 days ago renderedsource blame history raw

The OxygenFlow OpenTofu image

A root file system for deploy jobs (oxygenflow#56):

  • Debian bookworm, slim, with CA certificates.
  • OpenTofu 1.13.1, checked against its published SHA-256.
  • A provider mirror in /opt/tofu/mirror: hashicorp/google 8.7.0 and cloudflare/cloudflare 5.28.0, checked by tofu providers mirror against the registry's signed checksums when the image is built.
  • /etc/tofu/cli.tfrc (set by TF_CLI_CONFIG_FILE) installs providers from the mirror only.

So tofu init, fmt and validate need no network; plan and apply reach the cloud's APIs through allow-listed egress (#55). The guest's environment is the pipeline's, so a job sets TF_CLI_CONFIG_FILE itself (below).

Building and importing

images/tofu/build.sh /path/to/oxygenflow-tofu.tar
scp /path/to/oxygenflow-tofu.tar claude@earth:/home/claude/flow/dl/
ssh claude@earth 'cd ~/flow && FLOW_HOME=~/flow bin/flow rootfs import dl/oxygenflow-tofu.tar'

Pin the printed hash in the pipelines that use it, and push it to the hub (flow rootfs push HASH) so every runner can fetch it.

A provider version in a pipeline's lock file must be in the mirror: bump mirror.tf, rebuild and re-pin when a lock file changes.

Using it

sandbox "tofu" {
    runtime "microvm"
    rootfs "cas://blob/<hash printed by flow rootfs import>"
    memory-limit "2GiB"
    cpu-limit 2
    network "isolated"
    env {
        TF_CLI_CONFIG_FILE "/etc/tofu/cli.tfrc"
        TF_IN_AUTOMATION "1"
    }
}