Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .tekton/.currency/currency-pipeline.yaml
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
20 changes: 20 additions & 0 deletions .tekton/.currency/currency-pipelinerun.yaml
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
29 changes: 29 additions & 0 deletions .tekton/.currency/currency-rbac.yaml
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
56 changes: 56 additions & 0 deletions .tekton/.currency/currency-scheduled-eventlistener.yaml
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
---
89 changes: 89 additions & 0 deletions .tekton/.currency/currency-tasks.yaml
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
30 changes: 30 additions & 0 deletions .tekton/.currency/docs/report.md
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 |
5 changes: 5 additions & 0 deletions .tekton/.currency/resources/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
requests
pandas
beautifulsoup4
tabulate
kubernetes
Loading