diff --git a/docker/all/Dockerfile b/docker/all/Dockerfile index 140a74415089e72d877fbee1f99dcb9a08637e41..af6c197a1f282876462c826982706c155b8531dc 100644 --- a/docker/all/Dockerfile +++ b/docker/all/Dockerfile @@ -11,6 +11,9 @@ ADD build.sh build.py / ADD dist/${DIST}.sh /dist.sh RUN bash /dist.sh +ARG PARALLEL=1 +ENV CTEST_PARALLEL_LEVEL=${PARALLEL} + ADD https://api.github.com/repos/nim65s/eigenpy/commits/topic/multipy2 / RUN /build.sh eigenpy diff --git a/docker/all/all.py b/docker/all/all.py index 40404049d7cbf3ed03aa6644e514acb6d2c77345..0bc1073f4697df8a7879b01919eb4bffe2bbf79a 100755 --- a/docker/all/all.py +++ b/docker/all/all.py @@ -4,21 +4,26 @@ Build all Dockerfiles and check the build result """ import asyncio -from asyncio.subprocess import PIPE, DEVNULL +import sys +from asyncio.subprocess import DEVNULL, PIPE DISTRIBUTIONS = '16.04 18.04 20.04 fedora28 fedora31 archlinux stretch buster centos7'.split() -async def build_run(dist): +async def build_run(dist, verbose=False, parallel=1): """Build and run a dockerfile.""" - cmd = f'docker build --build-arg DIST={dist} -t all/{dist} .'.split() - proc = await asyncio.create_subprocess_exec(*cmd, stdout=DEVNULL, stderr=DEVNULL) + cmd = f'docker build --build-arg DIST={dist} --build-arg PARALLEL={parallel} -t all/{dist} .' + if verbose: + print(f'+ {cmd}\r') + proc = await asyncio.create_subprocess_exec(*cmd.split(), stdout=DEVNULL, stderr=DEVNULL) await proc.wait() if proc.returncode != 0: print(f'{dist:10} build failed\r') return - cmd = f'docker run --rm -it all/{dist}'.split() - proc = await asyncio.create_subprocess_exec(*cmd, stdout=PIPE, stderr=DEVNULL) + cmd = f'docker run --rm -it all/{dist}' + if verbose: + print(f'+ {cmd}\r') + proc = await asyncio.create_subprocess_exec(*cmd.split(), stdout=PIPE, stderr=DEVNULL) stdout, _ = await proc.communicate() stdout = stdout.decode().replace('\r\n', ' ') if proc.returncode == 0: @@ -29,5 +34,8 @@ async def build_run(dist): if __name__ == '__main__': loop = asyncio.get_event_loop() - loop.run_until_complete(asyncio.gather(*(build_run(dist) for dist in DISTRIBUTIONS))) + if len(sys.argv) > 1: + loop.run_until_complete(build_run(sys.argv[1], verbose=True, parallel=8)) + else: + loop.run_until_complete(asyncio.gather(*(build_run(dist) for dist in DISTRIBUTIONS))) loop.close() diff --git a/docker/all/build.sh b/docker/all/build.sh index ba7775f48b90697539875d8fda483fef78c8f451..438753b317343fe1f93ea6849fa78355ab06b771 100755 --- a/docker/all/build.sh +++ b/docker/all/build.sh @@ -3,7 +3,6 @@ source /dist export PROJECT=$1 -export CTEST_PARALLEL_LEVEL=${2:-1} DO_TEST=true if [ "$PROJECT" = "hpp-fcl" ] diff --git a/docker/all/dist/centos7.sh b/docker/all/dist/centos7.sh index 8b5cdd816b1d8c3f47be75166d7865619b04bc7f..28befa6be90e881f84d8ef9e04b912c7910ba43e 100644 --- a/docker/all/dist/centos7.sh +++ b/docker/all/dist/centos7.sh @@ -1,6 +1,6 @@ #!/bin/bash -eux -BOOST_VERSION="1_72_0" +BOOST_VERSION="1_74_0" yum install -q -y which wget yum erase -q -y boost-libs boost-devel boost-python36-devel python2-numpy numpy diff --git a/docker/all/run.sh b/docker/all/run.sh index 9e75297177b9c9e2fb2da8207d63aa4fb8d7917b..9d09b5bc5ddd5df957ebc84a4a4b37f3b9c7f304 100755 --- a/docker/all/run.sh +++ b/docker/all/run.sh @@ -5,6 +5,9 @@ source /dist if [ "$DIST" = "archlinux" ] then echo /opt/openrobots/lib/python2.7/site-packages/ > /usr/lib/python2.7/site-packages/robotpkg.pth fi +if [ "$DIST" = "centos7" ] +then export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} +fi if [ "$DIST" != "20.04" ] then python2 /run.py