infraops

🧾 Configuration

← Back to README

🗂️ Area files

Each Pulumi area has a main.go, a Pulumi.yaml, and an HJSON configuration file under area/<name>/. The program reads the HJSON into the protobuf configuration and converts it to Go models for Pulumi. The schema defines the fields and deployment defaults.

Area Configuration
Applications apps.hjson
Cloudflare cf.hjson
DigitalOcean do.hjson
GitHub gh.hjson

The top-level version identifies the configuration schema. The HJSON reader rejects duplicate keys within an object and omits configuration values from duplicate-key diagnostics. For an application, this includes duplicate storage keys that differ only in capitalization. Pulumi and the providers validate additional resource constraints during preview or update.

Application startup

Set startup_timeout in an application’s apps.hjson entry to allow time for initialization before the container starts accepting TCP connections on port 8080. Use a positive Go duration of at most eight minutes. This leaves two minutes for scheduling and readiness within the default ten-minute rollout window. The allowance applies per pod. Kubernetes probes every 10 seconds, so startup_timeout: "65s" allows seven consecutive failures. InfraOps rounds partial intervals up. Omitting the field or setting it to "" allows five failures, or roughly 50 seconds.

The updated cmd/bump ships after the InfraOps release that adds startup_timeout. Older helpers rewrite all of apps.hjson and drop this field even when bumping another app. Before resuming automated bumps, publish a release image with the updated helper and switch every app pipeline to it.

🧰 Maintainer tools

Both helpers rewrite HJSON in place. Build and run them from the repository root.

Task Build Example
Normalize an area’s configuration make build-format ./format -k cf
Update an application version make build-bump ./bump -n "$app_name" -v 1.2.3

Both commands accept -p <path> to override the default configuration file. The formatter supports apps, cf, do, and gh, defaults to area/<kind>/<kind>.hjson, and rejects mismatched area fields before writing. For the version helper example, set app_name to an application’s name in the configuration. The helper defaults to area/apps/apps.hjson and expects a semantic version from automation. Use -h for the full flags.

🧬 Schema changes

After editing service.proto, run make api-generate and include the generated service.pb.go in the same change. Run make dep before local validation. Use make help for the command catalog and the CircleCI configuration for the checks run in CI. The golangci-lint wrapper skips its check when the tool is absent from PATH.

CI runs make api-lint. The optional make api-breaking compares against GitHub master and requires network access. See the accepted schema decision for the current CI baseline. Adding startup_timeout renumbers secrets, env_vars, and storage. Rebuild binary protobuf producers and consumers together when upgrading across the field renumbering or the earlier move to named storage. See application storage for migrating HJSON configurations that still use the old storage layout.