From 41048f09b545b34ff1ed398b1dd76aad48a98718 Mon Sep 17 00:00:00 2001 From: "Stefan K. Berg" Date: Thu, 12 Feb 2015 12:12:34 +0100 Subject: Simplification and cleanup of build process Docker build image: - Uplift of the base Ubuntu version to 14.04. - Instead of building the Ubuntu image with debootstrap, we use the official Docker repository version of Ubuntu. - Cleanup of the way how runcontext operates - Fix: Make sure that the build system can be run as root Top Makefile: - Building the Fuel ISO on Docker local /tmp directory not to pollute local directory with files owned by root. - Removed unused targets. Change-Id: I684348b2a15546eadf98d810239a84ff9798b1e8 Signed-off-by: Stefan K. Berg --- fuel-build/Makefile | 61 +++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 44 deletions(-) (limited to 'fuel-build/Makefile') diff --git a/fuel-build/Makefile b/fuel-build/Makefile index ea403c8..98b108c 100644 --- a/fuel-build/Makefile +++ b/fuel-build/Makefile @@ -12,20 +12,19 @@ # BEGIN of variables to customize # SHELL = /bin/bash - - ISOSRC = file:$(shell pwd)/fuel-5.1.1.iso ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC)) PRODUCT_NAME = "OPNFV_BGS" VERSION = "P0000" NEWISO = $(shell pwd)/release/opnfv-${VERSION}.iso -DOCKERIMG = opnfv.org/ubuntu-builder:12.04 +DOCKERIMG = opnfv.org/ubuntu-builder:14.04 # Note! Invoke with "make VERSION=RXXXX iso" to make release build! # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location. # # END of variables to customize ############################################################################# -ORIGDIR = $(shell pwd)/origiso +TOPDIR := $(shell pwd) +ORIGDIR := $(TOPDIR)/origiso SUBDIRS := f_isoroot SUBDIRS += f_opnfv_puppet @@ -43,38 +42,27 @@ SUBCLEAN = $(addsuffix .clean,$(SUBDIRS)) .PHONY: all all: @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1) - make -C docker + @make -C docker @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso $(ISOCACHE): - # Clone Fuel - sudo rm -rf fuel-main - git clone https://github.com/stackforge/fuel-main - cd fuel-main && git checkout 5.1.1 + # Clone Fuel to non-persistent location and build + cd /tmp && git clone https://github.com/stackforge/fuel-main + cd /tmp/fuel-main && git checkout 5.1.1 # Setup cgroups for docker-in-docker sudo /root/enable_dockerx2 - # Need to patch to fix race condition in build - cd fuel-main && patch -p1 < ../fuel-main.patches + # Patch to fix race condition when doing "Docker-in-Docker" build + cd /tmp/fuel-main && patch -p1 < $(TOPDIR)/fuel-main.patches + # Remove Docker optimizations, otherwise multistrap will fail during + # Fuel build. + sudo rm -f /etc/apt/apt.conf.d/docker* # - cd fuel-main && ./prepare-build-env.sh - # Need to patch not supported start-stop-daemon argument - sudo sed -i 's/--no-close//' /etc/init.d/docker - sudo /etc/init.d/docker start - cd fuel-main && make iso - mv fuel-main/build/artifacts/fuel*.iso . - # Remove Fuel - sudo rm -rf fuel-main - -# Used the "docker" target to build within the context of the Docker -# container created by the Makefile in the docker subdirectory. -.PHONY: docker -docker: /.dockerinit + cd /tmp/fuel-main && ./prepare-build-env.sh + cd /tmp/fuel-main && make iso + mv /tmp/fuel-main/build/artifacts/fuel*.iso . -/.dockerinit: - docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) - -.PHONY: get-iso mount-origiso umount-origiso -mount-origiso: +.PHONY: mount-origiso umount-origiso +mount-origiso: $(ISOCACHE) @echo "Mounting original ISO in $(ORIGDIR)" @mkdir -p $(ORIGDIR) @fuseiso $(ISOCACHE) $(ORIGDIR) @@ -84,13 +72,6 @@ umount-origiso: @fusermount -u $(ORIGDIR) @rmdir $(ORIGDIR) -get-iso: - wget $(ISOSRC) -O $(ISOCACHE) - - - @echo "ISO data of source ISO:" >> release/.isodata - @isoinfo -d -i $(ISOCACHE) >> release/.isodata - .PHONY: $(SUBDIRS) $(SUBDIRS): @mkdir -p release/packages/ubuntu/pool/main release/puppet/modules release/isoroot @@ -110,14 +91,6 @@ clean: $(SUBCLEAN) $(SUBCLEAN): %.clean: $(MAKE) -C $* -f Makefile clean -.PHONY: install -install:$(SUBDIRS) patch-packages - install/install.sh live - -.PHONY: uninstall -uninstall: - install/uninstall.sh - # Todo: Make things smarter - we shouldn't need to clean everything # betwen make invocations. .PHONY: iso -- cgit 1.2.3-korg