diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2021-03-03 09:50:20 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2021-03-03 10:03:57 +0000 |
commit | 32b38c48213a52218385b85a5b6162e3763c0fd5 (patch) | |
tree | 7e8d2a91b86c329f37a34145199c0a0a7cf6d367 /tcwg-benchmark-bare.sh | |
parent | e7cdaad318b4ef5f2760f0142a977488712192b2 (diff) |
tcwg-benchmark-bare.sh: Fix toolchain copy via rsync
Change-Id: I4331cededc199656e0e8f0981073f6ea1af61ef8
Diffstat (limited to 'tcwg-benchmark-bare.sh')
-rwxr-xr-x | tcwg-benchmark-bare.sh | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tcwg-benchmark-bare.sh b/tcwg-benchmark-bare.sh index dc6fea3c..878eabe3 100755 --- a/tcwg-benchmark-bare.sh +++ b/tcwg-benchmark-bare.sh @@ -94,6 +94,21 @@ case "$toolchain_url" in ;; "rsync://"*) ccprefix="${toolchain_url##rsync://}" + + # Extract host:port: specification from ccprefix, we don't + # need to care about :parallelize here, just pass it to run.sh + # if present. + rsync_spec=${ccprefix%:*} + rsync_host="$(echo $rsync_spec | cut -d: -f 1)" + case ${ccprefix} in + *:*:*) + rsync_port="$(echo $rsync_spec | cut -s -d: -f 2)" + ;; + *:*) + # If no port is specified, use 22 (ssh default port) + rsync_port=22 + ;; + esac # We want to access the remote toolchain via a container, to # avoid problems with the hosts's ssh server restrictions on the # number of simulaneous connexions. @@ -101,9 +116,9 @@ case "$toolchain_url" in # architecture as the machine pointed to by $toolchain_url). # Assume ccprefix looks like /path/bin/target-triplet-, and # compute 'path'. - src_toolchaindir=$(dirname "$(dirname ${ccprefix})") + src_toolchaindir=$(dirname "$(dirname ${ccprefix##*:})") toolchaindir="${WORKSPACE}/toolchain-${BUILD_NUMBER}" - rsync -az --delete "$src_toolchaindir/" "$toolchaindir/" + rsync -az --delete -e "ssh -p$rsync_port" "$rsync_host:$src_toolchaindir/" "$toolchaindir/" ;; *) echo "ERROR: Cannot handle toolchain_url: $toolchain_url" @@ -158,16 +173,13 @@ case "$toolchain_url" in exit 1 fi - # Non-ssh:// cases have to copy the just-copied toolchain to - # the remote build container. For ssh://, we'll access the - # toolchain remotely. + # No need to copy the toolchain to the build container: it + # runs on the local machine and has access to $toolchaindir. + # FIXME: ssh:// access is currently broken. case "$toolchain_url" in "ssh://"*) ;; *) ccprefix=$(echo "$ccpath" | sed -e "s/$ccname\$//") - # Copy toolchain to the build container. - rsync -a --delete -e "ssh -p$build_container_port" "$toolchaindir/" "$build_container_host:$toolchaindir/" - # We share the filesystem with build and run containers ccprefix="$build_container_host:$build_container_port:$ccprefix" ;; esac ;; |