Skip to content

Commit

Permalink
Merge pull request #86 from naved001/k8s/update-manifests
Browse files Browse the repository at this point in the history
Some updates to the kubernetes manifests so they work with the new co…
  • Loading branch information
naved001 authored Nov 5, 2024
2 parents bbdd702 + 9c94562 commit 201aa24
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ COPY requirements.txt ./
RUN pip install -r requirements.txt

COPY openshift_metrics/ /app/openshift_metrics
COPY bin/collect_metrics.sh /app/collect_metrics.sh
COPY bin/produce_report.sh /app/produce_report.sh

CMD ["python", "openshift_metrics/openshift_prometheus_metrics.py", "--upload-to-s3"]
CMD ["./collect_metrics.sh"]
5 changes: 5 additions & 0 deletions bin/collect_metrics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

python -m openshift_metrics.openshift_prometheus_metrics \
--output-file /tmp/metrics.json \
--upload-to-s3
6 changes: 6 additions & 0 deletions bin/produce_report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

python -m openshift_metrics.merge /data/*.json \
--invoice-file /tmp/invoice.csv \
--pod-report-file /tmp/pod-report.csv \
--upload-to-s3
8 changes: 1 addition & 7 deletions k8s/base/daily-openshift-metrics-collector-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,5 @@ spec:
secretKeyRef:
name: openshift-metrics-b2-bucket
key: secret-access-key
volumeMounts:
- name: data-volume
mountPath: /data
command: ["/bin/sh", "-c", "cd /data && python /app/openshift_metrics/openshift_prometheus_metrics.py --upload-to-s3"]
volumes:
- name: data-volume
emptyDir: {}
command: ["./collect_metrics.sh"]
restartPolicy: OnFailure
22 changes: 22 additions & 0 deletions k8s/base/gpu-node-map-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: gpu-node-map
data:
gpu_node_map.json: |
{
"wrk-88": "Tesla-V100-PCIE-32GB",
"wrk-89": "Tesla-V100-PCIE-32GB",
"wrk-94": "NVIDIA-A100-SXM4-40GB",
"wrk-95": "NVIDIA-A100-SXM4-40GB",
"wrk-97": "NVIDIA-A100-SXM4-40GB",
"wrk-98": "NVIDIA-A100-SXM4-40GB",
"wrk-99": "NVIDIA-A100-SXM4-40GB",
"wrk-102": "Tesla-V100-PCIE-32GB",
"wrk-103": "Tesla-V100-PCIE-32GB",
"wrk-104": "Tesla-V100-PCIE-32GB",
"wrk-105": "Tesla-V100-PCIE-32GB",
"wrk-106": "Tesla-V100-PCIE-32GB",
"wrk-107": "Tesla-V100-PCIE-32GB",
"wrk-108": "Tesla-V100-PCIE-32GB"
}
1 change: 1 addition & 0 deletions k8s/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ resources:
- daily-openshift-metrics-collector-cronjob.yaml
- produce-report-cronjob.yaml
- metrics-downloader-configmap.yaml
- gpu-node-map-configmap.yaml
8 changes: 7 additions & 1 deletion k8s/base/produce-report-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ spec:
volumeMounts:
- name: data-volume
mountPath: /data
command: ["/bin/sh", "-c", "cd /data && python /app/openshift_metrics/merge.py /data/*.json --upload-to-s3"]
- name: gpu-node-map
mountPath: /app/gpu_node_map.json
subPath: gpu_node_map.json
command: ["./produce_report.sh"]
initContainers:
- name: download-metrics
image: amazon/aws-cli
Expand Down Expand Up @@ -63,4 +66,7 @@ spec:
configMap:
name: metrics-downloader
defaultMode: 0555
- name: gpu-node-map
configMap:
name: gpu-node-map
restartPolicy: OnFailure

0 comments on commit 201aa24

Please sign in to comment.