kubernetes - test workflow #12
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
# Kubernetes helm chart test | |
name: Kubernetes | |
on: | |
workflow_dispatch: # allows manual triggering | |
push: | |
branches: | |
- master | |
- example/kubernetes # FIXME remove | |
jobs: | |
kubernetes: | |
runs-on: ubuntu-latest | |
env: | |
COMMIT_SHA: ${{ github.sha }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Create k8s Kind Cluster | |
id: create_kind_cluster | |
uses: container-tools/kind-action@v1 | |
# | |
# - name: Build and push Docker image | |
# id: docker_build | |
# uses: docker/build-push-action@v4 | |
# with: | |
# driver-opts: network=host | |
# context: . | |
# push: true | |
# platforms: ${{ matrix.config.platforms }} | |
# tags: 127.0.0.1:5000/server-distroless-llama.cpp:${{ env.COMMIT_SHA }} | |
# file: .devops/server.distroless.Dockerfile | |
- name: Docker build | |
id: docker_build | |
run: | | |
kubectl cluster-info | |
kubectl get storageclass standard | |
# Checking env variable | |
if [[ "$KIND_REGISTRY" != "kind-registry:5000" ]]; then | |
echo "Wrong KIND_REGISTRY env variable: $KIND_REGISTRY" | |
exit 1 | |
fi | |
docker build . -f .devops/server.distroless.Dockerfile -t $KIND_REGISTRY/server-distroless-llama.cpp:${{ env.COMMIT_SHA }} | |
docker push $KIND_REGISTRY/server-distroless-llama.cpp:${{ env.COMMIT_SHA }} | |
- name: Deploy prometheus | |
id: deploy_prometheus | |
run: | | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack | |
- name: Deploy llama.cpp server | |
id: deploy_llama_cpp | |
run: | | |
helm install llama-cpp-stack ./examples/kubernetes/helm-charts |