From 8d6cfd9fc1143e94978ce01025ef3a9c08bb1a11 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 27 Jan 2016 10:18:34 -0800 Subject: [PATCH 1/4] Add automatic build execution. --- .bashrc | 6 +++++- Makefile | 2 +- docker/tools/onlbuilder | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 8526d6d1..1bbf65dd 100644 --- a/.bashrc +++ b/.bashrc @@ -13,4 +13,8 @@ . setup.env -echo Ready to build OpenNetworkLinux. +if [ -n "$ONL_AUTOBUILD" ]; then + make all +else + echo Ready to build OpenNetworkLinux. +fi diff --git a/Makefile b/Makefile index 62d86c21..e59bd617 100644 --- a/Makefile +++ b/Makefile @@ -42,4 +42,4 @@ docker_check: @which docker > /dev/null || (echo "*** Docker appears to be missing. Please install docker.io in order to build OpenNetworkLinux." && exit 1) docker: docker_check - @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull + @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull --autobuild diff --git a/docker/tools/onlbuilder b/docker/tools/onlbuilder index 3cde708a..04ec4ae4 100755 --- a/docker/tools/onlbuilder +++ b/docker/tools/onlbuilder @@ -96,6 +96,10 @@ ap.add_argument("--volumes", metavar='DIRECTORY', default=[]) +ap.add_argument("--autobuild", + help="Automatic build in isolation mode.", + action='store_true') + ap.add_argument("--command", "-c", help="Explicit command to run. All arguments after -c are considered to be part of the command.", nargs=argparse.REMAINDER, @@ -171,6 +175,9 @@ else: if ops.hostname: g_docker_arguments += " -h %s" % ops.hostname + if ops.autobuild: + g_docker_arguments += " -e ONL_AUTOBUILD=1 " + else: # Development host mode g_docker_arguments += "-e USER=%(username)s --net host -w %(workdir)s " % g_arg_d From 65471b3a15502b74845013669a7c4eee9b37d484 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 27 Jan 2016 10:24:33 -0800 Subject: [PATCH 2/4] Make non-interactive. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e59bd617..07e150db 100644 --- a/Makefile +++ b/Makefile @@ -42,4 +42,4 @@ docker_check: @which docker > /dev/null || (echo "*** Docker appears to be missing. Please install docker.io in order to build OpenNetworkLinux." && exit 1) docker: docker_check - @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull --autobuild + @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull --autobuild --non-interactive From 4daf6ea0643f49310afced915201309e6d1249d1 Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Fri, 29 Jan 2016 11:14:38 -0800 Subject: [PATCH 3/4] Update Building.md Updated docker instructions for clarity --- docs/Building.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/Building.md b/docs/Building.md index 951dfee3..b8c91e80 100644 --- a/docs/Building.md +++ b/docs/Building.md @@ -12,29 +12,36 @@ ONL builds with Docker so the only requirements on the build system is: - docker # to grab the build workspace - binfmt-support # kernel support for ppc builds - About 40G of disk free space # to build all images +- At least 4G of ram and 4G of swap # compilation is memory intensive All of the testing is done with Debian, other Linux distributions may work, but we suggest using Debian 8. - # apt-get install lxc-docker binfmt-support + # apt-get install binfmt-support + then follow the instructions at: https://docs.docker.com/engine/installation/debian/ Build ONL Summary ------------------------------------------------------------ -The easiest way to build is to use the autobuild script: +The easiest way to build is to use the make docker command: #> git clone https://github.com/opencomputeproject/OpenNetworkLinux - #> tools/autobuild/build.sh + #> make docker This will build a Debian 7 based ONL from the master branch -To build a Debian 8 based ONL simply run: +To build a Debian 8 based ONL run: - #> tools/autobuild/build.sh -8 + #> git clone https://github.com/opencomputeproject/OpenNetworkLinux + #> cd OpenNetworkLinux + #> export VERSION=8 + #> make docker + If you would like to build by hand you can do the following: #> git clone https://github.com/opencomputeproject/OpenNetworkLinux #> cd OpenNetworkLinux - #> make docker # enter the docker workspace + #> docker/tools/onlbuilder (-8) # enter the docker workspace + #> source setup.env # pull in necessary environment variables #> make amd64 ppc # make onl for $platform (currently amd64 or powerpc) The resulting ONIE installers are in @@ -50,9 +57,6 @@ RELEASE/jessie/amd64/ONL-2.0.0_ONL-OS_2015-12-12.0252-ffce159_AMD64.swi Docker installer oneliner (for reference: see docker.com for details) - # apt-get install -y lxc-docker -or - # wget -qO- https://get.docker.com/ | sh From fc8d40d190c257187c31d46f5e109e5ad7ac2ee3 Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Fri, 29 Jan 2016 11:16:06 -0800 Subject: [PATCH 4/4] Update Building.md Added cd to OpenNetworkLinux for building with Docker Debian 7 image. --- docs/Building.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Building.md b/docs/Building.md index b8c91e80..abe095d7 100644 --- a/docs/Building.md +++ b/docs/Building.md @@ -24,6 +24,7 @@ Build ONL Summary The easiest way to build is to use the make docker command: #> git clone https://github.com/opencomputeproject/OpenNetworkLinux + #> cd OpenNetworkLinux #> make docker This will build a Debian 7 based ONL from the master branch