Start here
-A guide to Runtime Conditions Profiles.
+Preview test
+Congrats, the preview workflow is working! 🎉
- 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.
+ If you can read this, the /preview command built this pull request and served it from a temporary link. This page only exists in a test pull request and will never be merged.
The short version
-Here is the whole idea in six steps, using the example below.
+What this shows
-
-
- 1First, your app needs something.Maybe your app calls an HTTP API and a Redis cache.
-
- 2With RC: you declare it in your code.A few lines using a package we provide. They do nothing when your app runs.
-
- 3A tool reads your code.A profiler for Go, Java, Python, or TypeScript. Your app is never started.
-
- 4Out comes a profile, automatically.A YAML file with names like
TODOS_API_URLandREDIS_URL, and no passwords.
- - 5The platform team reads it.Now they know what to provide, with no guessing.
-
- 6And it just works.In the example below, Redis is created, the API is checked, and both URLs reach your app.
+
- 1A maintainer asked for a preview.The
/previewcomment was accepted because it came from someone with write access.
+ - 2The site was built from this pull request.This page is the pull request's version of the home page, not the live site.
+
- 3The link is temporary.It closes on its own when the time is up. Comment
/previewagain to open a new one.
Example first
-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.
+The rest of the site is unchanged, so the other chapters in the sidebar should open as usual.
Why this exists
-
- 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 profile | With a Runtime Conditions Profile | |
|---|---|---|
| Where the needs live | A developer's head, a Slack thread, an old wiki page | One YAML file, written from declarations in your code |
| A new developer joins | Someone explains it all again, from memory | They read the profile and know what the app needs |
| The answer was in a chat | It scrolled away months ago, if anyone can find it | It lives with the code, in the same repository |
| The app changes | Someone has to remember to update the wiki | The declaration changes in the same commit as the code |
| Who works it out | A platform engineer, by hand, piece by piece | Tools read it |
| When a mistake shows up | After release, in front of real users | When the profile is checked, with a clear reason |
| The next environment (test, then production) | Work it out again, a little differently each time | Every 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.
-