-
Notifications
You must be signed in to change notification settings - Fork 14
186 lines (159 loc) · 6.71 KB
/
charts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: charts
on:
release:
types: [created]
pull_request:
branches:
- main
paths:
- charts/**
- .github/workflows/charts.yml
- "**.go"
permissions: read-all
jobs:
# SKIP: Need more refactoring for this workflow, it needs images to be pushed to registry first
# lint-helm-chart-test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
# with:
# fetch-depth: 0
# - name: Set up Helm
# uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
# 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 }}
# - 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 }}
charts-test:
runs-on: ubuntu-latest
# needs: lint-helm-chart-test
env:
GOPATH: ${{ github.workspace }}/../go
HOME: ${{ github.workspace }}/..
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
with:
submodules: "recursive"
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #4.1.0
with:
go-version: "1.21"
cache: false
- name: Install helm
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5
- name: Kind Cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 #v1.8.0
with:
config: "dev/cluster-config.yaml"
cluster_name: tarian-helm-chart-testing
- name: Testing Kind cluster setup
run: |
set -x
# Verify Kind cluster setup
kubectl cluster-info
kubectl get pods -n kube-system
echo "kubectl config current-context:" $(kubectl config current-context)
echo "KUBECONFIG env var:" ${KUBECONFIG}
- name: Create Kind registry
run: |
set -x
# Create a Kind registry
./dev/run-kind-registry.sh
- name: Build Tarian
run: |
set -x
sudo apt update && sudo apt install -y jq pkg-config libelf-dev clang
go install google.golang.org/protobuf/cmd/protoc-gen-go@32051b4f86e54c2142c7c05362c6e96ae3454a1c # @v1.28.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@938f6e2f7550e542bd78f3b9e8812665db109e02 # @v1.1.0
make bin/protoc bin/goreleaser
bash ./dev/run-kind-registry.sh
make generate
./bin/goreleaser release --snapshot --rm-dist
make push-local-images
cp dist/tarianctl_linux_amd64/tarianctl ./bin/
- name: Install Tarian
run: |
set -x
./bin/tarianctl install --charts ./charts -l debug --agents-values ./dev/values/agents.yaml --server-values ./dev/values/server.yaml
continue-on-error: true
- name: Wait for pods to be ready
id: wait-until-tarian-is-ready
run: |
set -x
# Wait for all pods in the tarian-system namespace to be in the "Ready" state
kubectl wait --for=condition=ready pod --all -n tarian-system --timeout=300s
continue-on-error: true
- name: Run tests
id: run-tests
if: steps.wait-until-tarian-is-ready.outcome == 'success'
run: make k8s-test
continue-on-error: true
- name: Collect deployment information in case of failure
if: steps.wait-until-tarian-is-ready.outcome != 'success' || steps.run-tests.outcome != 'success'
run: |
set -x
# Collect logs and information for debugging in case of failure
kubectl get pods -n tarian-system
echo "======================================================================================================================"
kubectl describe pods -n tarian-system
echo "======================================================================================================================"
kubectl logs -n tarian-system deploy/tarian-server
echo "======================================================================================================================"
kubectl logs -n tarian-system deploy/tarian-cluster-agent
echo "======================================================================================================================"
kubectl logs -n tarian-system deploy/tarian-controller-manager
echo "======================================================================================================================"
kubectl logs -n tarian-system daemonsets/tarian-node-agent
echo "======================================================================================================================"
exit 1
# SKIP: Add this part into release workflow
# release:
# if: startsWith(github.ref, 'refs/heads/main')
# needs: charts-test
# runs-on: ubuntu-latest
# permissions:
# contents: write
# env:
# GOPATH: ${{ github.workspace }}/../go
# HOME: ${{ github.workspace }}/..
# steps:
# - name: Checkout
# uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @3.1.0
# with:
# fetch-depth: 0
# - name: Configure Git
# run: |
# git config user.name "$GITHUB_ACTOR"
# git config user.email "[email protected]"
# - name: Install Helm
# uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5 # @v3.5
# with:
# version: '3.11.0'
# - name: Run chart-releaser
# uses: helm/chart-releaser-action@c25b74a986eb925b398320414b576227f375f946 # @v1.2.1
# with:
# config: .cr.yaml
# env:
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"