From d19329eb4daf8483233eab0d552bc49c8312f6ee Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Thu, 19 May 2022 03:20:41 +0200 Subject: [PATCH 1/3] ci: print packages' timestamp in job 'install' Signed-off-by: Unai Martinez-Corral --- .github/ci/install.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/ci/install.sh b/.github/ci/install.sh index c502042ba8..a9bdd41940 100755 --- a/.github/ci/install.sh +++ b/.github/ci/install.sh @@ -67,14 +67,12 @@ GCP_PATH=symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/ heading "Uploading packages" ( - if [ "$UPLOAD_PACKAGES" = "true" ]; then - TIMESTAMP=$(date +'%Y%m%d-%H%M%S') - for package in $(ls *.tar.xz) - do - gsutil cp ${package} gs://${GCP_PATH}/${TIMESTAMP}/ - done - else + if [ "$UPLOAD_PACKAGES" != "true" ]; then echo "Not uploading packages as not requested by the CI" + exit 0 fi + TIMESTAMP=$(date +'%Y%m%d-%H%M%S') + echo "> Timestamp: $TIMESTAMP" + for package in $(ls *.tar.xz); do gsutil cp ${package} gs://${GCP_PATH}/${TIMESTAMP}/; done ) echo "----------------------------------------" From 7b6109cc4998051368b75b607cadc741c4f369d3 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Thu, 19 May 2022 03:27:43 +0200 Subject: [PATCH 2/3] ci/scripts/install: format Signed-off-by: Unai Martinez-Corral --- .github/ci/install.sh | 68 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/ci/install.sh b/.github/ci/install.sh index a9bdd41940..46d28393c2 100755 --- a/.github/ci/install.sh +++ b/.github/ci/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash INSTALL_DIR="$(pwd)/install" mkdir -p $INSTALL_DIR @@ -8,18 +8,18 @@ source $(dirname "$0")/setup-and-activate.sh heading "Installing gsutil" ( - apt -qqy update && apt -qqy install curl - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - - apt -qqy update && apt -qqy install google-cloud-cli + apt -qqy update && apt -qqy install curl + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - + apt -qqy update && apt -qqy install google-cloud-cli ) echo "----------------------------------------" heading "Set environment variables for F4PGA CLI utils" { - export F4PGA_FAM=xc7 - export F4PGA_ENV_BIN="$(cd $(dirname "$0"); pwd)/../../env/conda/envs/symbiflow_arch_def_base/bin" - export F4PGA_ENV_SHARE="$(cd $(dirname "$0"); pwd)/../../install/share/symbiflow" + export F4PGA_FAM=xc7 + export F4PGA_ENV_BIN="$(cd $(dirname "$0"); pwd)/../../env/conda/envs/symbiflow_arch_def_base/bin" + export F4PGA_ENV_SHARE="$(cd $(dirname "$0"); pwd)/../../install/share/symbiflow" } echo "----------------------------------------" @@ -34,32 +34,32 @@ echo "----------------------------------------" heading "Running installed toolchain tests" ( - pushd build - export VPR_NUM_WORKERS=${MAX_CORES} - export CTEST_OUTPUT_ON_FAILURE=1 - ctest -R binary_toolchain_test_xc7* -j${MAX_CORES} - popd + pushd build + export VPR_NUM_WORKERS=${MAX_CORES} + export CTEST_OUTPUT_ON_FAILURE=1 + ctest -R binary_toolchain_test_xc7* -j${MAX_CORES} + popd ) echo "----------------------------------------" heading "Compressing install dir (creating packages)" ( - rm -rf build + rm -rf build - # Remove symbolic links and copy content of the linked files - for file in $(find install -type l) - do cp --remove-destination $(readlink $file) $file - done + # Remove symbolic links and copy content of the linked files + for file in $(find install -type l) + do cp --remove-destination $(readlink $file) $file + done - du -ah install - export GIT_HASH=$(git rev-parse --short HEAD) - tar -I "pixz" -cvf symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install share/symbiflow/techmaps share/symbiflow/scripts environment.yml - tar -I "pixz" -cvf symbiflow-arch-defs-benchmarks-${GIT_HASH}.tar.xz -C install benchmarks - for device in $(ls install/share/symbiflow/arch) - do - tar -I "pixz" -cvf symbiflow-arch-defs-$device-${GIT_HASH}.tar.xz -C install share/symbiflow/arch/$device - done - rm -rf install + du -ah install + export GIT_HASH=$(git rev-parse --short HEAD) + tar -I "pixz" -cvf symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install share/symbiflow/techmaps share/symbiflow/scripts environment.yml + tar -I "pixz" -cvf symbiflow-arch-defs-benchmarks-${GIT_HASH}.tar.xz -C install benchmarks + for device in $(ls install/share/symbiflow/arch) + do + tar -I "pixz" -cvf symbiflow-arch-defs-$device-${GIT_HASH}.tar.xz -C install share/symbiflow/arch/$device + done + rm -rf install ) echo "----------------------------------------" @@ -67,12 +67,12 @@ GCP_PATH=symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/ heading "Uploading packages" ( - if [ "$UPLOAD_PACKAGES" != "true" ]; then - echo "Not uploading packages as not requested by the CI" - exit 0 - fi - TIMESTAMP=$(date +'%Y%m%d-%H%M%S') - echo "> Timestamp: $TIMESTAMP" - for package in $(ls *.tar.xz); do gsutil cp ${package} gs://${GCP_PATH}/${TIMESTAMP}/; done + if [ "$UPLOAD_PACKAGES" != "true" ]; then + echo "Not uploading packages as not requested by the CI" + exit 0 + fi + TIMESTAMP=$(date +'%Y%m%d-%H%M%S') + echo "> Timestamp: $TIMESTAMP" + for package in $(ls *.tar.xz); do gsutil cp ${package} gs://${GCP_PATH}/${TIMESTAMP}/; done ) echo "----------------------------------------" From e3f409f84cfdd95f247eeb7287702eb5fac12f0e Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Fri, 20 May 2022 16:41:20 +0200 Subject: [PATCH 3/3] ci/install: print timestamp and hash as step summary content Signed-off-by: Unai Martinez-Corral --- .github/ci/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ci/install.sh b/.github/ci/install.sh index 46d28393c2..6bd55c6d48 100755 --- a/.github/ci/install.sh +++ b/.github/ci/install.sh @@ -73,6 +73,10 @@ heading "Uploading packages" fi TIMESTAMP=$(date +'%Y%m%d-%H%M%S') echo "> Timestamp: $TIMESTAMP" + + echo 'Timestamp: $TIMESTAMP' >> $GITHUB_STEP_SUMMARY + echo 'Hash: '"$(echo ${package} | sed 's/.*-\(.*\)\.tar\.xz/\1/')" >> $GITHUB_STEP_SUMMARY + for package in $(ls *.tar.xz); do gsutil cp ${package} gs://${GCP_PATH}/${TIMESTAMP}/; done ) echo "----------------------------------------"