Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions apps/codeai-production/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: codeai-production
namespace: argocd
annotations:
kargo.akuity.io/authorized-stage: kargo-project-codeai:production
labels:
app.kubernetes.io/managed-by: kargo
kargo.akuity.io/project: kargo-project-codeai
spec:
project: default
source:
repoURL: https://github.com/code-dot-org/k8s-gitops.git
targetRevision: stage/production
path: apps/codeai/deployments/production/deploy
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
syncOptions:
- ServerSideApply=true
18 changes: 16 additions & 2 deletions apps/codeai/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
This app's deployment definitions live under `deployments/`.
CodeAI now uses rendered stage branches.

Docker image tag writeback is done by the GitHub Actions workflow [`k8s-commit-image-ref-to-argocd.yml`](https://github.com/code-dot-org/code-dot-org/blob/staging/.github/workflows/k8s-commit-image-ref-to-argocd.yml).
- `main` keeps deployment metadata and env policy under `apps/codeai/`.
- Kargo renders manifests from the promoted `code-dot-org` commit plus the
matching immutable image tag.
- Argo CD deploys `staging`, `test`, and `levelbuilder` from the auto-syncing
`codeai` `ApplicationSet`.
- `codeai-production` is a separate Argo CD `Application` with no automated
sync so the Kargo `production` stage remains the deploy gate after review.
- No synthetic `warehouses/codeai/` release record is written back into
`k8s-gitops`.
- Before merging the Argo cutover to rendered branches, seed
`stage/staging`, `stage/test`, `stage/levelbuilder`, and `stage/production`.
Those refs are remote rollout state; the repo cannot declare them into
existence on its own.

The `k8s-adhoc` deployment remains outside this rendered-branch flow.
24 changes: 11 additions & 13 deletions apps/codeai/applicationset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ spec:
repoURL: https://github.com/code-dot-org/k8s-gitops.git
revision: main
files:
- path: apps/codeai/deployments/*/deployment.yaml
- path: apps/codeai/deployments/staging/deployment.yaml
- path: apps/codeai/deployments/test/deployment.yaml
- path: apps/codeai/deployments/levelbuilder/deployment.yaml
template:
metadata:
name: codeai-{{path.basename}}
annotations:
kargo.akuity.io/authorized-stage: kargo-project-codeai:{{path.basename}}
labels:
app.kubernetes.io/managed-by: kargo
kargo.akuity.io/project: kargo-project-codeai
spec:
project: default
sources:
- repoURL: https://github.com/code-dot-org/code-dot-org.git
targetRevision: '{{sourceRevision}}'
path: k8s/helm
helm:
releaseName: '{{path.basename}}'
valueFiles:
- $values/apps/codeai/envTypes/{{envType}}.values.yaml
- $values/apps/codeai/deployments/{{path.basename}}/values.yaml
- repoURL: https://github.com/code-dot-org/k8s-gitops.git
targetRevision: main
ref: values
source:
repoURL: https://github.com/code-dot-org/k8s-gitops.git
targetRevision: stage/{{path.basename}}
path: apps/codeai/deployments/{{path.basename}}/deploy
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: '{{namespace}}'
Expand Down
2 changes: 2 additions & 0 deletions apps/codeai/deployments/levelbuilder/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
envType: levelbuilder
namespace: levelbuilder
5 changes: 0 additions & 5 deletions apps/codeai/deployments/levelbuilder/deployment.yaml.disabled

This file was deleted.

2 changes: 2 additions & 0 deletions apps/codeai/deployments/production/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
envType: production
namespace: production
5 changes: 0 additions & 5 deletions apps/codeai/deployments/production/deployment.yaml.disabled

This file was deleted.

2 changes: 1 addition & 1 deletion apps/codeai/deployments/production/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: ghcr.io/code-dot-org/code-dot-org:production
image: ghcr.io/code-dot-org/code-dot-org:replace-me
autoscaling:
minReplicas: 1
maxReplicas: 1
Expand Down
1 change: 0 additions & 1 deletion apps/codeai/deployments/staging/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
envType: staging
namespace: staging
branch: staging
1 change: 0 additions & 1 deletion apps/codeai/deployments/staging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ autoscaling:
maxReplicas: 1
locals.yml:
stack_name: staging
# argocd-detect-probe: k8s-gitops run 10 at 2026-03-22T10:10:09Z
3 changes: 0 additions & 3 deletions apps/codeai/deployments/test/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
envType: test
namespace: test
# FIXME: for quicker testing, avoid waiting on DTTs and DTPs, let alone DTLs.
# branch: test
branch: staging
2 changes: 1 addition & 1 deletion apps/codeai/deployments/test/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: ghcr.io/code-dot-org/code-dot-org:test # updated by k8s-commit-image-ref-to-argocd.yml
image: ghcr.io/code-dot-org/code-dot-org:replace-me
autoscaling:
maxReplicas: 1
locals.yml:
Expand Down
6 changes: 4 additions & 2 deletions apps/kargo-project-codeai/project-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ spec:
autoPromotionEnabled: true
- stage: test
autoPromotionEnabled: false
- stage: production
autoPromotionEnabled: false
- stage: levelbuilder
autoPromotionEnabled: false
- stage: review-infra-changes
autoPromotionEnabled: false
- stage: production
autoPromotionEnabled: false
79 changes: 73 additions & 6 deletions apps/kargo-project-codeai/stages/levelbuilder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,91 @@ spec:
vars:
- name: gitopsRepo
value: https://github.com/code-dot-org/k8s-gitops.git
- name: sourceRepo
value: https://github.com/code-dot-org/code-dot-org.git
- name: imageRepo
value: ghcr.io/code-dot-org/code-dot-org
- name: legacyEnv
value: levelbuilder
- name: deployment
value: levelbuilder
- name: envType
value: levelbuilder
- name: namespace
value: levelbuilder
- name: releaseName
value: levelbuilder
- name: targetBranch
value: stage/levelbuilder
- name: renderPath
value: ./out/apps/codeai/deployments/levelbuilder/deploy/manifests.yaml
steps:
- uses: git-clone
config:
repoURL: ${{ vars.gitopsRepo }}
checkout:
- branch: main
path: ./gitops
path: ./meta
sparse:
- apps/codeai
- branch: main
path: ./gate
sparse:
- warehouses/codeai/legacy-gitflow/levelbuilder/merged
- branch: ${{ vars.targetBranch }}
create: true
path: ./out
- uses: yaml-parse
as: legacy-gate
config:
path: ./gate/warehouses/codeai/legacy-gitflow/${{ vars.legacyEnv }}/merged/${{ imageFrom(vars.imageRepo).Tag }}.yaml
outputs:
- name: revision
fromExpression: revision
- name: tag
fromExpression: tag
- name: mergedAt
fromExpression: mergedAt
- uses: git-clone
config:
repoURL: ${{ vars.sourceRepo }}
checkout:
- commit: ${{ commitFrom(vars.sourceRepo).ID }}
path: ./src
sparse:
- k8s/helm
- uses: git-clear
config:
path: ./out
- uses: yaml-update
config:
path: ./gitops/apps/codeai/deployments/levelbuilder/values.yaml
path: ./meta/apps/codeai/deployments/${{ vars.deployment }}/values.yaml
updates:
- key: image
value: ghcr.io/code-dot-org/code-dot-org:${{ imageFrom("ghcr.io/code-dot-org/code-dot-org").Tag }}
value: ${{ imageFrom(vars.imageRepo).RepoURL }}:${{ imageFrom(vars.imageRepo).Tag }}
- uses: helm-template
config:
path: ./src/k8s/helm
releaseName: ${{ vars.releaseName }}
namespace: ${{ vars.namespace }}
valuesFiles:
- ./meta/apps/codeai/envTypes/${{ vars.envType }}.values.yaml
- ./meta/apps/codeai/deployments/${{ vars.deployment }}/values.yaml
outPath: ${{ vars.renderPath }}
- uses: git-commit
as: commit
config:
path: ./gitops
path: ./out
message: |
Promote levelbuilder to ${{ imageFrom("ghcr.io/code-dot-org/code-dot-org").Tag }} [skip ci]
Render levelbuilder for ${{ commitFrom(vars.sourceRepo).ID }} with ${{ imageFrom(vars.imageRepo).Tag }}
- uses: git-push
config:
path: ./gitops
path: ./out
targetBranch: ${{ vars.targetBranch }}
- uses: argocd-update
config:
apps:
- name: codeai-levelbuilder
sources:
- repoURL: ${{ vars.gitopsRepo }}
desiredRevision: ${{ outputs.commit.commit }}
31 changes: 15 additions & 16 deletions apps/kargo-project-codeai/stages/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@ spec:
name: kargo-project-codeai
sources:
stages:
- test
- review-infra-changes
promotionTemplate:
spec:
vars:
- name: gitopsRepo
value: https://github.com/code-dot-org/k8s-gitops.git
- name: targetBranch
value: stage/production
steps:
- uses: git-clone
as: gitops
config:
repoURL: ${{ vars.gitopsRepo }}
checkout:
- branch: main
path: ./gitops
- uses: yaml-update
- as: production
branch: ${{ vars.targetBranch }}
path: ./out
sparse:
- apps/codeai/deployments/production/deploy
- uses: argocd-update
config:
path: ./gitops/apps/codeai/deployments/production/values.yaml
updates:
- key: image
value: ghcr.io/code-dot-org/code-dot-org:${{ imageFrom("ghcr.io/code-dot-org/code-dot-org").Tag }}
- uses: git-commit
config:
path: ./gitops
message: |
Promote production to ${{ imageFrom("ghcr.io/code-dot-org/code-dot-org").Tag }} [skip ci]
- uses: git-push
config:
path: ./gitops
apps:
- name: codeai-production
sources:
- repoURL: ${{ vars.gitopsRepo }}
desiredRevision: ${{ outputs.gitops.commits.production }}
Loading