Skip to content
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

Update pipeline: Sent thor data to metrics collector #245

Merged
merged 3 commits into from
Aug 24, 2023
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
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
Loading