instana 1.215.1 → 1.217.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +102 -4
- data/.tekton/.currency/docs/report.md +15 -14
- data/.tekton/.currency/resources/requirements.txt +0 -1
- data/.tekton/.currency/resources/table.json +6 -0
- data/.tekton/.currency/scripts/generate_report.py +38 -130
- data/.tekton/README.md +278 -0
- data/.tekton/github-pr-eventlistener.yaml +1 -1
- data/.tekton/pipeline.yaml +154 -6
- data/.tekton/pipelinerun.yaml +2 -2
- data/.tekton/ruby-tracer-prepuller.yaml +4 -0
- data/.tekton/run_unittests.sh +27 -6
- data/.tekton/scheduled-eventlistener.yaml +2 -4
- data/.tekton/task.yaml +156 -0
- data/Rakefile +1 -1
- data/gemfiles/excon_0100.gemfile +14 -0
- data/gemfiles/excon_021.gemfile +1 -1
- data/gemfiles/excon_079.gemfile +1 -1
- data/gemfiles/excon_100.gemfile +2 -2
- data/gemfiles/rails_61.gemfile +1 -0
- data/gemfiles/rails_70.gemfile +1 -0
- data/gemfiles/rails_71.gemfile +2 -1
- data/gemfiles/rails_80.gemfile +17 -0
- data/gemfiles/{excon_02.gemfile → sequel_56.gemfile} +4 -5
- data/gemfiles/sequel_57.gemfile +16 -0
- data/gemfiles/sequel_58.gemfile +16 -0
- data/lib/instana/activators/sequel.rb +20 -0
- data/lib/instana/backend/host_agent.rb +12 -3
- data/lib/instana/config.rb +1 -0
- data/lib/instana/instrumentation/active_record.rb +1 -1
- data/lib/instana/instrumentation/instrumented_request.rb +2 -2
- data/lib/instana/instrumentation/sequel.rb +42 -0
- data/lib/instana/tracing/span.rb +2 -2
- data/lib/instana/version.rb +1 -1
- data/lib/instana.rb +4 -2
- data/test/activator_test.rb +1 -1
- data/test/instrumentation/rails_active_record_test.rb +1 -1
- data/test/instrumentation/sequel_test.rb +105 -0
- metadata +13 -9
- data/.tekton/.currency/currency-pipeline.yaml +0 -36
- data/.tekton/.currency/currency-pipelinerun.yaml +0 -20
- data/.tekton/.currency/currency-rbac.yaml +0 -29
- data/.tekton/.currency/currency-scheduled-eventlistener.yaml +0 -56
- data/.tekton/.currency/currency-tasks.yaml +0 -94
data/.tekton/README.md
ADDED
@@ -0,0 +1,278 @@
|
|
1
|
+
# Tekton CI for Instana Ruby Tracer
|
2
|
+
|
3
|
+
## Basic Tekton setup
|
4
|
+
|
5
|
+
### Get a cluster
|
6
|
+
|
7
|
+
What you will need:
|
8
|
+
* Full administrator access
|
9
|
+
* Enough RAM and CPU on a cluster node to run all the pods of a single Pipelinerun on a single node.
|
10
|
+
Multiple nodes increase the number of parallel `PipelineRun` instances.
|
11
|
+
Currently one `PipelineRun` instance is capable of saturating a 8vCPU - 16GB RAM worker node.
|
12
|
+
|
13
|
+
### Setup Tekton on your cluster
|
14
|
+
|
15
|
+
1. Install latest stable Tekton Pipeline release
|
16
|
+
```bash
|
17
|
+
kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
|
18
|
+
```
|
19
|
+
|
20
|
+
2. Install Tekton Dashboard Full (the normal is read only, and doesn't allow for example to re-run).
|
21
|
+
|
22
|
+
````bash
|
23
|
+
kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/release-full.yaml
|
24
|
+
````
|
25
|
+
|
26
|
+
3. Access the dashboard
|
27
|
+
|
28
|
+
```bash
|
29
|
+
kubectl proxy
|
30
|
+
```
|
31
|
+
|
32
|
+
Once the proxy is active, navigate your browser to the [dashboard url](
|
33
|
+
http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/)
|
34
|
+
|
35
|
+
### Setup the ruby-tracer-ci-pipeline
|
36
|
+
|
37
|
+
````bash
|
38
|
+
kubectl apply --filename task.yaml && kubectl apply --filename pipeline.yaml
|
39
|
+
````
|
40
|
+
|
41
|
+
### Run the pipeline manually
|
42
|
+
|
43
|
+
#### From the Dashboard
|
44
|
+
Navigate your browser to the [pipelineruns section of the dashboard](
|
45
|
+
http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/pipelineruns)
|
46
|
+
|
47
|
+
1. Click `Create`
|
48
|
+
2. Select the `Namespace` (where the `Pipeline` resource is created by default it is `default`)
|
49
|
+
3. Select the `Pipeline` created in the `pipeline.yaml` right now it is `ruby-tracer-ci-pipeline`
|
50
|
+
4. Fill in `Params`. The `revision` should be `master` for the `master` branch
|
51
|
+
4. Select the `ServiceAccount` set to `default`
|
52
|
+
5. Optionally, enter a `PipelineRun name` for example `my-master-test-pipeline`,
|
53
|
+
but if you don't then the Dashboard will generate a unique one for you.
|
54
|
+
6. As long as [the known issue with Tekton Dashboard Workspace binding](
|
55
|
+
https://github.com/tektoncd/dashboard/issues/1283), is not resolved.
|
56
|
+
You have to go to `YAML Mode` and insert the workspace definition at the end of the file,
|
57
|
+
with the exact same indentation:
|
58
|
+
|
59
|
+
````yaml
|
60
|
+
workspaces:
|
61
|
+
- name: ruby-tracer-ci-pipeline-pvc-$(params.revision)
|
62
|
+
volumeClaimTemplate:
|
63
|
+
spec:
|
64
|
+
accessModes:
|
65
|
+
- ReadWriteOnce
|
66
|
+
resources:
|
67
|
+
requests:
|
68
|
+
storage: 200Mi
|
69
|
+
|
70
|
+
````
|
71
|
+
7. Click `Create` at the bottom of the page
|
72
|
+
|
73
|
+
|
74
|
+
#### From kubectl CLI
|
75
|
+
As an alternative to using the Dashboard, you can manually edit `pipelinerun.yaml` and create it with:
|
76
|
+
````bash
|
77
|
+
kubectl apply --filename pipelinerun.yaml
|
78
|
+
````
|
79
|
+
|
80
|
+
### Clanup PipelineRun and associated PV resources
|
81
|
+
|
82
|
+
`PipelineRuns` and workspace `PersistentVolume` resources by default are kept indefinitely,
|
83
|
+
and repeated runs might exhaust the available resources, therefore they need to be cleaned up either
|
84
|
+
automatically or manually.
|
85
|
+
|
86
|
+
#### Manully from the Dashboard
|
87
|
+
|
88
|
+
Navigate to `PipelineRuns` and check the checkbox next to the pipelinerun
|
89
|
+
and then click `Delete` in the upper right corner.
|
90
|
+
|
91
|
+
#### Manually from the CLI
|
92
|
+
|
93
|
+
You can use either `kubectl`
|
94
|
+
````bash
|
95
|
+
kubectl get pipelinerun
|
96
|
+
kubectl delete pipelinerun <selected-pipelinerun-here>
|
97
|
+
````
|
98
|
+
|
99
|
+
or `tkn` cli
|
100
|
+
````bash
|
101
|
+
tkn pipelinerun list
|
102
|
+
tkn pipelinerun delete <selected-pipelinerun-here>
|
103
|
+
````
|
104
|
+
|
105
|
+
#### Automatic cleanup with a cronjob
|
106
|
+
|
107
|
+
Install and configure resources from https://github.com/3scale-ops/tekton-pipelinerun-cleaner
|
108
|
+
|
109
|
+
|
110
|
+
## Integrate with GitHub
|
111
|
+
|
112
|
+
### GitHub PR Trigger & PR Check API integration
|
113
|
+
|
114
|
+
The GitHub integration requires further Tekton Triggers and Interceptors to be installed
|
115
|
+
````bash
|
116
|
+
kubectl apply --filename \
|
117
|
+
https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
|
118
|
+
kubectl apply --filename \
|
119
|
+
https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml
|
120
|
+
````
|
121
|
+
#### Create a ServiceAccount
|
122
|
+
|
123
|
+
Our future GitHub PR Event listener needs a service account,
|
124
|
+
`tekton-triggers-eventlistener-serviceaccount` which authorizes it to
|
125
|
+
perform operations specified in eventlistener `Role` and `ClusteRole`.
|
126
|
+
Create the service account with the needed role bindings:
|
127
|
+
|
128
|
+
````bash
|
129
|
+
kubectl apply --filename tekton-triggers-eventlistener-serviceaccount.yaml
|
130
|
+
````
|
131
|
+
|
132
|
+
#### Create the Secret for the GitHub repository webhook
|
133
|
+
|
134
|
+
In order to authorize the incoming webhooks into our cluster, we need to share
|
135
|
+
a secret between our webhook listener, and the GitHub repo.
|
136
|
+
Generate a long, strong and random generated token, put it into `github-interceptor-secret.yaml`.
|
137
|
+
Create the secret resource:
|
138
|
+
````bash
|
139
|
+
kubectl apply --filename github-interceptor-secret.yaml
|
140
|
+
````
|
141
|
+
|
142
|
+
#### Create the Task and token to report PR Check status to GitHub
|
143
|
+
|
144
|
+
The GitHub PR specific Tekton pipeline will want to send data to report the `PR Check Status`.
|
145
|
+
That [GitHub API](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status
|
146
|
+
) requires authentication, and therefore we need a token.
|
147
|
+
The user which generates the token has to have `Write` access in the target repo,
|
148
|
+
as part of the organisation. Check the repo access for this repo under
|
149
|
+
https://github.com/instana/ruby-sensor/settings/access.
|
150
|
+
|
151
|
+
With the proper user:
|
152
|
+
1. Navigate to https://github.com/settings/tokens
|
153
|
+
2. Click on `Generate new token` dropdown `Generate new token (classic)`.
|
154
|
+
3. Fill in `Note` with for example `Tekton commit status`,
|
155
|
+
4. Make sure if you set an expiration, than you remember to renew the token after expiry.
|
156
|
+
5. Under `Select scopes` find `repo` and below that only select the checkbox next to `repo:status` - `Access commit status`.
|
157
|
+
click `Generate token`
|
158
|
+
6. Create the kubernetes secret with the token:
|
159
|
+
|
160
|
+
````bash
|
161
|
+
kubectl create secret generic githubtoken --from-literal token="MY_TOKEN"
|
162
|
+
````
|
163
|
+
|
164
|
+
And we also make an HTTP POST with the status update data to GitHub.
|
165
|
+
This is done in a `Task` called `github-set-status`, create it as such:
|
166
|
+
````bash
|
167
|
+
kubectl apply -f github-set-status-task.yaml
|
168
|
+
````
|
169
|
+
|
170
|
+
#### Create the GitHub PR pipeline
|
171
|
+
|
172
|
+
Create the new pipeline, which executes the previously created `ruby-tracer-ci-pipeline`,
|
173
|
+
removes the currency report tasks and wraps the unittest jobs with GitHub Check status reporting tasks.
|
174
|
+
As long as [Pipelines in Pipelines](
|
175
|
+
https://tekton.dev/docs/pipelines/pipelines-in-pipelines/), remains an
|
176
|
+
unimplemented `alpha` feature in Tekton,
|
177
|
+
we will need the [yq](https://github.com/mikefarah/yq) (at least `4.0`)
|
178
|
+
to pull the tasks from our previous `ruby-tracer-ci-pipeline` into the
|
179
|
+
new pipeline `github-pr-ruby-tracer-ci-pipeline`.
|
180
|
+
|
181
|
+
````bash
|
182
|
+
(cat github-pr-pipeline.yaml.part && yq '{"a": {"b": .spec.tasks}}' pipeline.yaml| tail --lines=+3| head --lines=-16) | kubectl apply -f -
|
183
|
+
````
|
184
|
+
|
185
|
+
#### Create the GitHub PR Event Listener, TriggerTemplate and TriggerBinding
|
186
|
+
|
187
|
+
Once the new GitHub specific pipeline is created, we need a listener which starts
|
188
|
+
a new `PipelineRun` based on GitHub events.
|
189
|
+
For security reasons the listener will only trigger if the PR owner is a
|
190
|
+
repo owner. PRs from non-repo owners can be allowed in by owners after an initial review
|
191
|
+
with a comment on the pull request that contains `/ok-to-test`.
|
192
|
+
More abou this feature in the [tekton triggers documentsion](
|
193
|
+
https://github.com/tektoncd/triggers/blob/main/docs/interceptors.md#owners-validation-for-pull-requests).
|
194
|
+
|
195
|
+
````bash
|
196
|
+
kubectl apply --filename github-pr-eventlistener.yaml
|
197
|
+
````
|
198
|
+
|
199
|
+
After this ensure that there is a pod and a service created:
|
200
|
+
|
201
|
+
````bash
|
202
|
+
kubectl get pod | grep -i el-github-pr-ruby-eventlistener
|
203
|
+
kubectl get svc | grep -i el-github-pr-ruby-eventlistener
|
204
|
+
````
|
205
|
+
|
206
|
+
Do not continue if any of these missing.
|
207
|
+
|
208
|
+
#### Create the Ingress for the GitHub Webhook to come through
|
209
|
+
|
210
|
+
You will need an ingress controller for this.
|
211
|
+
On IKS you might want to read these resources:
|
212
|
+
* [managed ingress](https://cloud.ibm.com/docs/containers?topic=containers-managed-ingress-about)
|
213
|
+
* Or unmanaged [ingress controller howto](
|
214
|
+
https://github.com/IBM-Cloud/iks-ingress-controller/blob/master/docs/installation.md
|
215
|
+
).
|
216
|
+
|
217
|
+
1. Check the available `ingressclass` resources on your cluster
|
218
|
+
|
219
|
+
````bash
|
220
|
+
kubectl get ingressclass
|
221
|
+
````
|
222
|
+
|
223
|
+
* On `IKS` it will be `public-iks-k8s-nginx`.
|
224
|
+
* On `EKS` with the `ALB` ingress controller, it might be just `alb`
|
225
|
+
* On self hosted [nginx controller](https://kubernetes.github.io/ingress-nginx/deploy/)
|
226
|
+
this might just be `nginx`.
|
227
|
+
|
228
|
+
Edit and save the value of `ingressClassName:` in `github-webhook-ingress.yaml`.
|
229
|
+
|
230
|
+
2. Find out your Ingress domain or subdomain name.
|
231
|
+
|
232
|
+
* On `IKS`, go to `Clusters` select your cluster and then click `Overview`.
|
233
|
+
The domain name is listed under `Ingress subdomain`.
|
234
|
+
|
235
|
+
and create the resource:
|
236
|
+
|
237
|
+
````bash
|
238
|
+
kubectl apply --filename github-webhook-ingress.yaml
|
239
|
+
````
|
240
|
+
|
241
|
+
Make sure that you can use the ingress with the `/hooks` path via `https`:
|
242
|
+
````bash
|
243
|
+
curl https://<INGRESS_DOMAIN_NAME>/hooks
|
244
|
+
````
|
245
|
+
|
246
|
+
At this point this should respond this:
|
247
|
+
```json
|
248
|
+
{
|
249
|
+
"eventListener":"github-pr-eventlistener",
|
250
|
+
"namespace":"default",
|
251
|
+
"eventListenerUID":"",
|
252
|
+
"errorMessage":"Invalid event body format : unexpected end of JSON input"
|
253
|
+
}
|
254
|
+
```
|
255
|
+
|
256
|
+
#### Setup the webhook on GitHub
|
257
|
+
|
258
|
+
In the GitHub repo go to `Settings` -> `Webhooks` and click `Add Webhook`.
|
259
|
+
The fields we need to set are:
|
260
|
+
* `Payload URL`: `https://<INGRESS_DOMAIN_NAME>/hooks`
|
261
|
+
* `Content type`: application/json
|
262
|
+
* `Secret`: XXXXXXX (the secret token from github-interceptor-secret.yaml)
|
263
|
+
|
264
|
+
Under `SSL verification` select the radio button for `Enable SSL verification`.
|
265
|
+
Under `Which events would you like to trigger this webhook?` select
|
266
|
+
the radio button for `Let me select individual events.` and thick the checkbox next to
|
267
|
+
`Pull requests` and ensure that the rest are unthicked.
|
268
|
+
|
269
|
+
Click `Add webhook`.
|
270
|
+
|
271
|
+
If the webhook has been set up correctly, then GitHub sends a ping message.
|
272
|
+
Ensure that the ping is received from GitHub, and that it is filtered out so
|
273
|
+
a simple ping event does not trigger any `PipelineRun` unnecessarily.
|
274
|
+
|
275
|
+
````bash
|
276
|
+
eventlistener_pod=$(kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep el-github-pr-ruby)
|
277
|
+
kubectl logs "${eventlistener_pod}" | grep 'event type ping is not allowed'
|
278
|
+
````
|
data/.tekton/pipeline.yaml
CHANGED
@@ -53,6 +53,8 @@ spec:
|
|
53
53
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
54
54
|
# 3.3.1-bookworm
|
55
55
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
56
|
+
# 3.4.0-preview1-bookworm
|
57
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
56
58
|
- name: gemfile
|
57
59
|
value:
|
58
60
|
- "./Gemfile"
|
@@ -78,8 +80,8 @@ spec:
|
|
78
80
|
value:
|
79
81
|
- "./gemfiles/cuba_30.gemfile"
|
80
82
|
- "./gemfiles/cuba_40.gemfile"
|
81
|
-
- "./gemfiles/excon_02.gemfile"
|
82
83
|
- "./gemfiles/excon_079.gemfile"
|
84
|
+
- "./gemfiles/excon_0100.gemfile"
|
83
85
|
- "./gemfiles/excon_100.gemfile"
|
84
86
|
- "./gemfiles/graphql_10.gemfile"
|
85
87
|
- "./gemfiles/graphql_20.gemfile"
|
@@ -116,8 +118,8 @@ spec:
|
|
116
118
|
value:
|
117
119
|
- "./gemfiles/cuba_30.gemfile"
|
118
120
|
- "./gemfiles/cuba_40.gemfile"
|
119
|
-
- "./gemfiles/excon_02.gemfile"
|
120
121
|
- "./gemfiles/excon_079.gemfile"
|
122
|
+
- "./gemfiles/excon_0100.gemfile"
|
121
123
|
- "./gemfiles/excon_100.gemfile"
|
122
124
|
- "./gemfiles/graphql_10.gemfile"
|
123
125
|
- "./gemfiles/graphql_20.gemfile"
|
@@ -154,8 +156,8 @@ spec:
|
|
154
156
|
value:
|
155
157
|
- "./gemfiles/cuba_30.gemfile"
|
156
158
|
- "./gemfiles/cuba_40.gemfile"
|
157
|
-
- "./gemfiles/excon_02.gemfile"
|
158
159
|
- "./gemfiles/excon_079.gemfile"
|
160
|
+
- "./gemfiles/excon_0100.gemfile"
|
159
161
|
- "./gemfiles/excon_100.gemfile"
|
160
162
|
- "./gemfiles/graphql_10.gemfile"
|
161
163
|
- "./gemfiles/graphql_20.gemfile"
|
@@ -192,8 +194,8 @@ spec:
|
|
192
194
|
value:
|
193
195
|
- "./gemfiles/cuba_30.gemfile"
|
194
196
|
- "./gemfiles/cuba_40.gemfile"
|
195
|
-
- "./gemfiles/excon_02.gemfile"
|
196
197
|
- "./gemfiles/excon_079.gemfile"
|
198
|
+
- "./gemfiles/excon_0100.gemfile"
|
197
199
|
- "./gemfiles/excon_100.gemfile"
|
198
200
|
- "./gemfiles/graphql_10.gemfile"
|
199
201
|
- "./gemfiles/graphql_20.gemfile"
|
@@ -217,9 +219,47 @@ spec:
|
|
217
219
|
workspaces:
|
218
220
|
- name: task-pvc
|
219
221
|
workspace: ruby-tracer-ci-pipeline-pvc
|
220
|
-
- name: unittest-
|
222
|
+
- name: unittest-default-ruby-34
|
221
223
|
runAfter:
|
222
224
|
- unittest-default-ruby-33
|
225
|
+
matrix:
|
226
|
+
params:
|
227
|
+
- name: imageDigest
|
228
|
+
value:
|
229
|
+
# 3.4.0-preview1-bookworm
|
230
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
231
|
+
- name: gemfile
|
232
|
+
value:
|
233
|
+
- "./gemfiles/cuba_30.gemfile"
|
234
|
+
- "./gemfiles/cuba_40.gemfile"
|
235
|
+
- "./gemfiles/excon_079.gemfile"
|
236
|
+
- "./gemfiles/excon_0100.gemfile"
|
237
|
+
- "./gemfiles/excon_100.gemfile"
|
238
|
+
- "./gemfiles/graphql_10.gemfile"
|
239
|
+
- "./gemfiles/graphql_20.gemfile"
|
240
|
+
- "./gemfiles/grpc_10.gemfile"
|
241
|
+
- "./gemfiles/net_http_01.gemfile"
|
242
|
+
- "./gemfiles/rack_20.gemfile"
|
243
|
+
- "./gemfiles/rack_30.gemfile"
|
244
|
+
- "./gemfiles/rest_client_20.gemfile"
|
245
|
+
- "./gemfiles/roda_20.gemfile"
|
246
|
+
- "./gemfiles/roda_30.gemfile"
|
247
|
+
- "./gemfiles/sinatra_22.gemfile"
|
248
|
+
- "./gemfiles/sinatra_30.gemfile"
|
249
|
+
- "./gemfiles/sinatra_40.gemfile"
|
250
|
+
- "./gemfiles/shoryuken_50.gemfile"
|
251
|
+
- "./gemfiles/shoryuken_60.gemfile"
|
252
|
+
- name: configuration
|
253
|
+
value:
|
254
|
+
- "libraries"
|
255
|
+
taskRef:
|
256
|
+
name: ruby-tracer-unittest-default-libraries-task
|
257
|
+
workspaces:
|
258
|
+
- name: task-pvc
|
259
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
260
|
+
- name: unittest-mongo
|
261
|
+
runAfter:
|
262
|
+
- unittest-default-ruby-34
|
223
263
|
matrix:
|
224
264
|
params:
|
225
265
|
- name: imageDigest
|
@@ -232,6 +272,8 @@ spec:
|
|
232
272
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
233
273
|
# 3.3.1-bookworm
|
234
274
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
275
|
+
# 3.4.0-preview1-bookworm
|
276
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
235
277
|
- name: gemfile
|
236
278
|
value:
|
237
279
|
- "./gemfiles/mongo_216.gemfile"
|
@@ -256,6 +298,8 @@ spec:
|
|
256
298
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
257
299
|
# 3.3.1-bookworm
|
258
300
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
301
|
+
# 3.4.0-preview1-bookworm
|
302
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
259
303
|
- name: gemfile
|
260
304
|
value:
|
261
305
|
- "./gemfiles/dalli_20.gemfile"
|
@@ -281,6 +325,8 @@ spec:
|
|
281
325
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
282
326
|
# 3.3.1-bookworm
|
283
327
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
328
|
+
# 3.4.0-preview1-bookworm
|
329
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
284
330
|
- name: gemfile
|
285
331
|
value:
|
286
332
|
- "./gemfiles/aws_30.gemfile"
|
@@ -346,9 +392,35 @@ spec:
|
|
346
392
|
workspaces:
|
347
393
|
- name: task-pvc
|
348
394
|
workspace: ruby-tracer-ci-pipeline-pvc
|
349
|
-
- name: unittest-
|
395
|
+
- name: unittest-redis-ruby-34
|
350
396
|
runAfter:
|
351
397
|
- unittest-redis-ruby-32-33
|
398
|
+
matrix:
|
399
|
+
params:
|
400
|
+
- name: imageDigest
|
401
|
+
value:
|
402
|
+
# 3.4.0-preview1-bookworm
|
403
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
404
|
+
- name: gemfile
|
405
|
+
value:
|
406
|
+
- "./gemfiles/redis_40.gemfile"
|
407
|
+
- "./gemfiles/redis_50.gemfile"
|
408
|
+
- "./gemfiles/redis_51.gemfile"
|
409
|
+
- "./gemfiles/resque_122.gemfile"
|
410
|
+
- "./gemfiles/resque_20.gemfile"
|
411
|
+
- "./gemfiles/sidekiq_42.gemfile"
|
412
|
+
- "./gemfiles/sidekiq_50.gemfile"
|
413
|
+
- "./gemfiles/sidekiq_60.gemfile"
|
414
|
+
- "./gemfiles/sidekiq_65.gemfile"
|
415
|
+
- "./gemfiles/sidekiq_70.gemfile"
|
416
|
+
taskRef:
|
417
|
+
name: ruby-tracer-unittest-redis-libraries-task
|
418
|
+
workspaces:
|
419
|
+
- name: task-pvc
|
420
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
421
|
+
- name: unittest-rails-sqlite3
|
422
|
+
runAfter:
|
423
|
+
- unittest-redis-ruby-34
|
352
424
|
matrix:
|
353
425
|
params:
|
354
426
|
- name: imageDigest
|
@@ -361,6 +433,8 @@ spec:
|
|
361
433
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
362
434
|
# 3.3.1-bookworm
|
363
435
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
436
|
+
# 3.4.0-preview1-bookworm
|
437
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
364
438
|
- name: gemfile
|
365
439
|
value:
|
366
440
|
- "./gemfiles/rails_61.gemfile"
|
@@ -386,6 +460,8 @@ spec:
|
|
386
460
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
387
461
|
# 3.3.1-bookworm
|
388
462
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
463
|
+
# 3.4.0-preview1-bookworm
|
464
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
389
465
|
- name: gemfile
|
390
466
|
value:
|
391
467
|
- "./gemfiles/rails_61.gemfile"
|
@@ -411,6 +487,8 @@ spec:
|
|
411
487
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
412
488
|
# 3.3.1-bookworm
|
413
489
|
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
490
|
+
# 3.4.0-preview1-bookworm
|
491
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
414
492
|
- name: gemfile
|
415
493
|
value:
|
416
494
|
- "./gemfiles/rails_61.gemfile"
|
@@ -421,3 +499,73 @@ spec:
|
|
421
499
|
workspaces:
|
422
500
|
- name: task-pvc
|
423
501
|
workspace: ruby-tracer-ci-pipeline-pvc
|
502
|
+
- name: unittest-sequel-sqlite3
|
503
|
+
runAfter:
|
504
|
+
- unittest-rails-postgres
|
505
|
+
matrix:
|
506
|
+
params:
|
507
|
+
- name: imageDigest
|
508
|
+
value:
|
509
|
+
# 3.0.6-bullseye
|
510
|
+
- "sha256:3166618469ad8a3190d80f43b322818fafb4bfac0b4882255eee3346af2a0a35"
|
511
|
+
# 3.1.4-bookworm
|
512
|
+
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
513
|
+
# 3.2.3-bookworm
|
514
|
+
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
515
|
+
# 3.3.1-bookworm
|
516
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
517
|
+
# 3.4.0-preview1-bookworm
|
518
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
519
|
+
- name: gemfile
|
520
|
+
value:
|
521
|
+
- "./gemfiles/sequel_56.gemfile"
|
522
|
+
- "./gemfiles/sequel_57.gemfile"
|
523
|
+
- "./gemfiles/sequel_58.gemfile"
|
524
|
+
taskRef:
|
525
|
+
name: ruby-tracer-unittest-sequel-sqlite3-task
|
526
|
+
workspaces:
|
527
|
+
- name: task-pvc
|
528
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
529
|
+
- name: unittest-sequel-mysql2
|
530
|
+
runAfter:
|
531
|
+
- unittest-sequel-sqlite3
|
532
|
+
matrix:
|
533
|
+
params:
|
534
|
+
- name: imageDigest
|
535
|
+
value:
|
536
|
+
# 3.0.6-bullseye
|
537
|
+
- "sha256:3166618469ad8a3190d80f43b322818fafb4bfac0b4882255eee3346af2a0a35"
|
538
|
+
# 3.1.4-bookworm
|
539
|
+
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
540
|
+
# 3.2.3-bookworm
|
541
|
+
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
542
|
+
# 3.3.1-bookworm
|
543
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
544
|
+
# 3.4.0-preview1-bookworm
|
545
|
+
- "sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7"
|
546
|
+
- name: gemfile
|
547
|
+
value:
|
548
|
+
- "./gemfiles/sequel_56.gemfile"
|
549
|
+
- "./gemfiles/sequel_57.gemfile"
|
550
|
+
- "./gemfiles/sequel_58.gemfile"
|
551
|
+
taskRef:
|
552
|
+
name: ruby-tracer-unittest-sequel-mysql2-task
|
553
|
+
workspaces:
|
554
|
+
- name: task-pvc
|
555
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
556
|
+
- name: generate-currency-report
|
557
|
+
runAfter:
|
558
|
+
- unittest-sequel-mysql2
|
559
|
+
taskRef:
|
560
|
+
name: ruby-generate-currency-report-task
|
561
|
+
workspaces:
|
562
|
+
- name: task-pvc
|
563
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
564
|
+
- name: upload-currency-report
|
565
|
+
runAfter:
|
566
|
+
- generate-currency-report
|
567
|
+
taskRef:
|
568
|
+
name: ruby-upload-currency-report-task
|
569
|
+
workspaces:
|
570
|
+
- name: task-pvc
|
571
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
data/.tekton/pipelinerun.yaml
CHANGED
@@ -7,7 +7,7 @@ spec:
|
|
7
7
|
pipeline: "2h"
|
8
8
|
params:
|
9
9
|
- name: revision
|
10
|
-
value: "
|
10
|
+
value: "master"
|
11
11
|
pipelineRef:
|
12
12
|
name: ruby-tracer-ci-pipeline
|
13
13
|
workspaces:
|
@@ -18,4 +18,4 @@ spec:
|
|
18
18
|
- ReadWriteOnce
|
19
19
|
resources:
|
20
20
|
requests:
|
21
|
-
storage:
|
21
|
+
storage: 200Mi
|
@@ -69,6 +69,10 @@ spec:
|
|
69
69
|
# 3.3.1-bookworm
|
70
70
|
image: ruby@sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d
|
71
71
|
command: ["sh", "-c", "'true'"]
|
72
|
+
- name: prepuller-34
|
73
|
+
# 3.4.0-preview1-bookworm
|
74
|
+
image: ruby@sha256:2690af2a931469abe513b22a083b5ae0b56d4feffc0d3496eb6378723ab203e7
|
75
|
+
command: ["sh", "-c", "'true'"]
|
72
76
|
# Use the pause container to ensure the Pod goes into a `Running` phase
|
73
77
|
# but doesn't take up resource on the cluster
|
74
78
|
containers:
|
data/.tekton/run_unittests.sh
CHANGED
@@ -21,7 +21,7 @@ fi
|
|
21
21
|
|
22
22
|
case "${TEST_CONFIGURATION}" in
|
23
23
|
libraries)
|
24
|
-
export
|
24
|
+
export TEST_SETUP="$(basename ${BUNDLE_GEMFILE%.gemfile})_ruby_${RUBY_VERSION}"
|
25
25
|
export APPRAISAL_INITIALIZED=1 ;;
|
26
26
|
rails)
|
27
27
|
if [[ -z "${DATABASE_URL}" ]]; then
|
@@ -31,23 +31,36 @@ rails)
|
|
31
31
|
else
|
32
32
|
echo "DATABASE_URL is '${DATABASE_URL}'"
|
33
33
|
fi
|
34
|
-
export
|
34
|
+
export TEST_SETUP="$(basename ${BUNDLE_GEMFILE%.gemfile})_${DATABASE_URL%:[:/]*}_ruby_${RUBY_VERSION}"
|
35
35
|
export APPRAISAL_INITIALIZED=1 ;;
|
36
36
|
core)
|
37
|
-
export
|
37
|
+
export TEST_SETUP="core_ruby_${RUBY_VERSION}" ;;
|
38
38
|
lint)
|
39
|
-
|
39
|
+
export TEST_SETUP="lint_ruby_${RUBY_VERSION}" ;;
|
40
40
|
*)
|
41
41
|
echo "ERROR \$TEST_CONFIGURATION='${TEST_CONFIGURATION}' is unsupported " \
|
42
42
|
"not in (libraries|rails|core|lint)" >&2
|
43
43
|
exit 5 ;;
|
44
44
|
esac
|
45
45
|
|
46
|
+
export COVERAGE_PATH="cov_${TEST_SETUP}"
|
47
|
+
export DEPENDENCY_PATH="dep_${TEST_SETUP}"
|
48
|
+
|
46
49
|
echo -n "Configuration is '${TEST_CONFIGURATION}' on Ruby ${RUBY_VERSION} "
|
47
50
|
echo "with dependencies in '${BUNDLE_GEMFILE}'"
|
48
51
|
|
52
|
+
# The gemfiles folder is under the tekton shared workspace
|
53
|
+
# but we have to prevent the sharing, and the concurrent writing
|
54
|
+
# of the gemfiles/*.lock files
|
55
|
+
# so here we create a container-local, non-shared copy, of the sources and use that.
|
56
|
+
cp --recursive ../ruby-sensor/ /tmp/
|
57
|
+
pushd /tmp/ruby-sensor/
|
58
|
+
|
49
59
|
# Update RubyGems
|
50
|
-
gem update --system > /dev/null
|
60
|
+
while ! gem update --system > /dev/null; do
|
61
|
+
echo "Updating Gem with 'gem update --system' failed, retrying in a minute"
|
62
|
+
sleep 60
|
63
|
+
done
|
51
64
|
echo "Gem version $(gem --version)"
|
52
65
|
|
53
66
|
# Configure Bundler
|
@@ -55,7 +68,10 @@ bundler --version
|
|
55
68
|
bundle config set path '/tmp/vendor/bundle'
|
56
69
|
|
57
70
|
# Install Dependencies
|
58
|
-
bundle check || bundle install
|
71
|
+
while ! (bundle check || bundle install) | tee "${DEPENDENCY_PATH}"; do
|
72
|
+
echo "Bundle install failed, retrying in a minute"
|
73
|
+
sleep 60
|
74
|
+
done
|
59
75
|
|
60
76
|
# Run tests
|
61
77
|
if [[ "${TEST_CONFIGURATION}" = "lint" ]]; then
|
@@ -63,4 +79,9 @@ if [[ "${TEST_CONFIGURATION}" = "lint" ]]; then
|
|
63
79
|
else
|
64
80
|
mkdir --parents "${COVERAGE_PATH}/_junit"
|
65
81
|
bundle exec rake
|
82
|
+
cp --recursive "${COVERAGE_PATH}" "${OLDPWD}/"
|
66
83
|
fi
|
84
|
+
|
85
|
+
# Put back the dependency insallation results to the shared workspace
|
86
|
+
cp --recursive "${DEPENDENCY_PATH}" "${OLDPWD}/"
|
87
|
+
popd
|
@@ -24,10 +24,8 @@ spec:
|
|
24
24
|
params:
|
25
25
|
- name: revision
|
26
26
|
value: master
|
27
|
-
- name: git-commit-sha
|
28
|
-
value: $(tt.params.git-commit-sha)
|
29
27
|
pipelineRef:
|
30
|
-
name:
|
28
|
+
name: ruby-tracer-ci-pipeline
|
31
29
|
workspaces:
|
32
30
|
- name: ruby-tracer-ci-pipeline-pvc
|
33
31
|
volumeClaimTemplate:
|
@@ -36,7 +34,7 @@ spec:
|
|
36
34
|
- ReadWriteOnce
|
37
35
|
resources:
|
38
36
|
requests:
|
39
|
-
storage:
|
37
|
+
storage: 200Mi
|
40
38
|
---
|
41
39
|
apiVersion: triggers.tekton.dev/v1beta1
|
42
40
|
kind: TriggerBinding
|