Skip to content

Commit

Permalink
Update pipeline: Sent thor data to metrics collector (#245)
Browse files Browse the repository at this point in the history
* Update pipeline: Sent thor data to metrics collector
  • Loading branch information
kornys authored Aug 24, 2023
1 parent 05205f8 commit 83ca163
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@
vars:
name: "{{ workers.main_cluster.name }}"

- name: Create collector metrics for test suites
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}"
namespace: "{{ infra_ci_namespace }}"
state: present
verify_ssl: no
apply: true
src: "templates/tekton/pipelines/test-suite/metrics-collector.yaml"

- name: Create Tekton pipelines from jinja templates for release_cluster and downstream_cluster
kubernetes.core.k8s:
kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: tealc-metrics-collector
labels:
app: tealc-metrics-collector
---
kind: Service
apiVersion: v1
metadata:
name: tealc-metrics-collector
labels:
app: tealc-metrics-collector
spec:
ports:
- port: 8080
name: metrics
protocol: TCP
targetPort: 8080
selector:
app: tealc-metrics-collector
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tealc-metrics-collector
labels:
app: tealc-metrics-collector
spec:
replicas: 1
selector:
matchLabels:
app: tealc-metrics-collector
template:
metadata:
labels:
app: tealc-metrics-collector
tealc/kind: thor-exporter
spec:
serviceAccountName: tealc-metrics-collector
containers:
- name: tealc-metrics-collector
image: quay.io/tealc/metrics-collector:latest
resources:
limits:
memory: "128Mi"
cpu: "100m"
ports:
- containerPort: 8080
name: metrics
protocol: TCP
strategy:
type: Recreate
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
app: tealc
name: thor-metrics
spec:
podMetricsEndpoints:
- path: /metrics
port: metrics
selector:
matchLabels:
tealc/kind: thor-exporter
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,27 @@ spec:
name: worker-03-tekton
key: server
script: |
mkdir -p /opt/thor
cd /opt/thor
cd $(workspaces.pipeline-ws.path)

git clone https://github.com/ExcelentProject/thor.git

cd thor
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
mvn test --no-transfer-progress
finally:
- name: sent-results
workspaces:
- name: pipeline-ws
workspace: pipeline-ws
taskSpec:
workspaces:
- name: pipeline-ws
steps:
- name: sent-results
image: quay.io/mk-ci-cd/mas-ci-tools:latest
script: |
cd $(workspaces.pipeline-ws.path)/thor/target/surefire-reports
for file in *.xml; do curl -X POST -H "X-Run-ID: $(context.pipelineRun.name)" -d @$file tealc-metrics-collector.tealc-pipelines.cluster.local:8080/data; done
- name: notify-slack
when:
- input: $(tasks.status)
Expand Down

0 comments on commit 83ca163

Please sign in to comment.