Skip to content

Commit

Permalink
Merge d93bf61 into 76e3407
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc authored Sep 11, 2023
2 parents 76e3407 + d93bf61 commit a4839d1
Show file tree
Hide file tree
Showing 24 changed files with 212 additions and 456 deletions.
137 changes: 0 additions & 137 deletions .github/workflows/ci-experimental.yml

This file was deleted.

11 changes: 3 additions & 8 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: container-image-build

on:
workflow_call:
inputs:
experimental:
type: boolean
outputs:
image:
description: The resulting image link
Expand Down Expand Up @@ -46,14 +43,12 @@ jobs:
- name: Build binaries
id: build
run: |
EXPERIMENTAL=${{ inputs.experimental }}
make -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative" wakunode2 EXPERIMENTAL=${EXPERIMENTAL}
make -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative" wakunode2
SHORT_REF=$(git rev-parse --short HEAD)
TAG=$([ "${PR_NUMBER}" == "" ] && echo "${SHORT_REF}" || echo "${PR_NUMBER}")
TAG=$([ "${EXPERIMENTAL}" == "true" ] && echo "${TAG}-experimental" || echo "${TAG}")
IMAGE=quay.io/wakuorg/nwaku-pr:${TAG}
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
Expand All @@ -72,11 +67,11 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
with:
message: |
You can find the ${{ inputs.experimental && '**experimental**' || ''}} image built from this PR at
You can find the image built from this PR at
```
${{steps.build.outputs.image}}
```
Built from ${{ steps.build.outputs.commit_hash }}
comment_tag: execution${{ inputs.experimental && '**experimental**' || ''}}
comment_tag: execution
12 changes: 4 additions & 8 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
experimental: [true, false]
arch: [amd64]
include:
- os: macos-latest
experimental: false
arch: arm64
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -35,14 +33,12 @@ jobs:
id: vars
run: |
ARCH=${{matrix.arch}}
EXPERIMENTAL=$([[ "${{ matrix.experimental }}" == "true" ]] && echo "-experimental" || echo "")
TAG=$([[ "${{github.ref}}" == "refs/heads/master" ]] && echo "${{env.RELEASE_NAME}}" || echo ${{github.ref}} | sed 's#refs/tags/##')
echo "arch=${ARCH}" >> $GITHUB_OUTPUT
echo "experimental=${EXPERIMENTAL}" >> $GITHUB_OUTPUT
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools${EXPERIMENTAL}-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
NWAKU_ARTIFACT_NAME=$(echo "nwaku-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
NWAKU_TOOLS_ARTIFACT_NAME=$(echo "nwaku-tools-${ARCH}-${{runner.os}}-${TAG}.tar.gz" | tr "[:upper:]" "[:lower:]")
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
echo "nwakutools=${NWAKU_TOOLS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
Expand All @@ -53,10 +49,10 @@ jobs:
run: |
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false EXPERIMENTAL=${{matrix.experimental}} NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
update
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false EXPERIMENTAL=${{matrix.experimental}} NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
make QUICK_AND_DIRTY_COMPILER=1 V=1 CI=false NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" \
wakunode2\
chat2\
tools
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: prep variables
id: vars
run: |
NWAKU_ARTIFACT_NAME=$(echo "nwaku${EXPERIMENTAL}-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
NWAKU_ARTIFACT_NAME=$(echo "nwaku-${{matrix.arch}}-${{runner.os}}.tar.gz" | tr "[:upper:]" "[:lower:]")
echo "nwaku=${NWAKU_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ FROM alpine@sha256:880fafbab5a7602db21ac37f0d17088a29a9a48f98d581f01ce17312c22cc

ARG NIMFLAGS
ARG MAKE_TARGET=wakunode2
ARG EXPERIMENTAL=false
ARG NIM_COMMIT
ARG LOG_LEVEL=TRACE

Expand All @@ -22,7 +21,7 @@ RUN git submodule update --init --recursive
RUN make -j$(nproc) deps QUICK_AND_DIRTY_COMPILER=1 ${NIM_COMMIT}

# Build the final node binary
RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET LOG_LEVEL=${LOG_LEVEL} NIMFLAGS="${NIMFLAGS}" EXPERIMENTAL="${EXPERIMENTAL}"
RUN make -j$(nproc) ${NIM_COMMIT} $MAKE_TARGET LOG_LEVEL=${LOG_LEVEL} NIMFLAGS="${NIMFLAGS}"


# PRODUCTION IMAGE -------------------------------------------------------------
Expand Down
49 changes: 17 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,10 @@ clean: | clean-libbacktrace


##################
## Experimental ##
## RLN ##
##################
.PHONY: librln

EXPERIMENTAL ?= false
EXPERIMENTAL_PARAMS ?= $(EMPTY)

ifeq ($(EXPERIMENTAL), true)
RLN := true
endif

### RLN

LIBRLN_BUILDDIR := $(CURDIR)/vendor/zerokit

ifeq ($(OS),Windows_NT)
Expand All @@ -135,14 +126,9 @@ $(LIBRLN_FILE):
echo -e $(BUILD_MSG) "$@" && \
./scripts/build_rln.sh $(LIBRLN_BUILDDIR)

librln-experimental: | $(LIBRLN_FILE)
$(eval EXPERIMENTAL_PARAMS += -d:rln --passL:$(LIBRLN_FILE) --passL:-lm)

ifneq ($(RLN), true)
librln: ; # noop
else
librln: | librln-experimental
endif
librln: | $(LIBRLN_FILE)
$(eval NIM_PARAMS += --passL:$(LIBRLN_FILE) --passL:-lm)

clean-librln:
cargo clean --manifest-path vendor/zerokit/rln/Cargo.toml
Expand All @@ -169,33 +155,33 @@ testcommon: | build deps

testwaku: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim test -d:os=$(shell uname) $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim test -d:os=$(shell uname) $(NIM_PARAMS) waku.nims

wakunode2: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim wakunode2 $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim wakunode2 $(NIM_PARAMS) waku.nims

testwakunode2: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim testwakunode2 $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim testwakunode2 $(NIM_PARAMS) waku.nims

example2: | build deps
example2: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim example2 $(NIM_PARAMS) waku.nims

chat2: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim chat2 $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim chat2 $(NIM_PARAMS) waku.nims

rln-keystore-generator: | build deps librln-experimental
rln-keystore-generator: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim rln_keystore_generator $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim rln_keystore_generator $(NIM_PARAMS) waku.nims

rln-db-inspector: | build deps librln-experimental
rln-db-inspector: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim rln_db_inspector $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim rln_db_inspector $(NIM_PARAMS) waku.nims

chat2bridge: | build deps
chat2bridge: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim chat2bridge $(NIM_PARAMS) waku.nims

Expand All @@ -207,11 +193,11 @@ chat2bridge: | build deps

tools: networkmonitor wakucanary

wakucanary: | build deps
wakucanary: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim wakucanary $(NIM_PARAMS) waku.nims

networkmonitor: | build deps
networkmonitor: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim networkmonitor $(NIM_PARAMS) waku.nims

Expand Down Expand Up @@ -243,7 +229,6 @@ docker-image:
docker build \
--build-arg="MAKE_TARGET=$(MAKE_TARGET)" \
--build-arg="NIMFLAGS=$(DOCKER_IMAGE_NIMFLAGS)" \
--build-arg="EXPERIMENTAL=$(EXPERIMENTAL)" \
--build-arg="NIM_COMMIT=$(DOCKER_NIM_COMMIT)" \
--build-arg="LOG_LEVEL=$(LOG_LEVEL)" \
--label="commit=$(GIT_VERSION)" \
Expand All @@ -265,10 +250,10 @@ libwaku: | build deps
rm -f build/libwaku*
ifeq ($(STATIC), true)
echo -e $(BUILD_MSG) "build/$@.a" && \
$(ENV_SCRIPT) nim libwakuStatic $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim libwakuStatic $(NIM_PARAMS) waku.nims
else
echo -e $(BUILD_MSG) "build/$@.so" && \
$(ENV_SCRIPT) nim libwakuDynamic $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
$(ENV_SCRIPT) nim libwakuDynamic $(NIM_PARAMS) waku.nims
endif

cwaku_example: | build libwaku
Expand Down
Loading

0 comments on commit a4839d1

Please sign in to comment.