-
Notifications
You must be signed in to change notification settings - Fork 34
currency: Automate python tracer currency report generation #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
19892bb
currency: automate python tracer currency report generation
GSVarsha ea9aa41
currency: add scheduled event listener
GSVarsha 7365792
chore(currency): minor fixes
GSVarsha 69bb3e2
currency: use python kubernetes client to interact with the tekton cl…
GSVarsha f910363
chore(currency): change revision to master, upload report only on suc…
GSVarsha 74511da
currency: extract starlette version from python-tracer-unittest-geven…
GSVarsha 1a7d2d5
currency: filter taskruns before sorting
GSVarsha 9593c8c
chore(currency): make processing taskrun logs reusable
GSVarsha 5fa0ef9
chore(currency):
GSVarsha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: Pipeline | ||
| metadata: | ||
| name: python-currency-pipeline | ||
| spec: | ||
| params: | ||
| - name: revision | ||
| type: string | ||
| workspaces: | ||
| - name: currency-pvc | ||
| tasks: | ||
| - name: clone-repo | ||
| params: | ||
| - name: revision | ||
| value: $(params.revision) | ||
| taskRef: | ||
| name: git-clone-task | ||
| workspaces: | ||
| - name: task-pvc | ||
| workspace: currency-pvc | ||
| - name: generate-currency-report | ||
| runAfter: | ||
| - clone-repo | ||
| taskRef: | ||
| name: generate-currency-report-task | ||
| workspaces: | ||
| - name: task-pvc | ||
| workspace: currency-pvc | ||
| - name: upload-currency-report | ||
| runAfter: | ||
| - generate-currency-report | ||
| taskRef: | ||
| name: upload-currency-report-task | ||
| workspaces: | ||
| - name: task-pvc | ||
| workspace: currency-pvc |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: PipelineRun | ||
| metadata: | ||
| name: python-currency-pipelinerun | ||
| spec: | ||
| params: | ||
| - name: revision | ||
| value: "master" | ||
| pipelineRef: | ||
| name: python-currency-pipeline | ||
| serviceAccountName: currency-serviceaccount | ||
| workspaces: | ||
| - name: currency-pvc | ||
| volumeClaimTemplate: | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 100Mi |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: currency-serviceaccount | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: currency-clusterrole | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["pods", "pods/log"] | ||
| verbs: ["get", "list"] | ||
| - apiGroups: ["tekton.dev"] | ||
| resources: ["taskruns"] | ||
| verbs: ["get", "list"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: currency-clusterrolebinding | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: currency-serviceaccount | ||
| namespace: default | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: currency-clusterrole |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| apiVersion: triggers.tekton.dev/v1beta1 | ||
| kind: EventListener | ||
| metadata: | ||
| name: python-currency-cron-listener | ||
| spec: | ||
| serviceAccountName: tekton-triggers-eventlistener-serviceaccount | ||
| triggers: | ||
| - name: currency-cron-trigger | ||
| template: | ||
| ref: python-currency-trigger-template | ||
| --- | ||
| apiVersion: triggers.tekton.dev/v1beta1 | ||
| kind: TriggerTemplate | ||
| metadata: | ||
| name: python-currency-trigger-template | ||
| spec: | ||
| resourcetemplates: | ||
| - apiVersion: tekton.dev/v1beta1 | ||
| kind: PipelineRun | ||
| metadata: | ||
| generateName: python-currency- | ||
| spec: | ||
| pipelineRef: | ||
| name: python-currency-pipeline | ||
| serviceAccountName: currency-serviceaccount | ||
| params: | ||
| - name: revision | ||
| value: "master" | ||
| workspaces: | ||
| - name: currency-pvc | ||
| volumeClaimTemplate: | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 100Mi | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: CronJob | ||
| metadata: | ||
| name: python-currency-cronjob | ||
| spec: | ||
| schedule: "5 2 * * Mon-Fri" | ||
| jobTemplate: | ||
| spec: | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: http-request-to-el-svc | ||
| # curlimages/curl:8.6.0 | ||
| image: curlimages/curl@sha256:f2237028bed58de91f62aea74260bb2a299cf12fbcabc23cfaf125fef276c884 | ||
| imagePullPolicy: IfNotPresent | ||
| args: ["curl", "-X", "POST", "--data", "{}", "el-python-currency-cron-listener.default.svc.cluster.local:8080"] | ||
| restartPolicy: OnFailure | ||
| --- |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: Task | ||
| metadata: | ||
| name: git-clone-task | ||
| spec: | ||
| params: | ||
| - name: revision | ||
| type: string | ||
| workspaces: | ||
| - name: task-pvc | ||
| mountPath: /workspace | ||
| steps: | ||
| - name: clone-repo | ||
| # alpine/git:2.43.0 | ||
| image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf | ||
| script: | | ||
| #!/bin/sh | ||
| echo "Cloning repo" | ||
| cd /workspace && git clone --filter=blob:none --sparse --depth 1 https://github.com/instana/python-sensor -b $(params.revision) | ||
| cd python-sensor | ||
| git sparse-checkout add .tekton/.currency | ||
| ls -lah /workspace/python-sensor | ||
| --- | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: Task | ||
| metadata: | ||
| name: generate-currency-report-task | ||
| spec: | ||
| workspaces: | ||
| - name: task-pvc | ||
| mountPath: /workspace | ||
| steps: | ||
| - name: generate-currency-report | ||
| # 3.10.13-bookworm | ||
| image: python@sha256:c970ff53939772f47b0672e380328afb50d8fd1c0568ed4f82c22effc54244fc | ||
| script: | | ||
| #!/usr/bin/env bash | ||
| cd /workspace/python-sensor/.tekton/.currency | ||
|
|
||
| python -m venv /tmp/venv | ||
| source /tmp/venv/bin/activate | ||
| pip install -r resources/requirements.txt | ||
|
|
||
| python scripts/generate_report.py | ||
| cat docs/report.md | ||
| --- | ||
| apiVersion: tekton.dev/v1beta1 | ||
| kind: Task | ||
| metadata: | ||
| name: upload-currency-report-task | ||
| spec: | ||
| params: | ||
| - name: github-token-secret | ||
| default: instanacd-github-api-token | ||
| workspaces: | ||
| - name: task-pvc | ||
| mountPath: /workspace | ||
| steps: | ||
| - name: upload-currency-report | ||
| # alpine/git:2.43.0 | ||
| image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf | ||
| env: | ||
| - name: GH_ENTERPRISE_TOKEN | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: $(params.github-token-secret) | ||
| key: "GH_ENTERPRISE_TOKEN" | ||
| script: | | ||
| #!/bin/sh | ||
|
|
||
| cd /workspace | ||
| git clone https://oauth2:$GH_ENTERPRISE_TOKEN@github.ibm.com/instana/tracer-reports.git | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "The attempt to clone the tracer-reports repository failed, preventing the upload of python tracer currency report." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd tracer-reports | ||
|
|
||
| cp ../python-sensor/.tekton/.currency/docs/report.md ./automated/currency/python/report.md | ||
|
|
||
| git config user.name "Instanacd PAT for GitHub Enterprise" | ||
| git config user.email instana.ibm.github.enterprise@ibm.com | ||
|
|
||
| git add . | ||
|
|
||
| git commit -m "chore: Updated python currency report" | ||
| git push origin main | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ##### This page is auto-generated. Any change will be overwritten after the next sync. Please apply changes directly to the files in the [python tracer](https://github.com/instana/python-sensor) repo. | ||
| ## Python supported packages and versions | ||
| | Package name | Support Policy | Beta version | Last Supported Version | Latest version | Up-to-date | Cloud Native | | ||
| |:---------------------|:-----------------|:---------------|:-------------------------|:-----------------|:-------------|:---------------| | ||
| | ASGI | 0-day | No | 3.0 | 3.0 | Yes | No | | ||
| | Celery | 30-days | No | 5.4.0 | 5.4.0 | Yes | No | | ||
| | Django | 30-days | No | 5.0.6 | 5.0.6 | Yes | No | | ||
| | FastAPI | 0-day | No | 0.111.0 | 0.111.0 | Yes | No | | ||
| | Flask | 0-day | No | 3.0.3 | 3.0.3 | Yes | No | | ||
| | Pyramid | 30-days | No | 2.0.2 | 2.0.2 | Yes | No | | ||
| | Sanic | On demand | No | 21.6.2 | 23.12.1 | No | No | | ||
| | Starlette | 30-days | No | 0.37.2 | 0.37.2 | Yes | No | | ||
| | Tornado | 30-days | No | 5.1.1 | 6.4 | No | No | | ||
| | Webapp2 | On demand | No | 2.5.2 | 2.5.2 | Yes | No | | ||
| | WSGI | 0-day | No | 1.0.1 | 1.0.1 | Yes | No | | ||
| | Aiohttp | 30-days | No | 3.9.5 | 3.9.5 | Yes | No | | ||
| | Asynqp | Deprecated | No | 0.6 | 0.6 | Yes | No | | ||
| | Boto3 | 0-day | No | 1.34.112 | 1.34.112 | Yes | Yes | | ||
| | Google-cloud-pubsub | 30-days | No | 2.1.0 | 2.21.1 | No | Yes | | ||
| | Google-cloud-storage | 30-days | No | 2.14.0 | 2.16.0 | No | Yes | | ||
| | Grpcio | 30-days | No | 1.64.0 | 1.64.0 | Yes | Yes | | ||
| | Mysqlclient | 30-days | No | 2.2.4 | 2.2.4 | Yes | Yes | | ||
| | Pika | 30-days | No | 1.3.2 | 1.3.2 | Yes | No | | ||
| | PyMySQL | 30-days | No | 1.1.1 | 1.1.1 | Yes | Yes | | ||
| | Pymongo | 30-days | No | 4.7.2 | 4.7.2 | Yes | Yes | | ||
| | Psycopg2 | 30-days | No | 2.9.9 | 2.9.9 | Yes | No | | ||
| | Redis | 30-days | No | 5.0.4 | 5.0.4 | Yes | Yes | | ||
| | Requests | 0-day | No | 2.32.2 | 2.32.2 | Yes | Yes | | ||
| | SQLAlchemy | 30-days | No | 2.0.30 | 2.0.30 | Yes | Yes | | ||
| | Urllib3 | 0-day | No | 2.2.1 | 2.2.1 | Yes | No | |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| requests | ||
| pandas | ||
| beautifulsoup4 | ||
| tabulate | ||
| kubernetes |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.