Skip to content

Commit a2e382f

Browse files
authored
Merge pull request #13 from bubustack/feature/operator-hardening-webhooks-timeouts-cel-rbac
feat(operator): harden controllers, enable webhooks, enforce timeouts…
2 parents bec8874 + f10b979 commit a2e382f

39 files changed

+918
-713
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Kubebuilder DevContainer",
3-
"image": "docker.io/golang:1.24-bookworm",
3+
"image": "docker.io/golang:1.25-bookworm",
44
"features": {
55
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
66
"ghcr.io/devcontainers/features/git:1": {}

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828

2929
- name: Set up Docker Buildx
3030
uses: docker/setup-buildx-action@v3
@@ -63,7 +63,7 @@ jobs:
6363
needs: build
6464
steps:
6565
- name: Checkout
66-
uses: actions/checkout@v4
66+
uses: actions/checkout@v5
6767

6868
- name: Build image for scanning
6969
uses: docker/build-push-action@v6
@@ -81,7 +81,7 @@ jobs:
8181
severity: 'CRITICAL,HIGH'
8282

8383
- name: Upload Trivy results
84-
uses: github/codeql-action/upload-sarif@v3
84+
uses: github/codeql-action/upload-sarif@v4
8585
if: always()
8686
with:
8787
sarif_file: 'trivy-results.sarif'

.github/workflows/lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ on:
44
push:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
lint:
912
name: Run on Ubuntu
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Clone the code
13-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1417

1518
- name: Setup Go
16-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@v6
1720
with:
1821
go-version-file: go.mod
1922

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
# Build and push Docker images when release is created
3535
- name: Checkout code
3636
if: ${{ steps.release.outputs.release_created }}
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@v5
3838

3939
- name: Set up Docker Buildx
4040
if: ${{ steps.release.outputs.release_created }}

.github/workflows/test-e2e.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ on:
44
push:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
test-e2e:
912
name: Run on Ubuntu
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Clone the code
13-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1417

1518
- name: Setup Go
16-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@v6
1720
with:
1821
go-version-file: go.mod
1922

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ on:
44
push:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
test:
912
name: Run on Ubuntu
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Clone the code
13-
uses: actions/checkout@v4
16+
uses: actions/checkout@v5
1417

1518
- name: Setup Go
16-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@v6
1720
with:
1821
go-version-file: go.mod
1922

CODE_OF_CONDUCT.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,18 @@ We agree to restrict the following behaviors in our community. Instances, threat
4646

4747
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
4848

49-
When an incident does occur, it is important to report it promptly. To report a possible violation, **[NOTE: describe your means of reporting here.]**
49+
When an incident does occur, it is important to report it promptly. To report a possible violation, please contact the Community Moderators via one of the following channels:
50+
51+
52+
- GitHub Discussions: https://github.com/bubustack/bobrapet/discussions (select the Community Moderation category)
53+
54+
If you are uncomfortable reporting publicly, email is preferred. We aim to acknowledge reports within 72 hours and will keep reporters updated as appropriate.
5055

5156
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
5257

5358

5459
## Addressing and Repairing Harm
5560

56-
**[NOTE: The remedies and repairs outlined below are suggestions based on best practices in code of conduct enforcement. If your community has its own established enforcement process, be sure to edit this section to describe your own policies.]**
57-
5861
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
5962

6063
1) Warning

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24-bookworm AS builder
2+
FROM golang:1.25-bookworm AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

README.md

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
[![Go Reference](https://pkg.go.dev/badge/github.com/bubustack/bobrapet.svg)](https://pkg.go.dev/github.com/bubustack/bobrapet)
33
[![Go Report Card](https://goreportcard.com/badge/github.com/bubustack/bobrapet)](https://goreportcard.com/report/github.com/bubustack/bobrapet)
44

5-
Bobrapet is a powerful, cloud-native workflow engine for orchestrating complex AI and data processing pipelines on Kubernetes. It leverages the declarative power of Custom Resource Definitions (CRDs) to let you define, manage, and execute multi-step, event-driven workflows with unparalleled flexibility and control.
5+
Bobrapet is a powerful, cloud-native workflow engine for orchestrating complex AI and data processing pipelines on Kubernetes. It leverages the declarative power of Custom Resource Definitions (CRDs) to let you define, manage, and execute multi-step, event-driven workflows with flexibility and control.
66

7-
For full product docs, visit: https://bubustack.io/docs/
7+
Quick links:
8+
- Operator docs: https://bubustack.io/docs/bobrapet
9+
- Quickstart: https://bubustack.io/docs/bobrapet/guides/quickstart
10+
- CRD reference: https://bubustack.io/docs/bobrapet/reference/crds
811

912
## 🌟 Key Features
1013

@@ -19,14 +22,8 @@ For full product docs, visit: https://bubustack.io/docs/
1922

2023
## 🏗️ Architecture
2124

22-
The `bobrapet` operator is engineered for robustness and maintainability, following best practices for Kubernetes controller design. The core `StoryRun` controller, for example, is built on a modular, sub-reconciler pattern:
23-
24-
- **Main Controller**: Acts as a lean, high-level orchestrator.
25-
- **RBAC Manager**: Manages all RBAC-related resources (`ServiceAccount`, `Role`, `RoleBinding`).
26-
- **DAG Reconciler**: Contains the entire workflow state machine, handling state synchronization, dependency analysis, and scheduling.
27-
- **Step Executor**: Manages the specific logic for launching different types of steps (`engram`, `executeStory`, etc.).
28-
29-
This clean separation of concerns makes the operator highly scalable, testable, and easy to extend.
25+
High-level architecture, patterns, and controller internals are documented on the website:
26+
- Overview and architecture: https://bubustack.io/docs/bobrapet/explanations/architecture
3027

3128
## 📚 Core Concepts
3229

@@ -39,32 +36,8 @@ This clean separation of concerns makes the operator highly scalable, testable,
3936

4037
## 🧰 Workflow Primitives
4138

42-
Beyond running custom `Engrams`, `Story` resources can use a rich set of built-in primitives for advanced control flow:
43-
44-
- **`loop`**: Iterate over a list and expand a template step per item.
45-
- `with.items`: CEL‑resolvable data (evaluated with `inputs`, `steps` contexts)
46-
- `with.template`: a single `Step` to instantiate per item
47-
- Limits: max 100 iterations; creates child `StepRun`s and records them under `status.primitiveChildren[step]`; marks the loop step Running ("Loop expanded").
48-
49-
- **`parallel`**: Run multiple steps concurrently.
50-
- `with.steps[]`: array of `Step` entries; each branch’s `with` is CEL‑resolved with `inputs` and `steps`
51-
- Creates sibling `StepRun`s; marks the parallel step Running ("Parallel block expanded").
52-
53-
- **`stop`**: Terminate the workflow early.
54-
- `with.phase`: one of `Succeeded|Failed|Canceled` (defaults to `Succeeded`)
55-
- `with.message`: optional human message
56-
- Sets `StoryRun.status.phase/message` and returns.
57-
58-
- **`executeStory`**: Run another `Story` as a sub‑workflow.
59-
- `with.storyRef`: `{ name, namespace? }`
60-
- Current status: placeholder; marks step Succeeded with a message.
61-
62-
- **`condition`, `switch`, `setData`, `transform`, `filter`, `mergeData`**:
63-
- Batch path: controller marks these primitives Succeeded with outputs available (no pod launch).
64-
- Evidence: batch primitive completion (internal/controller/runs/step_executor.go:49-51)
65-
- Streaming path: `transform` is evaluated in the Hub (CEL over payload/inputs) and forwarded downstream.
66-
67-
- API declares additional types (`wait`, `throttle`, `batch`, `gate`) for future use.
39+
See the guides for primitives, batch vs. streaming, impulses, and storage configuration:
40+
- Guides: https://bubustack.io/docs/bobrapet/guides
6841

6942
## 🚀 Quick Start
7043

@@ -129,13 +102,9 @@ kubectl get stepruns -l bubustack.io/storyrun=summarize-k8s-docs
129102

130103
## Environment variables (operator-injected; consumed by SDK)
131104

132-
- Identity: `BUBU_STORY_NAME`, `BUBU_STORYRUN_ID`, `BUBU_STEP_NAME`, `BUBU_STEPRUN_NAME`, `BUBU_STEPRUN_NAMESPACE`, `BUBU_STARTED_AT`
133-
- Inputs/Config: `BUBU_INPUTS`, `BUBU_CONFIG`, `BUBU_EXECUTION_MODE`
134-
- Storage: `BUBU_MAX_INLINE_SIZE`, `BUBU_STORAGE_PROVIDER`, `BUBU_STORAGE_TIMEOUT`, `BUBU_STORAGE_S3_BUCKET`, `BUBU_STORAGE_S3_REGION`, `BUBU_STORAGE_S3_ENDPOINT`
135-
- gRPC (server/client): `BUBU_GRPC_PORT`, `BUBU_GRPC_MAX_RECV_BYTES`, `BUBU_GRPC_MAX_SEND_BYTES`, `BUBU_GRPC_CLIENT_MAX_RECV_BYTES`, `BUBU_GRPC_CLIENT_MAX_SEND_BYTES`, `BUBU_GRPC_MESSAGE_TIMEOUT`, `BUBU_GRPC_CHANNEL_SEND_TIMEOUT`, `BUBU_GRPC_RECONNECT_BASE_BACKOFF`, `BUBU_GRPC_RECONNECT_MAX_BACKOFF`, `BUBU_GRPC_RECONNECT_MAX_RETRIES`
136-
- TLS (optional): `BUBU_GRPC_TLS_CERT_FILE`, `BUBU_GRPC_TLS_KEY_FILE`, `BUBU_GRPC_CA_FILE`, `BUBU_GRPC_CLIENT_TLS`, `BUBU_GRPC_CLIENT_CERT_FILE`, `BUBU_GRPC_CLIENT_KEY_FILE`, `BUBU_GRPC_REQUIRE_TLS`
137-
138-
See detailed tables in `bubustack.io/docs/reference`.
105+
For complete environment variable listings and defaults, see the operator configuration and transport reference:
106+
- Operator config: https://bubustack.io/docs/bobrapet/reference/config
107+
- gRPC transport: https://bubustack.io/docs/bobrapet/reference/grpc
139108

140109
## 🛠️ Local Development
141110

SECURITY.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Supported versions
44

5-
We provide security updates for the latest released version of the operator. Please ensure you are using a supported version to receive security patches.
5+
We provide security updates for the latest released minor of the operator. Please ensure you are using a supported version to receive security patches. We generally support the latest minor and the immediately previous minor.
6+
7+
Supported Kubernetes versions: we aim to support N-2 of upstream stable releases. For example, when Kubernetes 1.31 is current, we target 1.31, 1.30, 1.29. See `config/crd/kustomization.yaml` and CI matrices for exact compatibility.
68

79
## Reporting a vulnerability
810

@@ -18,7 +20,7 @@ When reporting a vulnerability, please provide the following information:
1820

1921
- **A clear description** of the vulnerability and its potential impact.
2022
- **Steps to reproduce** the vulnerability, including any example code, scripts, or configurations.
21-
- **The version(s) of the SDK** affected.
23+
- **The version(s) of the operator** affected.
2224
- **Your contact information** for us to follow up with you.
2325

2426
## Disclosure process
@@ -27,7 +29,9 @@ When reporting a vulnerability, please provide the following information:
2729
2. **Confirmation**: We will acknowledge your report within 48 hours.
2830
3. **Investigation**: We will investigate the vulnerability and determine its scope and impact. We may contact you for additional information during this phase.
2931
4. **Fix**: We will develop a patch for the vulnerability.
30-
5. **Disclosure**: We will create a security advisory, issue a CVE, and release a new version with the patch. We will credit you for your discovery unless you prefer to remain anonymous.
32+
5. **Disclosure**: We will create a security advisory, issue a CVE (if applicable), and release a new version with the patch. We will credit you for your discovery unless you prefer to remain anonymous.
33+
34+
We aim to resolve high severity vulnerabilities within 30 days, medium within 60 days, and low within 90 days, subject to complexity and scope. We'll keep you informed of progress.
3135

3236
We aim to resolve all vulnerabilities as quickly as possible. The timeline for a fix and disclosure will vary depending on the complexity and severity of the vulnerability. We will keep you informed of our progress throughout the process.
3337

0 commit comments

Comments
 (0)