f1e2c1529d1222a0793a30bc4997a65e6f6694c9 markd Wed Jan 22 07:40:55 2025 -0800 run docker as current user diff --git src/utils/qa/weeklybld/userAppsCompileInDocker src/utils/qa/weeklybld/userAppsCompileInDocker index 3b0b3b80013..8cf4e11a257 100755 --- src/utils/qa/weeklybld/userAppsCompileInDocker +++ src/utils/qa/weeklybld/userAppsCompileInDocker @@ -1,48 +1,50 @@ #!/bin/bash -e -## -# Compile userApps in Docker ### -usage="compileUserAppsInDocker [--shell] DESTDIR BINDIR kentdir +# Compile userApps in Docker. +### +usage="compileUserAppsInDocker [--shell] builddir + +Runs as current and tree should be checked out by that user. +The following directories are expected: + builddir/kent/ - clean checkout of tree + builddir/userApps/ - compiled output to this directory Options - --shell - start bash shell rather than start the build + --shell - start bash shell rather than runb the build, for debugging " -## set -beEu -o pipefail -username=qateam -groupname=genecats shell="no" if [[ $# -ge 1 && "$1" = "--shell" ]]; then shell=yes shift fi -if [[ $# -ne 3 ]]; then +if [[ $# -ne 1 ]]; then echo "Wrong # of args: ${usage}" >&2 exit 1 fi -DESTDIR="$1" ; shift -BINDIR="$1" ; shift -kentdir="$1" ; shift +builddir="$1" + +# location in VM +MACHTYPE=$(uname -m) +vmbuilddir=/home/builddir +DESTDIR=${vmbuilddir}/userApps/ # must end in slash +BINDIR=linux.$MACHTYPE makecmd="make -O -j 64 userApps SEMI_STATIC=yes DESTDIR=${DESTDIR} BINDIR=${BINDIR}" if [[ ${shell} = "yes" ]] ; then cmd='bash' args="-it" echo "Starting shell for debugging" >&2 echo " make command that would be run is: ${makecmd}" >&2 else cmd=${makecmd} args="" fi -# SEMI_STATIC=yes enables linking as many libraries as possible as static -docker run --user=${username}:${groupname} \ - --volume=$(realpath ${kentdir}):/home/kent \ - --workdir=/home/kent/src --rm=true ${args} \ +docker run --user=$(id -u):$(id --g) \ + --volume=$(realpath ${builddir}):${vmbuilddir} \ + --workdir=/home/builddir/kent/src --rm=true ${args} \ user-apps-build ${cmd} - - -# --env="SEMI_STATIC=yes" --env="DESTDIR=${DESTDIR}" --env="BINDIR=${BINDIR}"