3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 echo "---> jjb/scripts/post_build_executor_info.sh"
18 # Output executor runtime attributes [again] in case the job fails prior to
19 # running setup_executor_env.sh
20 long_line="************************************************************************"
21 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
22 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
25 # Requires all nomad client machines to run the following command
26 # and mount /scratch/nomad into the docker container:
27 # sudo mkdir -p /scratch/nomad && echo "$(hostname)-$(uname -m)" | sudo tee /scratch/nomad/nomad-client
28 nomad_client_file="/scratch/nomad/nomad-client"
29 if [ -f "$nomad_client_file" ] ; then
30 NOMAD_CLIENT="$(cat $nomad_client_file)"
32 NOMAD_CLIENT="Unknown"
36 echo "Executor Runtime Attributes:"
37 echo "OS: $OS_ID-$OS_VERSION_ID"
39 echo "Number CPUs: $(nproc)"
41 echo "Nomad Client Hostname: $NOMAD_CLIENT"
42 echo "Container ID: $(hostname)"
44 echo -e "lscpu:\n$(lscpu)"
46 echo -e "df -h:\n$(df -h)"
48 echo -e "free -m:\n$(free -m)"
50 if [ -n "$(which ccache)" ] ; then
52 echo "ccache statistics:"
53 [ -n "${CCACHE_DISABLE:-}" ] && echo "CCACHE_DISABLE = '$CCACHE_DISABLE'"
54 [ -n "${CCACHE_DIR:-}" ] && echo "CCACHE_DIR = '$CCACHE_DIR'"