Start here

A guide to Runtime Conditions Profiles.

Declare what your app needs to run. The platform reads it and provides it.

Stage 1 of 4

Your code says what it needs

A few lines in Go, Java, Python or TypeScript. They do nothing when your app runs.

conditions.go
_ = common.Api(
  common.Http{ /* todos-api: GET /todos/{id} */ },
  env.HttpConfiguration{ /* TODOS_API_URL */ },
)
_ = common.Cache(
  common.KeyValue{ /* redis */ },
  env.KeyValueConfiguration{ /* REDIS_URL */ },
)
Code to profile

Runtime Conditions lets developers declare what an app needs to run, such as an API, a database, or a cache, in a machine-readable format. Start with a complete example, then see how a profile is written, how to generate one from your code with the rc CLI, and how a platform turns it into running infrastructure.

The short version

Here is the whole idea in six steps, using the example below.

  1. 1
    First, your app needs something.Maybe your app calls an HTTP API and a Redis cache.
  2. 2
    With RC: you declare it in your code.A few lines using a package we provide. They do nothing when your app runs.
  3. 3
    A tool reads your code.A profiler for Go, Java, Python, or TypeScript. Your app is never started.
  4. 4
    Out comes a profile, automatically.A YAML file with names like TODOS_API_URL and REDIS_URL, and no passwords.
  5. 5
    The platform team reads it.Now they know what to provide, with no guessing.
  6. 6
    And it just works.In the example below, Redis is created, the API is checked, and both URLs reach your app.

Example first

A complete profile document Where this comes from
apiVersion: runtimeconditions.io/v1alpha1
kind: RuntimeConditionsProfile # Describes what a workload needs at runtime.

metadata:
  name: request-logger-http

# The application these requirements belong to.
workload:
  uri: github.com/runtimeconditions/rc-demos/apps/request-logger-http
  version: v0.1.0

# Extensions define the Condition vocabulary and its validation rules.
# These cover integration requirements and environment-variable configuration.
extensions:
  - https://runtimeconditions.io/extensions/rc/common-integrations:v1alpha2
  - https://runtimeconditions.io/extensions/rc/env-configuration:v1alpha2

# Each Condition describes one runtime requirement.
conditions:
  - name: todos-api
    kind: api # Requirement category defined by the integration extension.
    interface: # Describes the capabilities the application needs.
      type: http
      spec:
        format: openapi
        # A catalog reference to the API contract, not its deployed service URL.
        uri: catalog://api/default/todos-api
        version: 1.0.0
      operations:
        - method: GET
          path: /todos/{id} # The API operation this application needs.
    configuration: # Describes how connection information reaches the application.
      env:
        - property: baseUrl # The connection property being requested.
          name: TODOS_API_URL # Variable name, not its deployed value.

  - name: request-cache
    kind: cache
    interface:
      type: key_value
      engine: redis # Requires Redis; the Profile does not provision it.
    configuration:
      # Alternative configuration forms: URL, OR hostname AND port together.
      # A platform adapter must understand and fulfill the selected form.
      alternatives:
        - env:
            - property: url
              name: REDIS_URL
        - env:
            - property: hostname
              name: REDIS_HOST
            - property: port
              name: REDIS_PORT

The profile names the workload, declares the extensions needed to interpret its vocabulary, and lists runtime Conditions. It does not contain service URLs, Redis hostnames, credentials, or target-environment choices.

Why this exists

Two panels at a shipping port. Without a label, a standard container of ice cream sits unplugged and melting while a worker looks confused, because nobody knows what it needs. With a Runtime Conditions label that says keep at minus 18 degrees and plug into power, the worker plugs it in and the ice cream stays frozen. Container means your app, label means the Runtime Conditions Profile, and port means the platform that provides the database, cache and queue.
Docker solved how to ship the box. It didn't solve what the box needs when it arrives. Today, platforms guess, and a wrong guess only shows up once the app is running. Runtime Conditions writes the needs on the label, so nobody has to guess, and anything missing is caught at deployment, before it reaches users.

The knowledge about what an app needs usually lives in one person's head. Here is what changes when it is written down once.

Without a profileWith a Runtime Conditions Profile
Where the needs liveA developer's head, a Slack thread, an old wiki pageOne YAML file, written from declarations in your code
A new developer joinsSomeone explains it all again, from memoryThey read the profile and know what the app needs
The answer was in a chatIt scrolled away months ago, if anyone can find itIt lives with the code, in the same repository
The app changesSomeone has to remember to update the wikiThe declaration changes in the same commit as the code
Who works it outA platform engineer, by hand, piece by pieceTools read it
When a mistake shows upAfter release, in front of real usersWhen the profile is checked, with a clear reason
The next environment (test, then production)Work it out again, a little differently each timeEvery environment reads the same file

Read in order

First half: what the profile is

Read chapters 1-5 to understand Conditions, profile shape, profiler output, extension vocabulary and packages, and the rc CLI.

Second half: how it gets used

Read chapters 6-8 to understand platform adapters, the working Kratix demo, and where each source file lives.