diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2017-05-30 12:34:04 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-06-16 13:57:09 +0000 |
commit | 7d2a10c1f08cb61454354686c2847be9dfff2faa (patch) | |
tree | 27843e071bf0f048bc569aaa28cebe1e1a7ffd2e /tcwg-benchmark.sh | |
parent | 0fe9cc1b2b267d5257adc2e8a2a850741badd10c (diff) |
tcwg-benchmark.sh: Add rsync:// url type for toolchain.
When toolchain_url is provided as ssh://*, multiple direct connexions
to the remote machine may fail because the limit on the number of
simulaneous ssh connexions is too low. To avoid this problem, we add
a new rsync:// url type, using the local build container (which has a
suitable sshd configuration), assuming it uses the same architecture
as the machine pointed to by $toolchain_url.
It's easier to copy the remote toolchain into it, since users' home
dirs are not bind-mounted in containers, so creating a remote build
container is not practical as it likely wouldn't have access to the
toolchain anyway, meaning another copy would be needed.
Change-Id: I541a4281123ed7b4654dfb705678dfea5d9dfa59
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-x | tcwg-benchmark.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index a24466ff..059f9cf1 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -55,6 +55,28 @@ case "$toolchain_url" in tarball="$(ls $(basename "$toolchain_url"))" tar xf "${tarball}" toolchaindir="$WORKSPACE/$(echo "${tarball}" | sed 's/.tar.xz//')" + ;; + "rsync://"*) + ccprefix="${toolchain_url##rsync://}" + # 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. + # We copy it to the build container (assuming it uses the same + # 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})) + toolchaindir="${WORKSPACE}/toolchain-${BUILD_NUMBER}" + rsync -az --delete "$src_toolchaindir/" "$toolchaindir/" + ;; + *) + echo "ERROR: Cannot handle toolchain_url: $toolchain_url" + exit 1 + ;; +esac + +case "$toolchain_url" in + "http://"*|"https://"*|"rsync://"*) ccpath=$(find "$toolchaindir" -name "*-gcc") ccprefix=$(echo "$ccpath" | sed -e 's/-gcc$/-/') # Copy toolchain to the build container. @@ -64,10 +86,6 @@ case "$toolchain_url" in sysroot="$build_container_host:$(find "$toolchaindir" -name "libc")" fi ;; - *) - echo "ERROR: Cannot handle toolchain_url: $toolchain_url" - exit 1 - ;; esac # Slaves for this job are virtual slaves on dev-01, |