Skip to content
Draft
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ coverage/
.nyc_output/

release/

# Builds

build/charts/codepair/charts/
23 changes: 23 additions & 0 deletions build/charts/codepair/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions build/charts/codepair/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: yorkie-mongodb
repository: https://yorkie-team.github.io/yorkie/helm-charts
version: 0.4.13
digest: sha256:cc8f0136f05468ef7ad3b79470f59c47b0a2b82ee7826881c5b688f072b1033d
generated: "2025-05-05T15:58:01.457671+09:00"
24 changes: 24 additions & 0 deletions build/charts/codepair/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: codepair
description: A Helm chart for CodePair, a collaborative coding platform built with Yorkie
type: application
icon: https://raw.githubusercontent.com/yorkie-team/yorkie-team.github.io/main/public/favicon-512x512.png
maintainers:
- name: krapie
email: [email protected]

version: 0.1.0
appVersion: "0.1.32"
kubeVersion: ">=1.23.0-0"

dependencies:
- name: yorkie-mongodb
version: 0.4.13
repository: https://yorkie-team.github.io/yorkie/helm-charts
condition: yorkie-mongodb.enabled

keywords:
- codepair
- yorkie
- collaboration
- kubernetes
85 changes: 85 additions & 0 deletions build/charts/codepair/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# CodePair Helm Chart

Installs the CodePair application, a collaborative coding platform powered by Yorkie.

## Prerequisites

- Kubernetes 1.23+
- Helm 3+

## Get Helm Repository Info

```bash
# TODO(krapie): need to centralize the helm repo
helm repo add yorkie-team https://yorkie-team.github.io/yorkie/helm-charts
helm repo update
```

_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Helm Chart

```bash
# Create mongodb namespace if not already created
kubectl create namespace mongodb

# Install codepair helm chart with default values
helm install codepair yorkie-team/codepair -n codepair --create-namespace
```

_See [configuration](#configuration) below for custom installation_

_See [`helm install`](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Dependencies

By default, this chart installs the following dependency:

- [yorkie-mongodb](https://github.com/yorkie-team/yorkie/tree/main/charts/yorkie-mongodb)

## Uninstall Helm Chart

```bash
helm uninstall codepair
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [`helm uninstall`](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```bash
helm upgrade codepair yorkie-team/codepair
```

_See [`helm upgrade`](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

## Configuration

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments:

```console
helm show values yorkie-team/codepair
```

### Key Parameters

The following table lists the configurable parameters of the CodePair chart and their default values:

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `codepair.image.repository` | CodePair image repository | `yorkieteam/codepair` |
| `codepair.image.tag` | CodePair image tag | `0.1.32` |
| `codepair.autoscaling.replicaCount` | Number of CodePair replicas | `1` |
| `codepair.env.databaseUrl` | MongoDB connection URI | `mongodb://mongodb.mongodb.svc.cluster.local:27017/codepair` |
| `codepair.env.githubClientId` | GitHub OAuth Client ID | `""` |
| `codepair.env.githubClientSecret` | GitHub OAuth Client Secret | `""` |
| `codepair.env.frontendBaseUrl` | Frontend application URL | `""` |
| `codepair.env.yorkieApiAddr` | Yorkie API address | `""` |
| `ingress.enabled` | Enable ingress | `true` |
| `ingress.className` | Ingress class name | `alb` |
| `ingress.hosts.apiHost` | Host name for API | `codepair-api.yorkie.dev` |
| `yorkie-mongodb.enabled` | Enable MongoDB dependency | `true` |

You may also configure the MongoDB dependency. See the [yorkie-mongodb chart](https://github.com/yorkie-team/yorkie/tree/main/charts/yorkie-mongodb) for additional options.
18 changes: 18 additions & 0 deletions build/charts/codepair/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- Install Complete ---
{{ .Release.Name }} successfully installed!

CodePair application has been deployed to the {{ .Values.codepair.namespace }} namespace.

{{- if .Values.ingress.hosts.enabled }}
Your application is available at: https://{{ .Values.ingress.hosts.apiHost }}
{{- else }}
To expose your service, you need to set up an Ingress or use port-forwarding:

kubectl port-forward service/{{ .Values.codepair.name }} -n {{ .Values.codepair.namespace }} {{ .Values.codepair.ports.serverPort }}:{{ .Values.codepair.ports.serverPort }}

Then access the application at: http://localhost:{{ .Values.codepair.ports.serverPort }}
{{- end }}

To learn more about the release, try:
$ helm status {{ .Release.Name }}
$ helm get all {{ .Release.Name }}
45 changes: 45 additions & 0 deletions build/charts/codepair/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "codepair.name" -}}
{{- default .Chart.Name .Values.codepair.name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "codepair.fullname" -}}
{{- if .Values.codepair.name }}
{{- .Values.codepair.name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "codepair.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "codepair.labels" -}}
helm.sh/chart: {{ include "codepair.chart" . }}
{{ include "codepair.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "codepair.selectorLabels" -}}
app.kubernetes.io/name: {{ include "codepair.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
89 changes: 89 additions & 0 deletions build/charts/codepair/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.codepair.name }}
namespace: {{ .Values.codepair.namespace }}
labels:
app: {{ .Values.codepair.name }}
app.kubernetes.io/name: {{ .Values.codepair.name }}
app.kubernetes.io/instance: {{ .Values.codepair.name }}
app.kubernetes.io/version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
app.kubernetes.io/component: server
app.kubernetes.io/part-of: {{ .Values.codepair.name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
spec:
{{ if not .Values.codepair.autoscaling.enabled }}
replicas: {{ .Values.codepair.autoscaling.replicaCount }}
{{ end }}
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Values.codepair.name }}
template:
metadata:
labels:
app: {{ .Values.codepair.name }}
app.kubernetes.io/instance: {{ .Values.codepair.name }}
app.kubernetes.io/version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
version: {{ .Values.codepair.image.tag | default .Chart.AppVersion }}
spec:
containers:
- name: {{ .Values.codepair.name }}
image: "{{ .Values.codepair.image.repository }}:{{ .Values.codepair.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.codepair.image.pullPolicy }}
env:
- name: DATABASE_URL
value: "{{ .Values.codepair.env.databaseUrl }}"
- name: GITHUB_CLIENT_ID
value: "{{ .Values.codepair.env.githubClientId }}"
- name: GITHUB_CLIENT_SECRET
value: "{{ .Values.codepair.env.githubClientSecret }}"
- name: GITHUB_CALLBACK_URL
value: "{{ .Values.codepair.env.githubCallbackUrl }}"
- name: GITHUB_AUTHORIZATION_URL
value: "{{ .Values.codepair.env.githubAuthorizationUrl }}"
- name: GITHUB_TOKEN_URL
value: "{{ .Values.codepair.env.githubTokenUrl }}"
- name: GITHUB_USER_PROFILE_URL
value: "{{ .Values.codepair.env.githubUserProfileUrl }}"
- name: JWT_ACCESS_TOKEN_SECRET
value: "{{ .Values.codepair.env.jwtAccessTokenSecret }}"
- name: JWT_ACCESS_TOKEN_EXPIRATION_TIME
value: "{{ .Values.codepair.env.jwtAccessTokenExpirationTime }}"
- name: JWT_REFRESH_TOKEN_SECRET
value: "{{ .Values.codepair.env.jwtRefreshTokenSecret }}"
- name: JWT_REFRESH_TOKEN_EXPIRATION_TIME
value: "{{ .Values.codepair.env.jwtRefreshTokenExpirationTime }}"
- name: FRONTEND_BASE_URL
value: "{{ .Values.codepair.env.frontendBaseUrl }}"
- name: YORKIE_API_ADDR
value: "{{ .Values.codepair.env.yorkieApiAddr }}"
- name: YORKIE_PROJECT_NAME
value: "{{ .Values.codepair.env.yorkieProjectName }}"
- name: YORKIE_PROJECT_SECRET_KEY
value: "{{ .Values.codepair.env.yorkieProjectSecretKey }}"
- name: YORKIE_INTELLIGENCE
value: "{{ .Values.codepair.env.yorkieIntelligence }}"
- name: OPENAI_API_KEY
value: "{{ .Values.codepair.env.openaiApiKey }}"
- name: LANGCHAIN_TRACING_V2
value: "{{ .Values.codepair.env.langchainTracingV2 }}"
- name: LANGCHAIN_API_KEY
value: "{{ .Values.codepair.env.langchainApiKey }}"
- name: LANGCHAIN_PROJECT
value: "{{ .Values.codepair.env.langchainProject }}"
- name: FILE_UPLOAD
value: "{{ .Values.codepair.env.fileUpload }}"
- name: AWS_ACCESS_KEY_ID
value: "{{ .Values.codepair.env.awsAccessKeyId }}"
- name: AWS_SECRET_ACCESS_KEY
value: "{{ .Values.codepair.env.awsSecretAccessKey }}"
- name: AWS_REGION
value: "{{ .Values.codepair.env.awsRegion }}"
- name: BUCKET_NAME
value: "{{ .Values.codepair.env.bucketName }}"
ports:
- containerPort: {{ .Values.codepair.ports.serverPort }}
resources:
{{ toYaml .Values.codepair.resources | nindent 12 }}
51 changes: 51 additions & 0 deletions build/charts/codepair/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{ if .Values.ingress.nginx.enabled }}
name: ingress-nginx
{{ else }}
name: {{ .Values.codepair.name }}
{{ end }}
namespace: {{ .Values.codepair.namespace }}
annotations:
{{ if .Values.ingress.awsAlb.enabled }}
alb.ingress.kubernetes.io/scheme: {{ .Values.ingress.awsAlb.scheme }}
# Set alb.ingress.kubernetes.io/certificate-arn annotation to TLS certificate's ARN issued by AWS ACM
alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.awsAlb.certArn }}
alb.ingress.kubernetes.io/listen-ports: {{ .Values.ingress.awsAlb.listenPorts }}
alb.ingress.kubernetes.io/backend-protocol: {{ .Values.ingress.awsAlb.backendProtocol }}
alb.ingress.kubernetes.io/backend-protocol-version: {{ .Values.ingress.awsAlb.backendProtocolVersion }}
alb.ingress.kubernetes.io/group.name: {{ .Values.ingress.awsAlb.groupName }}
alb.ingress.kubernetes.io/group.order: {{ .Values.ingress.awsAlb.groupOrder | quote }}
{{ end }}
{{ if .Values.ingress.ncpAlb.enabled }}
# Set alb.ingress.kubernetes.io/ssl-certificate-no annotation to TLS certificate's number issued by NCP
alb.ingress.kubernetes.io/ssl-certificate-no: "{{ .Values.ingress.ncpAlb.certNo }}"
alb.ingress.kubernetes.io/listen-ports: {{ .Values.ingress.ncpAlb.listenPorts }}
alb.ingress.kubernetes.io/ssl-redirect: {{ .Values.ingress.ncpAlb.sslRedirect }}
alb.ingress.kubernetes.io/backend-protocol: {{ .Values.ingress.ncpAlb.backendProtocol }}
alb.ingress.kubernetes.io/enable-http2: {{ .Values.ingress.ncpAlb.enableHttp2 }}
# Set alb.ingress.kubernetes.io/healthcheck-path annotation to health check path
alb.ingress.kubernetes.io/healthcheck-path: {{ .Values.ingress.ncpAlb.healthcheckPath }}
{{ end }}
{{ if .Values.ingress.nginx.enabled }}
nginx.ingress.kubernetes.io/rewrite-target: {{ .Values.ingress.nginx.rewriteTarget }}
kubernetes.io/ingress.class: "nginx"
{{ end }}
spec:
ingressClassName: {{ .Values.ingress.ingressClassName }}
rules:
{{ if .Values.ingress.hosts.enabled }}
- host: {{ .Values.ingress.hosts.apiHost }}
http:
{{ else }}
- http:
{{ end }}
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.codepair.name }}
port:
number: {{ .Values.codepair.ports.serverPort }}
20 changes: 20 additions & 0 deletions build/charts/codepair/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.codepair.name }}
namespace: {{ .Values.codepair.namespace }}
labels:
app.kubernetes.io/name: {{ .Values.codepair.name }}
app.kubernetes.io/instance: {{ .Values.codepair.name }}
app.kubernetes.io/component: server
app.kubernetes.io/part-of: {{ .Values.codepair.name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: NodePort
ports:
- name: {{ .Values.codepair.name }}-server
port: {{ .Values.codepair.ports.serverPort }}
targetPort: {{ .Values.codepair.ports.serverPort }}
appProtocol: http
selector:
app.kubernetes.io/instance: {{ .Values.codepair.name }}
Loading