From 2f357e8496aad0d3ada92e4d9ba21a4dd4f1b927 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Wed, 15 Dec 2021 13:11:36 -0800 Subject: [PATCH] Adding connection to a Xilinx license server. Enables generation of database for larger Kintex parts. Signed-off-by: Tim 'mithro' Ansell --- .github/kokoro/continuous-db-kintex7.cfg | 9 +++ .github/kokoro/presubmit-db-kintex7.cfg | 9 +++ .github/kokoro/steps/hostsetup.sh | 1 + .github/kokoro/steps/xilinx.sh | 90 +++++++++++++++++++++++- 4 files changed, 108 insertions(+), 1 deletion(-) diff --git a/.github/kokoro/continuous-db-kintex7.cfg b/.github/kokoro/continuous-db-kintex7.cfg index 54a20113f..946d62f54 100644 --- a/.github/kokoro/continuous-db-kintex7.cfg +++ b/.github/kokoro/continuous-db-kintex7.cfg @@ -42,3 +42,12 @@ env_vars { key: "XRAY_BUILD_TYPE" value: "full" } + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 74045 + keyname: "foss-fpga-tools_xilinx-license" + } + } +} diff --git a/.github/kokoro/presubmit-db-kintex7.cfg b/.github/kokoro/presubmit-db-kintex7.cfg index 80539dbcc..5c948e5bc 100644 --- a/.github/kokoro/presubmit-db-kintex7.cfg +++ b/.github/kokoro/presubmit-db-kintex7.cfg @@ -42,3 +42,12 @@ env_vars { key: "XRAY_BUILD_TYPE" value: "full" } + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 74045 + keyname: "foss-fpga-tools_xilinx-license" + } + } +} diff --git a/.github/kokoro/steps/hostsetup.sh b/.github/kokoro/steps/hostsetup.sh index 64193d3d5..dc267b172 100755 --- a/.github/kokoro/steps/hostsetup.sh +++ b/.github/kokoro/steps/hostsetup.sh @@ -84,6 +84,7 @@ sudo apt-get install -y \ fontconfig \ git \ jq \ + lsb \ nodejs \ psmisc \ python3.8 \ diff --git a/.github/kokoro/steps/xilinx.sh b/.github/kokoro/steps/xilinx.sh index 599827b98..a4a80c2cb 100755 --- a/.github/kokoro/steps/xilinx.sh +++ b/.github/kokoro/steps/xilinx.sh @@ -7,9 +7,97 @@ # # SPDX-License-Identifier: ISC -# Fix up things related to Xilinx tool chain. +echo +echo "========================================" +echo "Xilinx proprietary toolchain setup." +echo "----------------------------------------" +echo +echo "Fix up the Xilinx configuration directory" +echo "----------------------------------------" ls -l ~/.Xilinx sudo chown -R $USER ~/.Xilinx export XILINX_LOCAL_USER_DATA=no +echo "----------------------------------------" + +echo +echo "Select Xilinx Vivado version" +echo "----------------------------------------" +( + set -e + cd /opt + if [ x"$XRAY_SETTINGS" = x"kintex7" ]; then + echo "Using Xilinx Vivado Design Edition for $XRAY_SETTINGS build." + echo + echo "Making /opt mount rw" + sudo mount -o remount,rw /opt + echo + echo "Replacing /opt/Xilinx link." + sudo rm -f Xilinx + sudo ln -s Xilinx-design Xilinx + ls -l Xilinx + echo + echo "Making /opt mount ro" + sudo mount -o remount,ro /opt + echo + else + echo "Using Xilinx Vivado WebPack Edition for $XRAY_SETTINGS build." + ls -l Xilinx + fi +) +echo "----------------------------------------" + + +echo +echo "List /opt directory" +echo "----------------------------------------" +ls -l /opt +echo "----------------------------------------" + +# Create a tunnel to the server which has the Xilinx licenses and port forward +# them. +echo +echo "Setting up license server tunnel" +echo "----------------------------------------" + +LICENSE_TUNNEL_KEY=$KOKORO_KEYSTORE_DIR/74045_foss-fpga-tools_xilinx-license +echo "SSH Key for license server tunnel should be found @ $LICENSE_TUNNEL_KEY" +ls -l $LICENSE_TUNNEL_KEY || true + +if [ -f $LICENSE_TUNNEL_KEY ]; then + echo + echo "Xilinx license server ssh key found, setting up tunnel" + + chmod 600 $LICENSE_TUNNEL_KEY + cat < ssh_config +Host xilinx-license + HostName 10.128.15.194 + User kokoro + IdentityFile $LICENSE_TUNNEL_KEY + StrictHostKeyChecking no + ExitOnForwardFailure yes + # SessionType none + LocalForward localhost:2100 172.18.0.3:2100 + LocalForward localhost:2101 172.18.0.3:2101 +EOF + echo "127.0.0.1 xlic.int" | sudo tee -a /etc/hosts + + export GIT_SSH_COMMAND="ssh -F $(pwd)/ssh_config -f -N" + ${GIT_SSH_COMMAND} xilinx-license + + ( + source /opt/Xilinx/Vivado/2017.2/settings64.sh + export PATH=/opt/Xilinx/Vivado/2017.2/bin/unwrapped/lnx64.o:$PATH + echo "-----" + lmutil lmstat -a -c 2100@localhost -i || true + echo "-----" + ) + + export XILINXD_LICENSE_FILE=2100@localhost + +else + echo + echo "**No** Xilinx license server ssh key found." +fi +echo "----------------------------------------"