From df5dba7bc9d466f8bd54e28ad08f4d238dd45e44 Mon Sep 17 00:00:00 2001 From: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com> Date: Fri, 25 Apr 2025 14:15:39 +0200 Subject: [PATCH] Added docker-quick-image / docker-quick-liteprotocoltester targets to build runable docker image from the locally build wakunode2 or liteprotocoltester - this speeds up build-test rounds (#3394) --- Makefile | 25 ++++++++++++++++++++++--- ci/Jenkinsfile.release | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5eb893442..5da2d6076 100644 --- a/Makefile +++ b/Makefile @@ -40,8 +40,8 @@ ifeq ($(detected_OS),Windows) NIM_PARAMS += --passL:"-L$(MINGW_PATH)/lib" NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/miniupnp/miniupnpc" NIM_PARAMS += --passL:"-Lvendor/nim-nat-traversal/vendor/libnatpmp-upstream" - - LIBS = -static -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp -lpq + + LIBS = -static -lws2_32 -lbcrypt -liphlpapi -luserenv -lntdll -lminiupnpc -lnatpmp -lpq NIM_PARAMS += $(foreach lib,$(LIBS),--passL:"$(lib)") endif @@ -83,7 +83,7 @@ HEAPTRACKER_INJECT ?= 0 ifeq ($(HEAPTRACKER), 1) # Needed to make nimbus-build-system use the Nim's 'heaptrack_support' branch DOCKER_NIM_COMMIT := NIM_COMMIT=heaptrack_support -TARGET := prod-with-heaptrack +TARGET := heaptrack-build ifeq ($(HEAPTRACKER_INJECT), 1) # the Nim compiler will load 'libheaptrack_inject.so' @@ -340,6 +340,17 @@ docker-image: --target $(TARGET) \ --tag $(DOCKER_IMAGE_NAME) . +docker-quick-image: MAKE_TARGET ?= wakunode2 +docker-quick-image: DOCKER_IMAGE_TAG ?= $(MAKE_TARGET)-$(GIT_VERSION) +docker-quick-image: DOCKER_IMAGE_NAME ?= wakuorg/nwaku:$(DOCKER_IMAGE_TAG) +docker-quick-image: NIM_PARAMS := $(NIM_PARAMS) -d:chronicles_colors:none -d:insecure -d:postgres --passL:$(LIBRLN_FILE) --passL:-lm +docker-quick-image: | build deps librln wakunode2 + docker build \ + --build-arg="MAKE_TARGET=$(MAKE_TARGET)" \ + --tag $(DOCKER_IMAGE_NAME) \ + --file docker/binaries/Dockerfile.bn.amd64 \ + . + docker-push: docker push $(DOCKER_IMAGE_NAME) @@ -367,6 +378,14 @@ docker-liteprotocoltester: --file apps/liteprotocoltester/Dockerfile.liteprotocoltester.compile \ . +docker-quick-liteprotocoltester: DOCKER_LPT_TAG ?= latest +docker-quick-liteprotocoltester: DOCKER_LPT_NAME ?= wakuorg/liteprotocoltester:$(DOCKER_LPT_TAG) +docker-quick-liteprotocoltester: | liteprotocoltester + docker build \ + --tag $(DOCKER_LPT_NAME) \ + --file apps/liteprotocoltester/Dockerfile.liteprotocoltester \ + . + docker-liteprotocoltester-push: docker push $(DOCKER_LPT_NAME) diff --git a/ci/Jenkinsfile.release b/ci/Jenkinsfile.release index fcc353be8..1a2125402 100644 --- a/ci/Jenkinsfile.release +++ b/ci/Jenkinsfile.release @@ -78,7 +78,7 @@ pipeline { "--build-arg=NIMFLAGS='${params.NIMFLAGS} -d:postgres ' " + "--build-arg=LOG_LEVEL='${params.LOWEST_LOG_LEVEL_ALLOWED}' " + "--build-arg=DEBUG='${params.DEBUG ? "1" : "0"} ' " + - "--target=${params.HEAPTRACK ? "prod-with-heaptrack" : "prod"} ." + "--target=${params.HEAPTRACK ? "heaptrack-build" : "prod"} ." ) } } }