From f17bdc72cec3422186403e5fd6f944c89148aab2 Mon Sep 17 00:00:00 2001 From: PPPW Date: Tue, 19 Mar 2024 12:47:11 -0400 Subject: [PATCH] Fix Geneva mdm Docker checks (#77) * Fix Geneva mdm Docker checks * Fix tab * Small permission fix * Remove image ID --------- Co-authored-by: Pei Wang --- .../grafana_dashboard_templates/Cluster_View.json | 3 --- .../grafana_dashboard_templates/GPU_View.json | 3 --- .../grafana_dashboard_templates/Network_View.json | 3 --- .../grafana_dashboard_templates/Node_View.json | 3 --- src/worker/install/install.sh | 10 ++++++---- src/worker/start_geneva.sh | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/deploy_managed_infra/grafana_dashboard_templates/Cluster_View.json b/deploy_managed_infra/grafana_dashboard_templates/Cluster_View.json index 1160540..eb857dd 100755 --- a/deploy_managed_infra/grafana_dashboard_templates/Cluster_View.json +++ b/deploy_managed_infra/grafana_dashboard_templates/Cluster_View.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": 45, "links": [ { "asDropdown": true, @@ -1889,7 +1888,5 @@ }, "timezone": "utc", "title": "Cluster Unified View (Experimental)", - "uid": "e12394be-6c26-4c19-a089-f69930b17e7e", - "version": 75, "weekStart": "" } diff --git a/deploy_managed_infra/grafana_dashboard_templates/GPU_View.json b/deploy_managed_infra/grafana_dashboard_templates/GPU_View.json index 3033e0f..d02e41e 100755 --- a/deploy_managed_infra/grafana_dashboard_templates/GPU_View.json +++ b/deploy_managed_infra/grafana_dashboard_templates/GPU_View.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 39, "links": [ { "asDropdown": true, @@ -2135,7 +2134,5 @@ }, "timezone": "utc", "title": "GPU View", - "uid": "dHpbWBP4z", - "version": 43, "weekStart": "" } diff --git a/deploy_managed_infra/grafana_dashboard_templates/Network_View.json b/deploy_managed_infra/grafana_dashboard_templates/Network_View.json index d81d702..61c6d43 100755 --- a/deploy_managed_infra/grafana_dashboard_templates/Network_View.json +++ b/deploy_managed_infra/grafana_dashboard_templates/Network_View.json @@ -24,7 +24,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 40, "links": [ { "asDropdown": true, @@ -1226,7 +1225,5 @@ }, "timezone": "utc", "title": "Network View", - "uid": "IziFPI8Vk", - "version": 16, "weekStart": "" } diff --git a/deploy_managed_infra/grafana_dashboard_templates/Node_View.json b/deploy_managed_infra/grafana_dashboard_templates/Node_View.json index a9f96a7..f481833 100755 --- a/deploy_managed_infra/grafana_dashboard_templates/Node_View.json +++ b/deploy_managed_infra/grafana_dashboard_templates/Node_View.json @@ -25,7 +25,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 41, "links": [ { "asDropdown": true, @@ -1033,7 +1032,5 @@ }, "timezone": "utc", "title": "Node View", - "uid": "DBUc8IU4k", - "version": 19, "weekStart": "" } diff --git a/src/worker/install/install.sh b/src/worker/install/install.sh index f33ef9a..2bf963e 100755 --- a/src/worker/install/install.sh +++ b/src/worker/install/install.sh @@ -37,10 +37,12 @@ then # Install open telemetry related packages python3 -m pip -qqq install opentelemetry-sdk opentelemetry-exporter-otlp - # Pull Geneva Metrics Extension(MA) docker image - docker pull linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION - docker tag linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION genevamdm - docker rmi linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION + if ! sudo docker images | grep -q genevamdm ; then + # Pull Geneva Metrics Extension(MA) docker image + docker pull linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION + docker tag linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION genevamdm + docker rmi linuxgeneva-microsoft.azurecr.io/genevamdm:$MDM_DOCKER_VERSION + fi elif [ $PUBLISHER_INSTALL == 'azure_monitor' ]; then $(dirname "${BASH_SOURCE[0]}")/azure_monitor.sh diff --git a/src/worker/start_geneva.sh b/src/worker/start_geneva.sh index bc3dc13..084523a 100755 --- a/src/worker/start_geneva.sh +++ b/src/worker/start_geneva.sh @@ -6,7 +6,7 @@ CONTAINER_NAME="genevamdmagent" GENEVA_CONFIG=$CONFIG/geneva_config.json # check if the docker container is running -if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then +if sudo docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then echo "Geneva Docker is running" exit 0 fi