-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from mithro/add-kokoro
Add kokoro configuration
- Loading branch information
Showing
7 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Check the SCRIPT_XXX values are set. | ||
if [ -z "${SCRIPT_SRC}" ]; then | ||
echo 'Parent script must do SCRIPT_SRC="$(realpath ${BASH_SOURCE[0]})"' | ||
exit 1 | ||
fi | ||
if [ -z "${SCRIPT_DIR}" ]; then | ||
echo 'Parent script must do SCRIPT_DIR="$(dirname "${SCRIPT_SRC}")"' | ||
exit 1 | ||
fi | ||
|
||
# Check the KOKORO environment variables are correct | ||
if [ -z "$KOKORO_DIR" ]; then | ||
echo "$$KOKORO_DIR environment variable is missing ('$KOKORO_DIR')!" | ||
exit 1 | ||
fi | ||
|
||
# Close STDERR FD | ||
exec 2<&- | ||
# Redirect STDERR to STDOUT | ||
exec 2>&1 | ||
|
||
# Get us into the github checkout source directory. | ||
cd github/$KOKORO_DIR/ | ||
|
||
# Run the common setup steps | ||
source ./.github/kokoro/steps/hostsetup.sh | ||
source ./.github/kokoro/steps/hostinfo.sh | ||
source ./.github/kokoro/steps/git.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
build_file: "fpga-tool-perf/.github/kokoro/test.sh" | ||
|
||
timeout_mins: 4320 | ||
|
||
env_vars { | ||
key: "KOKORO_TYPE" | ||
value: "continuous" | ||
} | ||
|
||
env_vars { | ||
key: "KOKORO_DIR" | ||
value: "fpga-tool-perf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
build_file: "fpga-tool-perf/.github/kokoro/test.sh" | ||
|
||
timeout_mins: 4320 | ||
|
||
env_vars { | ||
key: "KOKORO_TYPE" | ||
value: "presubmit" | ||
} | ||
|
||
env_vars { | ||
key: "KOKORO_DIR" | ||
value: "fpga-tool-perf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo | ||
echo "========================================" | ||
echo "Git log" | ||
echo "----------------------------------------" | ||
git log -n5 --stat | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Git fetching tags" | ||
echo "----------------------------------------" | ||
# Don't fail if there are no tags | ||
git fetch --tags || true | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Git version info" | ||
echo "----------------------------------------" | ||
git log -n1 | ||
echo "----------------------------------------" | ||
git describe --tags || true | ||
echo "----------------------------------------" | ||
git describe --tags --always || true | ||
echo "----------------------------------------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo | ||
echo "========================================" | ||
echo "Host Environment" | ||
echo "----------------------------------------" | ||
export | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Host CPU" | ||
echo "----------------------------------------" | ||
export CORES=$(nproc --all) | ||
echo "Cores: $CORES" | ||
echo | ||
echo "Memory" | ||
echo "----------------------------------------" | ||
cat /proc/meminfo | ||
echo "----------------------------------------" | ||
export MEM_GB=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo)/(1024*1024))) | ||
echo "Total Memory (GB): $MEM_GB" | ||
export MEM_PER_RUN=16 | ||
export MEM_CORES=$(($MEM_GB/$MEM_PER_RUN)) | ||
echo "Simultaneous runs ($MEM_PER_RUN GB each): $MEM_CORES" | ||
export MAX_CORES_NO_MIN=$(($MEM_CORES>$CORES?$CORES:$MEM_CORES)) | ||
export MAX_CORES=$(($MAX_CORES_NO_MIN<1?1:$MAX_CORES_NO_MIN)) | ||
echo "Max cores: $MAX_CORES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo | ||
echo "========================================" | ||
echo "Removing older packages" | ||
echo "----------------------------------------" | ||
sudo apt-get remove -y cmake | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Host adding PPAs" | ||
echo "----------------------------------------" | ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - | ||
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Host updating packages" | ||
echo "----------------------------------------" | ||
sudo apt-get update | ||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Host remove packages" | ||
echo "----------------------------------------" | ||
sudo apt-get remove -y \ | ||
python-pytest \ | ||
|
||
|
||
sudo apt-get autoremove -y | ||
|
||
echo "----------------------------------------" | ||
echo | ||
echo "========================================" | ||
echo "Host install packages" | ||
echo "----------------------------------------" | ||
sudo apt-get install -y \ | ||
bash \ | ||
bison \ | ||
build-essential \ | ||
ca-certificates \ | ||
clang-format \ | ||
cmake \ | ||
colordiff \ | ||
coreutils \ | ||
curl \ | ||
flex \ | ||
git \ | ||
graphviz \ | ||
inkscape \ | ||
jq \ | ||
make \ | ||
nodejs \ | ||
psmisc \ | ||
python \ | ||
python3 \ | ||
python3-dev \ | ||
python3-virtualenv \ | ||
python3-yaml \ | ||
virtualenv \ | ||
|
||
if [ -z "${BUILD_TOOL}" ]; then | ||
export BUILD_TOOL=make | ||
fi | ||
|
||
echo "----------------------------------------" | ||
|
||
echo | ||
echo "========================================" | ||
echo "Setting up environment env" | ||
echo "----------------------------------------" | ||
( | ||
echo | ||
echo " Configuring virtual environment" | ||
echo "----------------------------------------" | ||
make env | ||
echo "----------------------------------------" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd github/$KOKORO_DIR/ | ||
|
||
source ./.github/kokoro/steps/hostsetup.sh | ||
source ./.github/kokoro/steps/hostinfo.sh | ||
source ./.github/kokoro/steps/git.sh | ||
|
||
echo | ||
echo "===========================================" | ||
echo "Running FPGA perf tool tests (make run-all)" | ||
echo "-------------------------------------------" | ||
( | ||
make run-all | ||
) | ||
echo "-------------------------------------------" |