Skip to content

Commit aff4c62

Browse files
committed
ensures builds succeed after repo restructure
1 parent 351dbd0 commit aff4c62

63 files changed

Lines changed: 173 additions & 3457 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-ghcr-images.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ on:
66
- main
77
paths:
88
- ".github/workflows/publish-ghcr-images.yml"
9-
- "platform/kratix/promises/redis/pipeline/**"
10-
- "platform/kratix/promises/cilium-api-access/pipeline/**"
11-
- "platform/kratix/promises/cilium-namespace-lockdown/pipeline/**"
12-
- "platform/kratix/promises/s3-bucket/pipeline/**"
13-
- "platform/kratix/promises/application-release/pipeline/**"
14-
- "demo/aws-sdk-go-v2/**"
15-
- "platform/demo/provider/todos-api/**"
16-
- "go/apps/request-logger-http/**"
17-
- "go/runtimeconditions/**"
18-
- "go/go.mod"
19-
- "go/go.sum"
9+
- "demos/kratix/promises/redis/pipeline/**"
10+
- "demos/kratix/promises/application-release/pipeline/**"
11+
- "demos/apps/todos-api/**"
12+
- "demos/apps/request-logger-http/**"
13+
- "extensions/**"
2014
workflow_dispatch:
2115

2216
permissions:
@@ -32,26 +26,17 @@ jobs:
3226
matrix:
3327
image:
3428
- name: redis-pipeline
35-
context: platform/kratix/promises/redis/pipeline
36-
file: platform/kratix/promises/redis/pipeline/Dockerfile
37-
# - name: cilium-api-access-pipeline
38-
# context: platform/kratix/promises/cilium-api-access/pipeline
39-
# file: platform/kratix/promises/cilium-api-access/pipeline/Dockerfile
40-
# - name: cilium-namespace-lockdown-pipeline
41-
# context: platform/kratix/promises/cilium-namespace-lockdown/pipeline
42-
# file: platform/kratix/promises/cilium-namespace-lockdown/pipeline/Dockerfile
43-
# - name: s3-bucket-pipeline
44-
# context: platform/kratix/promises/s3-bucket/pipeline
45-
# file: platform/kratix/promises/s3-bucket/pipeline/Dockerfile
29+
context: demos/kratix/promises/redis/pipeline
30+
file: demos/kratix/promises/redis/pipeline/Dockerfile
4631
- name: application-release-pipeline
47-
context: platform/kratix/promises/application-release/pipeline
48-
file: platform/kratix/promises/application-release/pipeline/Dockerfile
32+
context: demos/kratix/promises/application-release/pipeline
33+
file: demos/kratix/promises/application-release/pipeline/Dockerfile
4934
- name: todos-api
50-
context: platform/demo/provider/todos-api
51-
file: platform/demo/provider/todos-api/Dockerfile
35+
context: demos/apps/todos-api
36+
file: demos/apps/todos-api/Dockerfile
5237
- name: request-logger
5338
context: .
54-
file: go/apps/request-logger-http/Dockerfile
39+
file: demos/apps/request-logger-http/Dockerfile
5540

5641
steps:
5742
- name: Check out source

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Runtime Conditions Profilers
22

3-
Declare your service’s dependencies in code (Go or Python) and automatically generate the configurations needed for deployment. No YAML or manual steps required: just run a command in your CI pipeline to produce a spec that downstream tools (Kubernetes, Cilium, databases, etc.) can consume.
3+
Declare your service's runtime dependencies in code and generate a Runtime Conditions Profile that downstream tools can consume. The Go AST profiler reads first-party extension declaration packages and emits profile YAML for adapters and validators.
44

55
## The Problem
66

@@ -10,11 +10,11 @@ Downstream tooling is often a patchwork of one-off configurations and fragmented
1010

1111
## The Proposal
1212

13-
This tool replaces chaos and confusion with a [three-step workflow](https://colinjlacy.github.io/runtime-conditions-profiles/):
13+
This repository is organized around a [three-step workflow](https://colinjlacy.github.io/runtime-conditions-profiles/):
1414

15-
- The source code uses integrations. For an example, the demo app below calls an HTTP API, Redis, and S3.
15+
- The source code uses integrations. For an example, the demo app calls an HTTP API and Redis.
1616
- A generator emits a profile that includes requirements and environment variable names, not target values.
17-
- An adapter fulfills the profile. The Kratix demo maps Conditions to Redis, S3, Secrets, ConfigMaps, and Cilium policies.
17+
- An adapter fulfills the profile. The Kratix demo assets map Conditions to platform resources such as Redis, ConfigMaps, Secrets, and network policy.
1818

1919
## Who Benefits
2020

@@ -37,17 +37,20 @@ This tool replaces chaos and confusion with a [three-step workflow](https://coli
3737

3838
## Contents
3939

40-
This repository contains three separate implementation areas:
40+
This repository contains:
4141

4242
- `ebpf-profiler/` - the original Linux eBPF runtime observation profiler.
43-
- `go/` - Go declaration library, Go AST profiler, and Go sample services.
44-
- `python/` - Python declaration library, Python AST profiler, and Python sample services.
43+
- `docs/` - the Runtime Conditions Profile specification draft and authoring guides.
44+
- `extensions/` - first-party extension definitions and their Go declaration packages.
45+
- `go/profiler/` - the maintained Go AST profile generator.
46+
- `demos/apps/` - demo workloads used to exercise declaration packages and downstream adapters.
47+
- `demos/kratix/` - Kratix adapter and Promise demo assets.
48+
- `examples/sdks/` - SDK packaging examples for package-owned manifests.
4549

46-
The Runtime Conditions Profile specification draft lives in `docs/`. Start with
47-
`docs/intro.md` for the core spec, extension drafts, and SDK integration guides.
50+
The Runtime Conditions Profile specification draft lives in `docs/fifth-draft.md`.
4851

4952
The GitHub Pages reader site lives in `site/`. It is a static site that presents
50-
the current spec, extension model, implementation guides, and end-to-end Kratix
53+
the spec, extension model, implementation guides, and end-to-end Kratix
5154
demo as a cohesive reader flow. The workflow in `.github/workflows/pages.yml`
5255
publishes that directory to GitHub Pages.
5356

@@ -65,19 +68,12 @@ The generated eBPF bindings are produced by `bpf2go` from `ebpf-profiler/pkg/pro
6568
## Go AST Profiler
6669

6770
```sh
68-
cd go
71+
cd go/profiler
6972
go test ./...
70-
go run ./profiler -dir ./apps/traffic -name traffic-generator
71-
docker compose up
72-
```
73-
74-
## Python AST Profiler
75-
76-
```sh
77-
cd python
78-
python3 -m unittest discover -s tests
79-
python3 -m runtimeconditions.profiler -d apps/traffic -n traffic-generator
80-
docker compose up
73+
go run . \
74+
-dir ../../demos/apps/request-logger-http \
75+
-name request-logger-http \
76+
-workload-version dev
8177
```
8278

8379
## Try It Out

docs/core/kratix-runtime-conditions-implementation-proposal.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ Those are important, but they should come after the first executable proof.
5757
The target outcome is a repeatable demo command that deploys a real application to Kubernetes through Kratix:
5858

5959
```bash
60-
rc deploy ./go/apps/request-logger \
60+
rc deploy ./demos/apps/request-logger-http \
6161
--image ghcr.io/example/request-logger:dev \
6262
--namespace demo
6363
```
6464

6565
That command should:
6666

67-
1. run the Go or Python AST profiler
67+
1. run the Go AST profiler
6868
2. generate a Runtime Conditions Profile
6969
3. create or update a Kratix `ApplicationRelease` resource request
7070
4. wait for Kratix workflow completion
@@ -449,11 +449,9 @@ The application should not be deployed with a known incompatible API contract.
449449
## Proposed Repository Layout
450450

451451
```text
452-
platform/
452+
demos/
453453
README.md
454454
kratix/
455-
install/
456-
quickstart.md
457455
promises/
458456
redis/
459457
promise.yaml
@@ -470,34 +468,27 @@ platform/
470468
todos-api.catalog-info.yaml
471469
todos.openapi.yaml
472470
todos.openapi.breaking.yaml
473-
demo/
474-
provider/
475-
todos-api/
476-
main.go
477-
Dockerfile
478-
k8s.yaml
479-
consumer/
480-
go/
481-
main.go
482-
Dockerfile
483-
python/
484-
main.py
485-
Dockerfile
486-
scripts/
487-
smoke-test.sh
488-
break-openapi.sh
471+
apps/
472+
todos-api/
473+
main.go
474+
Dockerfile
475+
k8s.yaml
476+
request-logger-http/
477+
main.go
478+
conditions.go
479+
Dockerfile
489480
```
490481

491-
The existing Go and Python profilers can stay in their language-specific trees. The new `platform/` tree should contain the Kratix-specific implementation and demo assets.
482+
The Go profiler stays in `go/profiler`. Kratix-specific implementation and demo assets live under `demos/kratix`.
492483

493484
## CLI Responsibilities
494485

495486
The `rc deploy` command should be a thin automation wrapper around existing tools.
496487

497488
It should:
498489

499-
1. detect Go or Python source
500-
2. run the correct AST profiler
490+
1. detect Go source
491+
2. run the Go AST profiler
501492
3. produce the Runtime Conditions Profile
502493
4. create the `ApplicationRelease` request
503494
5. apply it with `kubectl`

docs/guides/generator-discovery-workflow.md

Lines changed: 26 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -47,80 +47,55 @@ The current Go demo generator performs these steps:
4747

4848
The generator does not need `-extensions-root` for package manifests shipped by imported SDK packages.
4949

50-
The `-extensions-root` flag remains useful for local extension catalogs and legacy binding manifests, but SDK package manifests are discovered from imports.
50+
The `-extensions-root` flag is useful for local extension catalogs and manifests loaded from explicit extension roots, while SDK package manifests are discovered from imports.
5151

5252
---
5353

5454
# 3. Demo Walkthrough
5555

56-
The demo workload imports a local SDK package:
56+
The current request logger demo imports explicit first-party declaration packages:
5757

5858
```go
59-
import "github.com/colinjlacy/golang-http-profiler/demo/aws-sdk-go-v2/service/s3"
59+
import (
60+
common "github.com/colinjlacy/runtime-conditions-profiles/extensions/common-integrations/go"
61+
env "github.com/colinjlacy/runtime-conditions-profiles/extensions/env-configuration/go"
62+
)
6063
```
6164

62-
The workload calls the SDK normally:
65+
The workload declares an HTTP API and Redis cache:
6366

6467
```go
65-
func writeAuditLog(ctx context.Context, event string) error {
66-
bucket := os.Getenv("AUDIT_LOG_BUCKET")
67-
if bucket == "" {
68-
return errors.New("AUDIT_LOG_BUCKET is not set")
69-
}
70-
client := s3.NewFromConfig(s3.Config{})
71-
_, err := client.PutObject(ctx, &s3.PutObjectInput{
72-
Bucket: stringPtr(bucket),
73-
Key: stringPtr("request-logger/demo.json"),
74-
Body: strings.NewReader(event),
75-
})
76-
return err
77-
}
78-
```
79-
80-
The SDK package includes:
81-
82-
```text
83-
demo/aws-sdk-go-v2/service/s3/
84-
client.go
85-
runtimeconditions.package.yaml
86-
aws-object-store-v1alpha1.yaml
87-
```
88-
89-
The package manifest maps `Client.PutObject` to:
68+
common.API("todos-api",
69+
common.Spec("openapi", "catalog://api/default/todos-api", "1.0.0"),
70+
common.GET("/todos/{id}", common.Response[Todo]()),
71+
env.Env("baseUrl", "TODOS_API_URL"),
72+
)
9073

91-
```yaml
92-
kind: aws.object_store
93-
interfaceType: aws.s3
94-
configuration:
95-
env:
96-
- property: bucket
97-
name: AUDIT_LOG_BUCKET
98-
- property: region
99-
name: AWS_REGION
100-
- property: accessKeyId
101-
name: AWS_ACCESS_KEY_ID
102-
sensitive: true
103-
- property: secretAccessKey
104-
name: AWS_SECRET_ACCESS_KEY
105-
sensitive: true
74+
common.Cache("request-cache",
75+
common.KeyValue(common.Redis),
76+
env.EnvAlternative(env.Env("url", "REDIS_URL")),
77+
env.EnvAlternative(
78+
env.Env("hostname", "REDIS_HOST"),
79+
env.Env("port", "REDIS_PORT"),
80+
),
81+
)
10682
```
10783

10884
Running the generator:
10985

11086
```sh
111-
cd go
112-
go run ./profiler \
113-
-dir ./apps/request-logger-http \
87+
cd go/profiler
88+
go run . \
89+
-dir ../../demos/apps/request-logger-http \
11490
-name request-logger-http \
11591
-workload-uri github.com/example/request-logger-http \
11692
-workload-version v0.1.0
11793
```
11894

119-
produces a profile that includes both explicit declarations and SDK-discovered Conditions:
95+
produces a profile that includes the directly used declaration package extensions:
12096

12197
```yaml
12298
extensions:
123-
- https://aws.example.com/runtimeconditions/object-store:v1alpha1
12499
- https://runtimeconditions.io/extensions/common-integrations:v1alpha1
125100
- https://runtimeconditions.io/extensions/env-configuration:v1alpha1
126101

@@ -148,41 +123,22 @@ conditions:
148123
name: REDIS_HOST
149124
- property: port
150125
name: REDIS_PORT
151-
- name: s3-object-store
152-
kind: aws.object_store
153-
interface:
154-
type: aws.s3
155-
bucketClass: standard
156-
configuration:
157-
env:
158-
- property: bucket
159-
name: AUDIT_LOG_BUCKET
160-
- property: region
161-
name: AWS_REGION
162-
- property: accessKeyId
163-
name: AWS_ACCESS_KEY_ID
164-
sensitive: true
165-
- property: secretAccessKey
166-
name: AWS_SECRET_ACCESS_KEY
167-
sensitive: true
168126
```
169127
170-
The `todos-api` and `request-cache` Conditions come from explicit `rc` declarations in the workload. The `s3-object-store` Condition comes from normal SDK usage plus the SDK package manifest.
128+
The `todos-api` and `request-cache` Conditions come from explicit first-party declaration package calls in the workload. A workload that also imports an SDK package with a manifest can emit additional SDK-discovered Conditions from that SDK usage.
171129

172130
The profile records the environment variable names expected by the workload. It does not contain the values for those variables. In the Kratix demo, the runtime-workload adapter maps these requested properties to provider-owned outputs:
173131

174132
| Condition property | Kubernetes source |
175133
| ---- | ---- |
176134
| `baseUrl` | Literal service URL from the API catalog |
177135
| `url`, `hostname`, `port` | Redis Promise connection ConfigMap |
178-
| `bucket`, `region` | S3Bucket Promise connection ConfigMap for the provisioned AWS bucket |
179-
| `accessKeyId`, `secretAccessKey` | S3Bucket Promise credentials Secret for the generated bucket-scoped IAM access key |
180136

181137
The same adapter emits Cilium policy requests for the resolved workload:
182138

183139
- A `CiliumNamespaceLockdown` request creates namespace default-deny pod networking.
184140
- A `CiliumAPIAccess` request is emitted for API Conditions that declare HTTP operations. That request contains the workload selector, resolved service or FQDN destination, port, and only the `method` and `path` pairs declared by the Condition.
185-
- Redis and S3Bucket requests include the workload selector so their Promises can render dependency-specific Cilium policies.
141+
- Redis requests include the workload selector so their Promises can render dependency-specific Cilium policies.
186142

187143
The generator still emits only the Runtime Conditions Profile. Network-policy requests are adapter output.
188144

docs/guides/package-artifact-conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The package MAY include one or more language-specific sections. A generator igno
8181

8282
# 3. Go Section
8383

84-
The current demo implements a Go section.
84+
The current example implements a Go section.
8585

8686
```yaml
8787
go:

0 commit comments

Comments
 (0)