diff --git a/Makefile b/Makefile index 58c9f7b1f..7d36ab1c3 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ help: @echo 'Targets:' @echo ' build Build source code for host platform.' @echo ' build.all Build source code for all platforms.' - @echo ' Best done in the cross-build container' + @echo ' Best done in the cross build container' @echo ' due to cross compiler dependencies.' @echo ' check Runs unit tests.' @echo ' clean Remove all files that are created ' diff --git a/build/common.sh b/build/common.sh index 9f8153914..ab4c78577 100644 --- a/build/common.sh +++ b/build/common.sh @@ -20,8 +20,8 @@ host=$(hostname) rootdir=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd -P) host_hash=`echo ${host}-${rootdir} | sha256sum | cut -c1-8` build_registry=build-${host_hash} -container_image=${build_registry}/cross-build-amd64 -container_volume=cross-build-volume +container_image=${build_registry}/cross-amd64 +container_volume=cross-volume rsync_port=10873 function ver() { diff --git a/build/run b/build/run index 01c7a1e94..e017de2c2 100755 --- a/build/run +++ b/build/run @@ -26,8 +26,8 @@ fi # build the the container if we've not done so already if [[ -z "$(docker images -q ${container_image})" ]]; then - echo ==== building the cross-build container \(this could take minutes the first time\) - make_cmd="make --no-print-directory -C ${scriptdir}/../images cross-build.amd64 PULL=0" + echo ==== building the cross container \(this could take minutes the first time\) + make_cmd="make --no-print-directory -C ${scriptdir}/../images cross.amd64 PULL=0" make_output=$($make_cmd 2>&1) || { cat <&2 === cross build image failed for ${container_image} diff --git a/images/Makefile b/images/Makefile index d977fc87b..64d7f57e8 100644 --- a/images/Makefile +++ b/images/Makefile @@ -16,7 +16,7 @@ include image.mk PLATFORMS ?= amd64 arm arm64 PLATFORM_IMAGES ?= rookd -HOST_IMAGES ?= cross-build +HOST_IMAGES ?= cross # ==================================================================================== # Image Builds @@ -24,19 +24,19 @@ HOST_IMAGES ?= cross-build base.%: @$(MAKE) -C base GOARCH=$* -cross-build-gnu.%: base.% - @$(MAKE) -C cross-build-gnu GOARCH=$* +cross-gnu.%: base.% + @$(MAKE) -C cross-gnu GOARCH=$* -cross-build-go.%: cross-build-gnu.% - @$(MAKE) -C cross-build-go GOARCH=$* +cross-go.%: cross-gnu.% + @$(MAKE) -C cross-go GOARCH=$* -cross-build.%: cross-build-go.% - @$(MAKE) -C cross-build GOARCH=$* +cross.%: cross-go.% + @$(MAKE) -C cross GOARCH=$* -ceph-build.%: cross-build-gnu.$(GOHOSTARCH) - @$(MAKE) -C ceph-build GOARCH=$* +ceph.%: cross-gnu.$(GOHOSTARCH) + @$(MAKE) -C ceph GOARCH=$* -rookd.%: ceph-build.% base.% +rookd.%: ceph.% base.% @$(MAKE) -C rookd GOARCH=$* build.all: $(foreach p,$(PLATFORMS), $(foreach i,$(PLATFORM_IMAGES), $(i).$(p))) $(foreach i,$(HOST_IMAGES), $(i).$(GOHOSTARCH)) @@ -60,7 +60,7 @@ help: @echo ' push Pushes public images to registry.' @echo '' @echo 'Advanced Targets:' - @echo ' cross-build Build images used for cross-builds.' + @echo ' cross Build images used for cross building.' @echo ' clean.all Remove all images including cached.' @echo ' images at the host level.' @echo ' prune.all Prune everything ignoring policy.' @@ -76,10 +76,8 @@ help: @echo ' is obtained from git.' @echo '' @echo 'Advanced Options:' - @echo ' PRUNE_HOURS The number of hours from when an image is' - @echo ' created for it to be considered a target for' - @echo ' pruning. Default is 48 hrs.' - @echo ' PRUNE_KEEP_CACHED The minimum number of cached images to keep.' - @echo ' Default is 24 images.' - @echo ' PRUNE_KEEP_ORPHANS The minimum number of orphaned images to keep.' - @echo ' Default is 24 images.' + @echo ' PRUNE_HOURS The number of hours from when an image is' + @echo ' created for it to be considered a target for' + @echo ' pruning. Default is 48 hrs.' + @echo ' PRUNE_KEEP The minimum number of cached images to keep.' + @echo ' Default is 24 images.' diff --git a/images/ceph-build/CMakeLists.txt b/images/ceph/CMakeLists.txt similarity index 100% rename from images/ceph-build/CMakeLists.txt rename to images/ceph/CMakeLists.txt diff --git a/images/ceph-build/Dockerfile b/images/ceph/Dockerfile similarity index 100% rename from images/ceph-build/Dockerfile rename to images/ceph/Dockerfile diff --git a/images/ceph-build/Makefile b/images/ceph/Makefile similarity index 97% rename from images/ceph-build/Makefile rename to images/ceph/Makefile index 3f4de77aa..ebbccbf6b 100644 --- a/images/ceph-build/Makefile +++ b/images/ceph/Makefile @@ -39,7 +39,7 @@ CEPH_TARBALL = ceph-install.tar CCACHE_DIR_HOST ?= $(HOME)/.ccache CEPH_BUILDER_IMAGE := $(BUILD_REGISTRY)/ceph-builder-$(CEPH_CONFIG) -CEPH_BUILDER_BASEIMAGE := $(BUILD_REGISTRY)/cross-build-gnu-$(GOHOSTARCH) +CEPH_BUILDER_BASEIMAGE := $(BUILD_REGISTRY)/cross-gnu-$(GOHOSTARCH) CEPH_IMAGE := $(BUILD_REGISTRY)/ceph-$(CEPH_CONFIG)-$$(docker images -q $(CEPH_BUILDER_IMAGE)) diff --git a/images/ceph-build/build-ceph.sh b/images/ceph/build-ceph.sh similarity index 100% rename from images/ceph-build/build-ceph.sh rename to images/ceph/build-ceph.sh diff --git a/images/ceph-build/commit_hash b/images/ceph/commit_hash similarity index 100% rename from images/ceph-build/commit_hash rename to images/ceph/commit_hash diff --git a/images/cross-build/README.md b/images/cross-build/README.md deleted file mode 100644 index 449df939a..000000000 --- a/images/cross-build/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Cross Build Image - -This directory builds a container image that can be used for cross building, and -also to minimize dependencies on the host platform. - -## Building - -To build the container run make in the directory. - -## Pushing - -To publish to docker hub run `make push`. - -## Version - -Be sure to update the version number in the `version` file when making changes -to the build container. We use semantic versioning for the build container. - - diff --git a/images/cross-build-gnu/Dockerfile b/images/cross-gnu/Dockerfile similarity index 100% rename from images/cross-build-gnu/Dockerfile rename to images/cross-gnu/Dockerfile diff --git a/images/cross-build-gnu/Makefile b/images/cross-gnu/Makefile similarity index 94% rename from images/cross-build-gnu/Makefile rename to images/cross-gnu/Makefile index ee56f3e8a..941e3208b 100644 --- a/images/cross-build-gnu/Makefile +++ b/images/cross-gnu/Makefile @@ -14,7 +14,7 @@ include ../image.mk -IMAGE = $(BUILD_REGISTRY)/cross-build-gnu-$(GOARCH) +IMAGE = $(BUILD_REGISTRY)/cross-gnu-$(GOARCH) IMAGES := $(IMAGE) CACHE_IMAGES = $(IMAGES) diff --git a/images/cross-build-gnu/toolchain/aarch64-linux-gnu.cmake b/images/cross-gnu/toolchain/aarch64-linux-gnu.cmake similarity index 100% rename from images/cross-build-gnu/toolchain/aarch64-linux-gnu.cmake rename to images/cross-gnu/toolchain/aarch64-linux-gnu.cmake diff --git a/images/cross-build-gnu/toolchain/arm-linux-gnueabihf.cmake b/images/cross-gnu/toolchain/arm-linux-gnueabihf.cmake similarity index 100% rename from images/cross-build-gnu/toolchain/arm-linux-gnueabihf.cmake rename to images/cross-gnu/toolchain/arm-linux-gnueabihf.cmake diff --git a/images/cross-build-gnu/toolchain/x86_64-linux-gnu.cmake b/images/cross-gnu/toolchain/x86_64-linux-gnu.cmake similarity index 100% rename from images/cross-build-gnu/toolchain/x86_64-linux-gnu.cmake rename to images/cross-gnu/toolchain/x86_64-linux-gnu.cmake diff --git a/images/cross-build-go/Dockerfile b/images/cross-go/Dockerfile similarity index 100% rename from images/cross-build-go/Dockerfile rename to images/cross-go/Dockerfile diff --git a/images/cross-build/Makefile b/images/cross-go/Makefile similarity index 89% rename from images/cross-build/Makefile rename to images/cross-go/Makefile index af855fd60..81e5dbe48 100644 --- a/images/cross-build/Makefile +++ b/images/cross-go/Makefile @@ -14,11 +14,11 @@ include ../image.mk -IMAGE = $(BUILD_REGISTRY)/cross-build-$(GOARCH) +IMAGE = $(BUILD_REGISTRY)/cross-go-$(GOARCH) IMAGES := $(IMAGE) CACHE_IMAGES = $(IMAGES) -BASEIMAGE = $(BUILD_REGISTRY)/cross-build-go-$(GOARCH) +BASEIMAGE = $(BUILD_REGISTRY)/cross-gnu-$(GOARCH) TEMP := $(shell mktemp -d) diff --git a/images/cross-build/Dockerfile b/images/cross/Dockerfile similarity index 100% rename from images/cross-build/Dockerfile rename to images/cross/Dockerfile diff --git a/images/cross-build-go/Makefile b/images/cross/Makefile similarity index 89% rename from images/cross-build-go/Makefile rename to images/cross/Makefile index 1866e80e7..b3591afc6 100644 --- a/images/cross-build-go/Makefile +++ b/images/cross/Makefile @@ -14,11 +14,11 @@ include ../image.mk -IMAGE = $(BUILD_REGISTRY)/cross-build-go-$(GOARCH) +IMAGE = $(BUILD_REGISTRY)/cross-$(GOARCH) IMAGES := $(IMAGE) CACHE_IMAGES = $(IMAGES) -BASEIMAGE = $(BUILD_REGISTRY)/cross-build-gnu-$(GOARCH) +BASEIMAGE = $(BUILD_REGISTRY)/cross-go-$(GOARCH) TEMP := $(shell mktemp -d) diff --git a/images/cross-build/entrypoint.sh b/images/cross/entrypoint.sh similarity index 100% rename from images/cross-build/entrypoint.sh rename to images/cross/entrypoint.sh diff --git a/images/cross-build/rsyncd.sh b/images/cross/rsyncd.sh similarity index 100% rename from images/cross-build/rsyncd.sh rename to images/cross/rsyncd.sh diff --git a/images/rookd/Makefile b/images/rookd/Makefile index e74049da8..fb9bcc26a 100755 --- a/images/rookd/Makefile +++ b/images/rookd/Makefile @@ -47,7 +47,7 @@ CEPH_TARBALL = $(TEMP)/$(CEPH_TARBALL_FILENAME) $(CEPH_TARBALL): @echo === building ceph for $(ROOKD_IMAGE) - @$(MAKE) -C ../ceph-build GOARCH=$(GOARCH) CEPH_ALLOCATOR=$(CEPH_ALLOCATOR) CEPH_BUILD_TYPE=$(CEPH_BUILD_TYPE) $(CEPH_TARBALL) + @$(MAKE) -C ../ceph GOARCH=$(GOARCH) CEPH_ALLOCATOR=$(CEPH_ALLOCATOR) CEPH_BUILD_TYPE=$(CEPH_BUILD_TYPE) $(CEPH_TARBALL) # ==================================================================================== # Build Rook