Skip to content

Commit 22fc29f

Browse files
rtrompiernsarrazin
andauthored
Kubernetes infra (#1088)
* feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): create kube infra * feat(chart): add hpa * feat(chart): add service monitor * feat(chart): test * feat(chart): fix lint * feat(chart): remove pm2 * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * feat(chart): fix * update replicas count * json logs * use internal image for prod env * Add LOG_LEVEL in prod yaml * Get rid of unused staging env * add an image build for internal registry --------- Co-authored-by: Nathan Sarrazin <[email protected]>
1 parent 98b1c51 commit 22fc29f

15 files changed

+672
-25
lines changed

.github/workflows/deploy-prod.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy to k8s
2+
on:
3+
# run this workflow manually from the Actions tab
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-publish-huggingchat-image:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Tailscale
14+
uses: huggingface/tailscale-action@main
15+
with:
16+
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
17+
18+
- name: Extract package version
19+
id: package-version
20+
run: |
21+
VERSION=$(jq -r .version package.json)
22+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
23+
MAJOR=$(echo $VERSION | cut -d '.' -f1)
24+
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
25+
MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
26+
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
27+
28+
- name: Docker metadata
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: |
33+
ghcr.io/huggingface/chat-ui
34+
tags: |
35+
type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
36+
type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
37+
type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
38+
type=raw,value=latest,enable={{is_default_branch}}
39+
type=sha,enable={{is_default_branch}}
40+
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v3
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
- name: Login to Registry
48+
uses: docker/login-action@v2
49+
with:
50+
registry: registry.internal.huggingface.tech
51+
username: ${{ secrets.DOCKER_INTERNAL_USERNAME }}
52+
password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }}
53+
54+
- name: Build and Publish Docker Image without DB
55+
uses: docker/build-push-action@v5
56+
with:
57+
context: .
58+
file: Dockerfile
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}
62+
platforms: linux/amd64
63+
cache-to: type=gha,mode=max,scope=amd64
64+
cache-from: type=gha,scope=amd64
65+
provenance: false
66+
build-args: |
67+
INCLUDE_DB=false
68+
APP_BASE=/chat
69+
PUBLIC_APP_COLOR=yellow

.github/workflows/deploy-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to production
1+
name: Deploy to production spaces
22
on:
33
# run this workflow manually from the Actions tab
44
workflow_dispatch:

.github/workflows/deploy-staging.yml

-24
This file was deleted.

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
/build
44
/.svelte-kit
55
/package
6+
/chart
67
.env
78
.env.*
89
!.env.example

chart/Chart.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: chat-ui
3+
version: 0.0.0-latest
4+
type: application
5+
icon: https://huggingface.co/front/assets/huggingface_logo-noborder.svg

0 commit comments

Comments
 (0)