summaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-04-04 13:55:18 -0400
committerChris Evich <cevich@redhat.com>2019-05-02 15:03:15 -0400
commit3ab67b9c30cf413c2b40f4b636418fec475c434a (patch)
tree18f158ae04ca9fd4b97a272307d4ab76a1c6bf99 /contrib/cirrus
parentccf28a89bdded86b044f2fd3aa3389b923a81988 (diff)
downloadpodman-3ab67b9c30cf413c2b40f4b636418fec475c434a.tar.gz
podman-3ab67b9c30cf413c2b40f4b636418fec475c434a.tar.bz2
podman-3ab67b9c30cf413c2b40f4b636418fec475c434a.zip
Cirrus: timestamp all output script output
Also remove direct time-stamping by CI scripts that would compete. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rwxr-xr-xcontrib/cirrus/build_vm_images.sh4
-rwxr-xr-xcontrib/cirrus/integration_test.sh8
-rw-r--r--contrib/cirrus/lib.sh14
-rwxr-xr-xcontrib/cirrus/rootless_test.sh4
-rwxr-xr-xcontrib/cirrus/setup_environment.sh4
-rw-r--r--contrib/cirrus/timestamp.awk20
-rwxr-xr-xcontrib/cirrus/unit_test.sh4
7 files changed, 20 insertions, 38 deletions
diff --git a/contrib/cirrus/build_vm_images.sh b/contrib/cirrus/build_vm_images.sh
index fc8cbb404..43eb3c057 100755
--- a/contrib/cirrus/build_vm_images.sh
+++ b/contrib/cirrus/build_vm_images.sh
@@ -5,8 +5,6 @@ source $(dirname $0)/lib.sh
req_env_var CNI_COMMIT CRIO_COMMIT RUNC_COMMIT PACKER_BUILDS BUILT_IMAGE_SUFFIX CENTOS_BASE_IMAGE UBUNTU_BASE_IMAGE FEDORA_BASE_IMAGE FAH_BASE_IMAGE RHEL_BASE_IMAGE RHSM_COMMAND SERVICE_ACCOUNT GCE_SSH_USERNAME GCP_PROJECT_ID PACKER_VER SCRIPT_BASE PACKER_BASE
-record_timestamp "cache-image build start"
-
show_env_vars
# Everything here is running on the 'image-builder-image' GCE image
@@ -43,8 +41,6 @@ make libpod_images \
POST_MERGE_BUCKET_SUFFIX=$POST_MERGE_BUCKET_SUFFIX \
BUILT_IMAGE_SUFFIX=$BUILT_IMAGE_SUFFIX
-record_timestamp "cache-image build end"
-
# When successful, upload manifest of produced images using a filename unique
# to this build.
URI="gs://packer-import${POST_MERGE_BUCKET_SUFFIX}/manifest${BUILT_IMAGE_SUFFIX}.json"
diff --git a/contrib/cirrus/integration_test.sh b/contrib/cirrus/integration_test.sh
index 71223803c..5b73f0c6c 100755
--- a/contrib/cirrus/integration_test.sh
+++ b/contrib/cirrus/integration_test.sh
@@ -5,14 +5,6 @@ source $(dirname $0)/lib.sh
req_env_var GOSRC SCRIPT_BASE OS_RELEASE_ID OS_RELEASE_VER CONTAINER_RUNTIME
-exit_handler() {
- set +ex
- record_timestamp "integration test end"
-}
-trap exit_handler EXIT
-
-record_timestamp "integration test start"
-
cd "$GOSRC"
if [[ "$SPECIALMODE" == "in_podman" ]]
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 1c459ebc7..f422fe935 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -17,7 +17,6 @@ PACKER_BASE=${PACKER_BASE:-./contrib/cirrus/packer}
CIRRUS_BUILD_ID=${CIRRUS_BUILD_ID:-DEADBEEF} # a human
CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-HEAD}
CIRRUS_CHANGE_IN_REPO=${CIRRUS_CHANGE_IN_REPO:-FETCH_HEAD}
-TIMESTAMPS_FILEPATH="${TIMESTAMPS_FILEPATH:-/var/tmp/timestamps}"
SPECIALMODE="${SPECIALMODE:-none}"
export CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-podman}
@@ -153,16 +152,6 @@ ircmsg() {
set -e
}
-record_timestamp() {
- set +x # sometimes it's turned on
- req_env_var TIMESTAMPS_FILEPATH
- echo "." # cirrus webui strips blank-lines
- STAMPMSG="The $1 time at the tone will be:"
- echo -e "$STAMPMSG\t$(date --iso-8601=seconds)" | \
- tee -a $TIMESTAMPS_FILEPATH
- echo -e "BLEEEEEEEEEEP!\n."
-}
-
setup_rootless() {
req_env_var ROOTLESS_USER GOSRC ENVLIB
@@ -203,9 +192,6 @@ setup_rootless() {
echo "${ROOTLESS_USER}:$[ROOTLESS_UID * 100]:65536" | \
tee -a /etc/subuid >> /etc/subgid
- echo "Setting permissions on automation files"
- chmod 666 "$TIMESTAMPS_FILEPATH"
-
echo "Copying $HOME/$ENVLIB"
install -o $ROOTLESS_USER -g $ROOTLESS_USER -m 0700 \
"$HOME/$ENVLIB" "/home/$ROOTLESS_USER/$ENVLIB"
diff --git a/contrib/cirrus/rootless_test.sh b/contrib/cirrus/rootless_test.sh
index 2803d4318..8351214f3 100755
--- a/contrib/cirrus/rootless_test.sh
+++ b/contrib/cirrus/rootless_test.sh
@@ -19,13 +19,9 @@ export PODMAN_VARLINK_ADDRESS=unix:/tmp/podman-$(id -u)
echo "."
echo "Hello, my name is $USER and I live in $PWD can I be your friend?"
-record_timestamp "rootless test start"
-
cd "$GOSRC"
make
make varlink_generate
make test-binaries
make ginkgo
make ginkgo-remote
-
-record_timestamp "rootless test end"
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index 3bc6c2290..2f9b1d796 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -4,8 +4,6 @@ set -e
source $(dirname $0)/lib.sh
-record_timestamp "env. setup start"
-
req_env_var USER HOME ENVLIB SCRIPT_BASE CIRRUS_BUILD_ID
[[ "$SHELL" =~ "bash" ]] || chsh -s /bin/bash
@@ -86,5 +84,3 @@ then
fi
show_env_vars
-
-record_timestamp "env. setup end"
diff --git a/contrib/cirrus/timestamp.awk b/contrib/cirrus/timestamp.awk
new file mode 100644
index 000000000..95b312e51
--- /dev/null
+++ b/contrib/cirrus/timestamp.awk
@@ -0,0 +1,20 @@
+
+
+# This script is intended to be piped into by automation, in order to
+# mark output lines with timing information. For example:
+# /path/to/command |& awk --file timestamp.awk
+
+BEGIN {
+ STARTTIME=systime()
+ printf "[%s] START", strftime("%T")
+ printf " - All [+xxxx] lines that follow are relative to right now.\n"
+}
+
+{
+ printf "[%+05ds] %s\n", systime()-STARTTIME, $0
+}
+
+END {
+ printf "[%s] END", strftime("%T")
+ printf " - [%+05ds] total duration since START\n", systime()-STARTTIME
+}
diff --git a/contrib/cirrus/unit_test.sh b/contrib/cirrus/unit_test.sh
index a0964061f..0e8c9e2e2 100755
--- a/contrib/cirrus/unit_test.sh
+++ b/contrib/cirrus/unit_test.sh
@@ -5,8 +5,6 @@ source $(dirname $0)/lib.sh
req_env_var GOSRC OS_RELEASE_ID OS_RELEASE_VER
-record_timestamp "unit test start"
-
clean_env
set -x
@@ -14,5 +12,3 @@ cd "$GOSRC"
make install.tools
make localunit
make
-
-record_timestamp "unit test end"