instana 1.215.0 → 1.216.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +83 -3
- data/.tekton/.currency/resources/requirements.txt +0 -1
- data/.tekton/.currency/resources/table.json +13 -13
- data/.tekton/.currency/scripts/generate_report.py +37 -130
- data/.tekton/README.md +278 -0
- data/.tekton/github-pr-eventlistener.yaml +1 -1
- data/.tekton/pipeline.yaml +96 -2
- 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 +1 -1
- data/.tekton/task.yaml +72 -0
- data/gemfiles/rails_61.gemfile +1 -0
- data/gemfiles/rails_70.gemfile +1 -0
- data/gemfiles/rails_71.gemfile +1 -0
- data/gemfiles/sequel_56.gemfile +16 -0
- data/gemfiles/sequel_57.gemfile +16 -0
- data/gemfiles/sequel_58.gemfile +16 -0
- data/instana.gemspec +2 -0
- data/lib/instana/activators/sequel.rb +20 -0
- data/lib/instana/backend/host_agent.rb +5 -1
- data/lib/instana/config.rb +1 -0
- data/lib/instana/instrumentation/sequel.rb +42 -0
- data/lib/instana/tracing/span.rb +2 -2
- data/lib/instana/version.rb +1 -1
- data/test/activator_test.rb +1 -1
- data/test/backend/host_agent_test.rb +2 -0
- data/test/instrumentation/rails_active_record_test.rb +1 -1
- data/test/instrumentation/sequel_test.rb +105 -0
- data/test/tracing/span_test.rb +2 -2
- data/test/tracing/tracer_test.rb +1 -3
- metadata +39 -8
- 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-eventlistener
|
203
|
+
kubectl get svc | grep -i el-github-pr-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"
|
@@ -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_02.gemfile"
|
236
|
+
- "./gemfiles/excon_079.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,19 @@ spec:
|
|
421
499
|
workspaces:
|
422
500
|
- name: task-pvc
|
423
501
|
workspace: ruby-tracer-ci-pipeline-pvc
|
502
|
+
- name: generate-currency-report
|
503
|
+
runAfter:
|
504
|
+
- unittest-rails-postgres
|
505
|
+
taskRef:
|
506
|
+
name: ruby-generate-currency-report-task
|
507
|
+
workspaces:
|
508
|
+
- name: task-pvc
|
509
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
510
|
+
- name: upload-currency-report
|
511
|
+
runAfter:
|
512
|
+
- generate-currency-report
|
513
|
+
taskRef:
|
514
|
+
name: ruby-upload-currency-report-task
|
515
|
+
workspaces:
|
516
|
+
- name: task-pvc
|
517
|
+
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
|
data/.tekton/task.yaml
CHANGED
@@ -291,3 +291,75 @@ spec:
|
|
291
291
|
workingDir: /workspace/ruby-sensor/
|
292
292
|
command:
|
293
293
|
- /workspace/ruby-sensor/.tekton/run_unittests.sh
|
294
|
+
---
|
295
|
+
apiVersion: tekton.dev/v1
|
296
|
+
kind: Task
|
297
|
+
metadata:
|
298
|
+
name: ruby-generate-currency-report-task
|
299
|
+
spec:
|
300
|
+
workspaces:
|
301
|
+
- name: task-pvc
|
302
|
+
mountPath: /workspace
|
303
|
+
steps:
|
304
|
+
- name: generate-currency-report
|
305
|
+
# 3.10.13-bookworm
|
306
|
+
image: python@sha256:c970ff53939772f47b0672e380328afb50d8fd1c0568ed4f82c22effc54244fc
|
307
|
+
script: |
|
308
|
+
#!/usr/bin/env bash
|
309
|
+
|
310
|
+
cd /workspace/ruby-sensor/.tekton/.currency
|
311
|
+
|
312
|
+
python -m venv /tmp/venv
|
313
|
+
source /tmp/venv/bin/activate
|
314
|
+
pip install -r resources/requirements.txt
|
315
|
+
|
316
|
+
python scripts/generate_report.py
|
317
|
+
if [ $? -ne 0 ]; then
|
318
|
+
echo "Error occured while generating the ruby tracer currency report." >&2
|
319
|
+
exit 1
|
320
|
+
fi
|
321
|
+
cat docs/report.md
|
322
|
+
---
|
323
|
+
apiVersion: tekton.dev/v1
|
324
|
+
kind: Task
|
325
|
+
metadata:
|
326
|
+
name: ruby-upload-currency-report-task
|
327
|
+
spec:
|
328
|
+
params:
|
329
|
+
- name: github-token-secret
|
330
|
+
default: instanacd-github-api-token
|
331
|
+
workspaces:
|
332
|
+
- name: task-pvc
|
333
|
+
mountPath: /workspace
|
334
|
+
steps:
|
335
|
+
- name: upload-currency-report
|
336
|
+
# alpine/git:2.43.0
|
337
|
+
image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf
|
338
|
+
env:
|
339
|
+
- name: GH_ENTERPRISE_TOKEN
|
340
|
+
valueFrom:
|
341
|
+
secretKeyRef:
|
342
|
+
name: $(params.github-token-secret)
|
343
|
+
key: "GH_ENTERPRISE_TOKEN"
|
344
|
+
script: |
|
345
|
+
#!/bin/sh
|
346
|
+
|
347
|
+
cd /workspace
|
348
|
+
git clone https://oauth2:$GH_ENTERPRISE_TOKEN@github.ibm.com/instana/tracer-reports.git
|
349
|
+
|
350
|
+
if [ $? -ne 0 ]; then
|
351
|
+
echo "The attempt to clone the tracer-reports repository failed, preventing the upload of ruby tracer currency report." >&2
|
352
|
+
exit 1
|
353
|
+
fi
|
354
|
+
|
355
|
+
cd tracer-reports
|
356
|
+
|
357
|
+
cp ../ruby-sensor/.tekton/.currency/docs/report.md ./automated/currency/ruby/report.md
|
358
|
+
|
359
|
+
git config user.name "Instanacd PAT for GitHub Enterprise"
|
360
|
+
git config user.email instana.ibm.github.enterprise@ibm.com
|
361
|
+
|
362
|
+
git add .
|
363
|
+
|
364
|
+
git commit -m "chore: Updated ruby currency report"
|
365
|
+
git push origin main
|
data/gemfiles/rails_61.gemfile
CHANGED
data/gemfiles/rails_70.gemfile
CHANGED
data/gemfiles/rails_71.gemfile
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
# (c) Copyright IBM Corp. 2024
|
4
|
+
|
5
|
+
source "https://rubygems.org"
|
6
|
+
|
7
|
+
gem "minitest-reporters"
|
8
|
+
gem "webmock"
|
9
|
+
gem "puma"
|
10
|
+
gem "rack-test"
|
11
|
+
gem "simplecov", "~> 0.21.2"
|
12
|
+
gem "sequel", "~> 5.60"
|
13
|
+
gem "sqlite3", "~> 1.4"
|
14
|
+
gem "mysql2", "0.5.5"
|
15
|
+
|
16
|
+
gemspec path: "../"
|