Fix Nomad hostname output in docker job console logs. 91/37491/1
authorDave Wallace <[email protected]>
Thu, 20 Oct 2022 01:48:45 +0000 (21:48 -0400)
committerDave Wallace <[email protected]>
Thu, 20 Oct 2022 01:48:45 +0000 (21:48 -0400)
Signed-off-by: Dave Wallace <[email protected]>
Change-Id: If88be92314290bd2b2d0b1bbb21167b6286b8155

21 files changed:
jenkins-config/clouds/nomad/FDIONOMAD/builder-debian10-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-debian10-sandbox-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-debian11-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-debian11-sandbox-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2004-prod-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2004-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2004-sandbox-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2004-sandbox-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2204-prod-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2204-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2204-sandbox-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/builder-ubuntu2204-sandbox-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2004-prod-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2004-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2004-sandbox-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2004-sandbox-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2204-prod-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2204-prod-x86_64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2204-sandbox-aarch64.yaml
jenkins-config/clouds/nomad/FDIONOMAD/csit-builder-ubuntu2204-sandbox-x86_64.yaml
jjb/scripts/setup_executor_env.sh

index c6134f2..5599ed7 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-debian10:prod-x86_64"
     labels: "builder-debian10-prod-x86_64"
     prefix: "builder-debian10-prod-x86_64"
-    hostVolumes: "/tmp/ccache.debian10:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.debian10:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 81d49e4..f3e868c 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-debian10:sandbox-x86_64"
     labels: "builder-debian10-sandbox-x86_64"
     prefix: "builder-debian10-sandbox-x86_64"
-    hostVolumes: "/tmp/ccache.debian10:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.debian10:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 701e78f..807345d 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-debian11:prod-x86_64"
     labels: "builder-debian11-prod-x86_64"
     prefix: "builder-debian11-prod-x86_64"
-    hostVolumes: "/tmp/ccache.debian11:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.debian11:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index fceac02..4888cd0 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-debian11:sandbox-x86_64"
     labels: "builder-debian11-sandbox-x86_64"
     prefix: "builder-debian11-sandbox-x86_64"
-    hostVolumes: "/tmp/ccache.debian11:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.debian11:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 7d4c78d..d5715a5 100644 (file)
@@ -3,4 +3,6 @@ templates:
   - image: "fdiotools/builder-ubuntu2004:prod-aarch64"
     labels: "builder-ubuntu2004-prod-aarch64"
     prefix: "builder-ubuntu2004-prod-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2004:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2004:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 9020836..21d9b73 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2004:prod-x86_64"
     labels: "builder-ubuntu2004-prod-x86_64"
     prefix: "builder-ubuntu2004-prod-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2004:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2004:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index bfc87f2..920bffe 100644 (file)
@@ -3,4 +3,6 @@ templates:
   - image: "fdiotools/builder-ubuntu2004:sandbox-aarch64"
     labels: "builder-ubuntu2004-sandbox-aarch64"
     prefix: "builder-ubuntu2004-sandbox-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2004:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2004:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 9910fdd..54b317c 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2004:sandbox-x86_64"
     labels: "builder-ubuntu2004-sandbox-x86_64"
     prefix: "builder-ubuntu2004-sandbox-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2004:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2004:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index b4377e9..3973add 100644 (file)
@@ -3,4 +3,6 @@ templates:
   - image: "fdiotools/builder-ubuntu2204:prod-aarch64"
     labels: "builder-ubuntu2204-prod-aarch64"
     prefix: "builder-ubuntu2204-prod-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 1170d2c..24a466f 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:prod-x86_64"
     labels: "builder-ubuntu2204-prod-x86_64"
     prefix: "builder-ubuntu2204-prod-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 66a8631..5916faf 100644 (file)
@@ -3,4 +3,6 @@ templates:
   - image: "fdiotools/builder-ubuntu2204:sandbox-aarch64"
     labels: "builder-ubuntu2204-sandbox-aarch64"
     prefix: "builder-ubuntu2204-sandbox-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 3a70830..0af88c9 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:sandbox-x86_64"
     labels: "builder-ubuntu2204-sandbox-x86_64"
     prefix: "builder-ubuntu2204-sandbox-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 80a9093..9f0df64 100644 (file)
@@ -10,3 +10,4 @@ templates:
     image: "fdiotools/builder-ubuntu2004:prod-aarch64"
     labels: "csit-builder-ubuntu2004-prod-aarch64"
     prefix: "csit-builder-ubuntu2004-prod-aarch64"
+    hostVolumes: "/scratch/nomad:/scratch/nomad"
index e172415..02b1dc4 100644 (file)
@@ -10,3 +10,4 @@ templates:
     image: "fdiotools/builder-ubuntu2004:prod-x86_64"
     labels: "csit-builder-ubuntu2004-prod-x86_64"
     prefix: "csit-builder-ubuntu2004-prod-x86_64"
+    hostVolumes: "/scratch/nomad:/scratch/nomad"
index d2f5077..f982bd5 100644 (file)
@@ -10,3 +10,4 @@ templates:
     image: "fdiotools/builder-ubuntu2004:sandbox-aarch64"
     labels: "csit-builder-ubuntu2004-sandbox-aarch64"
     prefix: "csit-builder-ubuntu2004-sandbox-aarch64"
+    hostVolumes: "/scratch/nomad:/scratch/nomad"
index a68b2f1..3182a09 100644 (file)
@@ -10,3 +10,4 @@ templates:
     image: "fdiotools/builder-ubuntu2004:sandbox-x86_64"
     labels: "csit-builder-ubuntu2004-sandbox-x86_64"
     prefix: "csit-builder-ubuntu2004-sandbox-x86_64"
+    hostVolumes: "/scratch/nomad:/scratch/nomad"
index 4b43d6b..0967381 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:prod-aarch64"
     labels: "csit-builder-ubuntu2204-prod-aarch64"
     prefix: "csit-builder-ubuntu2204-prod-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 07e4bbc..84764a1 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:prod-x86_64"
     labels: "csit-builder-ubuntu2204-prod-x86_64"
     prefix: "csit-builder-ubuntu2204-prod-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 0f3d12b..628bea3 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:sandbox-aarch64"
     labels: "csit-builder-ubuntu2204-sandbox-aarch64"
     prefix: "csit-builder-ubuntu2204-sandbox-aarch64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 1109b8c..0de454f 100644 (file)
@@ -10,4 +10,6 @@ templates:
     image: "fdiotools/builder-ubuntu2204:sandbox-x86_64"
     labels: "csit-builder-ubuntu2204-sandbox-x86_64"
     prefix: "csit-builder-ubuntu2204-sandbox-x86_64"
-    hostVolumes: "/tmp/ccache.ubuntu2204:/scratch/ccache"
+    hostVolumes:
+      - "/tmp/ccache.ubuntu2204:/scratch/ccache"
+      - "/scratch/nomad:/scratch/nomad"
index 4d3cb6e..7278249 100755 (executable)
@@ -25,12 +25,22 @@ file_delimiter="----- %< -----"
 long_line="************************************************************************"
 downloads_cache="/root/Downloads"
 
+# Requires all nomad client machines to run the following command
+# and mount /scratch/nomad into the docker container:
+# sudo mkdir -p /scratch/nomad && echo "$(hostname)-$(uname -m)" | sudo tee /scratch/nomad/nomad-client
+nomad_client_file="/scratch/nomad/nomad-client"
+if [ -f "$nomad_client_file" ] ; then
+    NOMAD_CLIENT="$(cat $nomad_client_file)"
+else
+    NOMAD_CLIENT="Unknown"
+fi
+
 # Node info
 echo "$long_line"
 echo "Executor Runtime Attributes:"
 echo "OS: $OS_ID-$OS_VERSION_ID"
 echo "Arch: $OS_ARCH"
-echo "Nomad Hostname: $(grep search /etc/resolv.conf | cut -d' ' -f2 | head -1)"
+echo "Nomad Client Hostname: $NOMAD_CLIENT"
 echo "Container ID: $(hostname)"
 
 echo "$long_line"