32
32
YQ_VERSION : v4.25.1
33
33
E2E_CI : true
34
34
REPO : rancher
35
- TAG : dev
36
35
APISERVER_PORT : 8001
37
36
DEFAULT_SLEEP_TIMEOUT_SECONDS : 10
38
37
KUBECTL_WAIT_TIMEOUT : 300s
39
38
DEBUG : ${{ github.event.inputs.debug || false }}
39
+ CLUSTER_NAME : ' e2e-ci-prometheus-federator'
40
40
41
41
permissions :
42
42
contents : write
43
43
44
44
jobs :
45
+ prebuild-env :
46
+ name : Prebuild needed Env vars
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - name : Check out the repository to the runner
50
+ uses : actions/checkout@v4
51
+ - name : Set Branch Tag and Other Variables
52
+ id : set-vars
53
+ run : bash ./.github/scripts/branch-tags.sh >> $GITHUB_OUTPUT
54
+ outputs :
55
+ branch_tag : ${{ steps.set-vars.outputs.branch_tag }}
56
+ branch_static_tag : ${{ steps.set-vars.outputs.branch_static_tag }}
57
+ prev_tag : ${{ steps.set-vars.outputs.prev_tag }}
45
58
e2e-prometheus-federator :
59
+ needs : [
60
+ prebuild-env,
61
+ ]
46
62
runs-on : ubuntu-latest
63
+ env :
64
+ TAG : ${{ needs.prebuild-env.outputs.branch_static_tag }}
47
65
strategy :
48
66
matrix :
49
67
k3s_version :
50
68
# k3d version list k3s | sed 's/+/-/' | sort -h
51
- - ${{ github.event.inputs.k3s_version || 'v1.28.4-k3s2 ' }}
69
+ - ${{ github.event.inputs.k3s_version || 'v1.28.14-k3s1 ' }}
52
70
steps :
53
71
-
54
72
uses : actions/checkout@v3
@@ -66,28 +84,24 @@ jobs:
66
84
run : |
67
85
sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq;
68
86
-
69
- name : Perform CI
87
+ name : Perform pre-e2e image build
70
88
run : |
71
- REPO=${REPO} TAG=${TAG} ./scripts/ build;
72
- REPO=${REPO} TAG=${TAG} ./scripts/ package;
89
+ EMBEDED_CHART_VERSION=0.3.4 REPO=${REPO} TAG=${TAG} make build;
90
+ REPO=${REPO} TAG=${TAG} make package;
73
91
-
74
- name : Provision k3d Cluster
75
- uses : AbsaOSS/k3d-action@v2
76
- # k3d will automatically create a network named k3d-test-cluster-1 with the range 172.18.0.0/16
77
- with :
78
- cluster-name : " e2e-ci-prometheus-federator"
79
- args : >-
80
- --agents 1
81
- --network "nw01"
82
- --image docker.io/rancher/k3s:${{matrix.k3s_version}}
92
+ name : Install k3d
93
+ run : ./.github/workflows/e2e/scripts/install-k3d.sh
94
+ -
95
+ name : Setup k3d cluster
96
+ run : K3S_VERSION=${{ matrix.k3s_version }} ./.github/workflows/e2e/scripts/setup-cluster.sh
83
97
-
84
98
name : Import Images Into k3d
85
99
run : |
86
- k3d image import ${REPO}/prometheus-federator:${TAG} -c e2e-ci-prometheus-federator ;
100
+ k3d image import ${REPO}/prometheus-federator:${TAG} -c $CLUSTER_NAME ;
87
101
-
88
102
name : Setup kubectl context
89
103
run : |
90
- kubectl config use-context k3d-e2e-ci-prometheus-federator ;
104
+ kubectl config use-context " k3d-$CLUSTER_NAME" ;
91
105
-
92
106
name : Set Up Tmate Debug Session
93
107
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
@@ -110,39 +124,39 @@ jobs:
110
124
-
111
125
name : Check if Project Registration Namespace is auto-created on namespace detection
112
126
run : ./.github/workflows/e2e/scripts/create-project-namespace.sh;
113
-
114
- # Commenting out for failure in CI but not locally
115
- # -
116
- # name: Create Project Monitoring Stack via ProjectHelmChart CR
117
- # run: ./.github/workflows/e2e/scripts/create-projecthelmchart.sh;
118
- # -
119
- # name: Check if the Project Prometheus Stack is up
120
- # run: ./.github/workflows/e2e/scripts/validate-project-monitoring.sh;
121
- # -
122
- # name: Wait for 8 minutes for enough scraping to be done to continue
123
- # run: |
124
- # for i in {1..48}; do sleep 10; echo "Waited $((i*10)) seconds for metrics to be populated"...; done;
125
- # -
126
- # name: Validate Project Prometheus Targets
127
- # run: ./.github/workflows/e2e/scripts/validate-project-prometheus-targets.sh;
128
- # -
129
- # name: Validate Project Grafana Datasources
130
- # run: ./.github/workflows/e2e/scripts/validate-project-grafana-datasource.sh;
131
- # -
132
- # name: Validate Project Grafana Dashboards
133
- # run: ./. github/workflows/e2e/scripts/validate-project-grafana-dashboards.sh;
134
- # # -
135
- # # name: Validate Project Grafana Dashboard Data
136
- # # run: ./.github/workflows/e2e/scripts/validate-project-grafana-dashboard-data.sh;
137
- # -
138
- # name: Validate Project Prometheus Alerts
139
- # run: ./.github/workflows/e2e/scripts/validate-project-prometheus-alerts.sh;
140
- # -
141
- # name: Validate Project Alertmanager
142
- # run: ./.github/workflows/e2e/scripts/validate-project-alertmanager.sh;
143
- # -
144
- # name: Delete Project Prometheus Stack
145
- # run: ./.github/workflows/e2e/scripts/delete-projecthelmchart.sh;
127
+ -
128
+ name : Create Project Monitoring Stack via ProjectHelmChart CR
129
+ run : DEFAULT_SLEEP_TIMEOUT_SECONDS=20 ./.github/workflows/e2e/scripts/create-projecthelmchart.sh;
130
+ -
131
+ name : Check if the Project Prometheus Stack is up
132
+ run : ./.github/workflows/e2e/scripts/validate-project-monitoring.sh;
133
+ -
134
+ name : Wait for 8 minutes for enough scraping to be done to continue
135
+ run : |
136
+ for i in {1..48}; do sleep 10; echo "Waited $((i*10)) seconds for metrics to be populated"...; done;
137
+ -
138
+ name : Validate Project Prometheus Targets
139
+ run : ./.github/workflows/e2e/scripts/validate-project-prometheus-targets.sh;
140
+ -
141
+ name : Validate Project Grafana Datasources
142
+ run : ./.github/workflows/e2e/scripts/validate-project-grafana-datasource.sh;
143
+ -
144
+ name : Validate Project Grafana Dashboards
145
+ run : ./.github/workflows/e2e/scripts/validate-project-grafana-dashboards.sh;
146
+ # Re-disable this as it's been broken since Jun 28, 2023
147
+ # More context: https:// github.com/rancher/prometheus-federator/pull/73
148
+ # -
149
+ # name: Validate Project Grafana Dashboard Data
150
+ # run: ./.github/workflows/e2e/scripts/validate-project-grafana-dashboard-data.sh;
151
+ -
152
+ name : Validate Project Prometheus Alerts
153
+ run : ./.github/workflows/e2e/scripts/validate-project-prometheus-alerts.sh;
154
+ -
155
+ name : Validate Project Alertmanager
156
+ run : ./.github/workflows/e2e/scripts/validate-project-alertmanager.sh;
157
+ -
158
+ name : Delete Project Prometheus Stack
159
+ run : ./.github/workflows/e2e/scripts/delete-projecthelmchart.sh;
146
160
-
147
161
name : Uninstall Prometheus Federator
148
162
run : ./.github/workflows/e2e/scripts/uninstall-federator.sh;
0 commit comments