chore(makefile): unify where chronicles_log_level is set (#1748)

This commit is contained in:
Vaclav Pavlin 2023-05-23 10:44:57 +02:00 committed by GitHub
parent 36266b43cf
commit 39902dc2f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 11 deletions

View File

@ -76,7 +76,7 @@ jobs:
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }} key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Build binaries - name: Build binaries
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 v2 run: make V=1 QUICK_AND_DIRTY_COMPILER=1 v2
test-v2: test-v2:
needs: changes needs: changes

View File

@ -85,7 +85,7 @@ jobs:
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }} key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Build binaries - name: Build binaries
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 v2 tools run: make V=1 QUICK_AND_DIRTY_COMPILER=1 v2 tools
test-v2: test-v2:
needs: changes needs: changes
@ -146,7 +146,7 @@ jobs:
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }} key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Build binaries - name: Build binaries
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 v1 run: make V=1 QUICK_AND_DIRTY_COMPILER=1 v1
test-legacy: test-legacy:
needs: changes needs: changes

View File

@ -6,6 +6,7 @@ ARG NIMFLAGS
ARG MAKE_TARGET=wakunode2 ARG MAKE_TARGET=wakunode2
ARG EXPERIMENTAL=false ARG EXPERIMENTAL=false
ARG NIM_COMMIT ARG NIM_COMMIT
ARG LOG_LEVEL=TRACE
# Get build tools and required header files # Get build tools and required header files
RUN apk add --no-cache bash git cargo build-base pcre-dev linux-headers RUN apk add --no-cache bash git cargo build-base pcre-dev linux-headers
@ -17,10 +18,10 @@ COPY . .
RUN git submodule update --init --recursive RUN git submodule update --init --recursive
# Slowest build step for the sake of caching layers # Slowest build step for the sake of caching layers
RUN make -j$(nproc) deps ${NIM_COMMIT} RUN make -j$(nproc) deps QUICK_AND_DIRTY_COMPILER=1 ${NIM_COMMIT}
# Build the final node binary # Build the final node binary
RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET NIMFLAGS="${NIMFLAGS}" EXPERIMENTAL="${EXPERIMENTAL}" RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET LOG_LEVEL=${LOG_LEVEL} NIMFLAGS="${NIMFLAGS}" EXPERIMENTAL="${EXPERIMENTAL}"
# PRODUCTION IMAGE ------------------------------------------------------------- # PRODUCTION IMAGE -------------------------------------------------------------

View File

@ -7,6 +7,7 @@
BUILD_SYSTEM_DIR := vendor/nimbus-build-system BUILD_SYSTEM_DIR := vendor/nimbus-build-system
EXCLUDED_NIM_PACKAGES := vendor/nim-dnsdisc/vendor EXCLUDED_NIM_PACKAGES := vendor/nim-dnsdisc/vendor
LINK_PCRE := 0 LINK_PCRE := 0
LOG_LEVEL := TRACE
# we don't want an error here, so we can handle things later, in the ".DEFAULT" target # we don't want an error here, so we can handle things later, in the ".DEFAULT" target
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk -include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
@ -272,6 +273,7 @@ docker-image:
--build-arg="NIMFLAGS=$(DOCKER_IMAGE_NIMFLAGS)" \ --build-arg="NIMFLAGS=$(DOCKER_IMAGE_NIMFLAGS)" \
--build-arg="EXPERIMENTAL=$(EXPERIMENTAL)" \ --build-arg="EXPERIMENTAL=$(EXPERIMENTAL)" \
--build-arg="NIM_COMMIT=$(DOCKER_NIM_COMMIT)" \ --build-arg="NIM_COMMIT=$(DOCKER_NIM_COMMIT)" \
--build-arg="LOG_LEVEL=$(LOG_LEVEL)" \
--label="commit=$(GIT_VERSION)" \ --label="commit=$(GIT_VERSION)" \
--target $(TARGET) \ --target $(TARGET) \
--tag $(DOCKER_IMAGE_NAME) . --tag $(DOCKER_IMAGE_NAME) .

View File

@ -36,6 +36,10 @@ pipeline {
'-d:insecure', '-d:insecure',
].join(' ') ].join(' ')
) )
string(
name: "LOG_LEVEL",
description: "Chronicles log level (default: TRACE)",
)
booleanParam( booleanParam(
name: 'EXPERIMENTAL', name: 'EXPERIMENTAL',
description: 'Enable experimental features.', description: 'Enable experimental features.',
@ -57,6 +61,7 @@ pipeline {
"--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " + "--build-arg=MAKE_TARGET='${params.MAKE_TARGET}' " +
"--build-arg=NIMFLAGS='${params.NIMFLAGS}' " + "--build-arg=NIMFLAGS='${params.NIMFLAGS}' " +
"--build-arg=EXPERIMENTAL='${params.EXPERIMENTAL}' " + "--build-arg=EXPERIMENTAL='${params.EXPERIMENTAL}' " +
(params.LOG_LEVEL != null ? "--build-arg=LOG_LEVEL='${params.LOG_LEVEL}' ": "") +
"--target=${params.DEBUG ? "debug" : "prod"} ." "--target=${params.DEBUG ? "debug" : "prod"} ."
) )
} } } }

View File

@ -60,19 +60,19 @@ task testcommon, "Build & run common tests":
### Waku v2 tasks ### Waku v2 tasks
task wakunode2, "Build Waku v2 cli node": task wakunode2, "Build Waku v2 cli node":
let name = "wakunode2" let name = "wakunode2"
buildBinary name, "apps/wakunode2/", "-d:chronicles_log_level=TRACE" buildBinary name, "apps/wakunode2/"
task bridge, "Build Waku v1 - v2 bridge": task bridge, "Build Waku v1 - v2 bridge":
let name = "wakubridge" let name = "wakubridge"
buildBinary name, "apps/wakubridge/", "-d:chronicles_log_level=TRACE" buildBinary name, "apps/wakubridge/"
task wakucanary, "Build waku-canary tool": task wakucanary, "Build waku-canary tool":
let name = "wakucanary" let name = "wakucanary"
buildBinary name, "apps/wakucanary/", "-d:chronicles_log_level=TRACE" buildBinary name, "apps/wakucanary/"
task networkmonitor, "Build network monitor tool": task networkmonitor, "Build network monitor tool":
let name = "networkmonitor" let name = "networkmonitor"
buildBinary name, "apps/networkmonitor/", "-d:chronicles_log_level=TRACE" buildBinary name, "apps/networkmonitor/"
task test2, "Build & run Waku v2 tests": task test2, "Build & run Waku v2 tests":
test "all_tests_v2" test "all_tests_v2"
@ -93,11 +93,11 @@ task chat2, "Build example Waku v2 chat usage":
#buildBinary name, "examples/v2/", "-d:chronicles_log_level=WARN" #buildBinary name, "examples/v2/", "-d:chronicles_log_level=WARN"
let name = "chat2" let name = "chat2"
buildBinary name, "apps/chat2/", "-d:chronicles_log_level=TRACE -d:chronicles_sinks=textlines[file] -d:ssl" buildBinary name, "apps/chat2/", "-d:chronicles_sinks=textlines[file] -d:ssl"
task chat2bridge, "Build chat2bridge": task chat2bridge, "Build chat2bridge":
let name = "chat2bridge" let name = "chat2bridge"
buildBinary name, "apps/chat2bridge/", "-d:chronicles_log_level=TRACE" buildBinary name, "apps/chat2bridge/"
### C Bindings ### C Bindings
task libwakuStatic, "Build the cbindings waku node library": task libwakuStatic, "Build the cbindings waku node library":