-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helm chart, add CI for lint/relase helm chart, update README for …
…helm installation (#3) Signed-off-by: Hung-Han (Henry) Chen <[email protected]>
- Loading branch information
1 parent
4c42f9a
commit 0330d65
Showing
8 changed files
with
228 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Lint and Test Charts | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
lint-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.12.1 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
check-latest: true | ||
|
||
- name: Set up chart-testing | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Run chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false | ||
|
||
- name: Create kind cluster | ||
if: steps.list-changed.outputs.changed == 'true' | ||
uses: helm/[email protected] | ||
|
||
- name: Run chart-testing (install) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: ct install --target-branch ${{ github.event.repository.default_branch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Release Charts | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'charts/text-inference-batcher-nodejs/**' | ||
- '.github/workflows/helm-chart-release.yaml' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: charts | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
appVersion: 0.0.1 | ||
description: A Helm chart for text-inference-batcher with node.js runtime | ||
name: text-inference-batcher-nodejs | ||
type: application | ||
version: 0.0.1 |
43 changes: 43 additions & 0 deletions
43
charts/text-inference-batcher-nodejs/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Release.Name }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app.kubernetes.io/instance: {{ .Chart.Name }} | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: {{ .Chart.Name }} | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
replicas: {{ .Values.replicas }} | ||
template: | ||
metadata: | ||
name: {{ .Release.Name }} | ||
labels: | ||
app.kubernetes.io/instance: {{ .Chart.Name }} | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
spec: | ||
containers: | ||
- name: {{ .Release.Name }} | ||
image: {{ .Values.deployment.image }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
env: | ||
- name: UPSTREAMS | ||
value: {{ (.Values.deployment.env).UPSTREAMS | quote }} | ||
- name: MAX_CONNECT_PER_UPSTREAM | ||
value: {{ (.Values.deployment.env).MAX_CONNECT_PER_UPSTREAM | quote }} | ||
tolerations: | ||
{{- if .Values.tolerations }} | ||
{{ toYaml .Values.tolerations | indent 8 }} | ||
{{- end }} | ||
nodeSelector: | ||
{{- if .Values.nodeSelector }} | ||
{{ toYaml .Values.nodeSelector | indent 8 }} | ||
{{- end }} | ||
affinity: | ||
{{- if .Values.affinity }} | ||
{{ toYaml .Values.affinity | indent 8 }} | ||
{{- end }} |
15 changes: 15 additions & 0 deletions
15
charts/text-inference-batcher-nodejs/templates/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Release.Name }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
spec: | ||
selector: | ||
app.kubernetes.io/instance: {{ .Chart.Name }} | ||
app.kubernetes.io/name: {{ .Release.Name }} | ||
type: "{{ .Values.service.type }}" | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.service.port }} | ||
targetPort: 8000 | ||
name: http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
replicas: 1 | ||
|
||
deployment: | ||
image: ghcr.io/chenhunghan/text-inference-batcher-nodejs:latest | ||
env: | ||
# upstream url separated by comman. e.g. "http://llama-2-7b-0:8000,http://llama-2-7b-1:8000,http://llama-2-13b-0:8000" | ||
UPSTREAMS: "" | ||
MAX_CONNECT_PER_UPSTREAM: 1 | ||
resources: | ||
{} | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
service: | ||
type: ClusterIP | ||
port: 8000 | ||
annotations: {} | ||
# If using an AWS load balancer, you'll need to override the default 60s load balancer idle timeout | ||
# service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "1200" | ||
nodeSelector: {} | ||
tolerations: [] | ||
# e.g. | ||
# - key: "computing" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
affinity: {} | ||
# e.g. | ||
# nodeAffinity: | ||
# requiredDuringSchedulingIgnoredDuringExecution: | ||
# nodeSelectorTerms: | ||
# - matchExpressions: | ||
# - key: computing-lb | ||
# operator: In | ||
# values: | ||
# - "true" |