Skip to content

Commit

Permalink
Merge branch 'main' into apply_lbmsdk_v0.46.0-rc10
Browse files Browse the repository at this point in the history
* main:
  fix: fix docker build in Mac M1 device. (#118)
  • Loading branch information
zemyblue committed Nov 23, 2022
2 parents 19c6f9a + 5b35593 commit a8a0b78
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}"
if: env.GIT_DIFF
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential libtool autoconf automake
- name: install libsodium
run: |
make libsodium
Expand Down Expand Up @@ -193,6 +196,9 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}"
if: env.GIT_DIFF
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential libtool autoconf automake
- name: install libsodium
run: |
make libsodium
Expand Down Expand Up @@ -270,7 +276,16 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}"
if: env.GIT_DIFF
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential libtool autoconf automake
- name: install libsodium
run: make libsodium
if: env.GIT_DIFF
- name: test report creation
env:
CGO_CFLAGS: "-I${{ github.workspace }}/tools/sodium/linux_amd64/include"
CGO_LDFLAGS: "-L${{ github.workspace }}/tools/sodium/linux_amd64/lib -lsodium"
run: |
xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -mod=readonly -json -timeout 30m -tags='cli_multi_node_test goleveldb libsodium' | tee ${{ matrix.part }}-integration-multi-node-output.txt
if: env.GIT_DIFF
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (global) [\#103](https://github.com/line/lbm/pull/103) replace deprecated functions of ioutil package
* (app) [\#107](https://github.com/line/lbm/pull/107) change module order in `init genesis`
* (ci) [\#115](https://github.com/line/lbm/pull/115) fix test flow to install libsodium
* (build) [\#118](https://github.com/line/lbm/pull/118) fix docker build in Mac M1 device

### Improvements
* (app) [\#114](https://github.com/line/lbm/pull/114) change the default compile setting to support ledger
Expand Down
25 changes: 10 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Simple usage with a mounted data directory:
# > docker build --platform="linux/amd64" -t line/lbm .
# > docker build --platform="linux/amd64" -t line/lbm . --build-arg ARCH=x86_64
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lbm:/root/.lbm -v line/lbm lbm init
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lbm:/root/.lbm -v line/lbm lbm start --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656
FROM golang:1.18-alpine AS build-env
ARG ARCH=$ARCH
ARG LBM_BUILD_OPTIONS=""

# Set up OS dependencies
Expand All @@ -23,20 +24,14 @@ COPY ./go.mod /lbm-build/lbm/go.mod
COPY ./go.sum /lbm-build/lbm/go.sum
RUN go mod download

# Build cosmwasm
ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=$CARGO_HOME/bin:$PATH

RUN wget "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init"
RUN chmod +x rustup-init
RUN ./rustup-init -y --no-modify-path --default-toolchain 1.57.0; rm rustup-init
RUN chmod -R a+w $RUSTUP_HOME $CARGO_HOME
RUN cd $(go list -f "{{ .Dir }}" -m github.com/line/wasmvm) && \
cd ./libwasmvm && \
RUSTFLAGS='-C target-feature=-crt-static' cargo build --release --example staticlib && \
mv -f target/release/examples/libstaticlib.a /usr/lib/libwasmvm_static.a && \
rm -rf target
# See https://github.com/line/wasmvm/releases
# See https://github.com/line/wasmvm/releases
ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.x86_64.a /lib/libwasmvm_static.x86_64.a
ADD https://github.com/line/wasmvm/releases/download/v1.0.0-0.10.0/libwasmvm_static.aarch64.a /lib/libwasmvm_static.aarch64.a
RUN sha256sum /lib/libwasmvm_static.aarch64.a | grep bc3db72ba32f34ad88ceb1d20479411bd7f50ccd6a5ca50cc8ca462a561e6189
RUN sha256sum /lib/libwasmvm_static.x86_64.a | grep 352fa5de5f9dba66f0a38082541d3e63e21394fee3e577ea35e0906294c61276

RUN ln -s /lib/libwasmvm_static.${ARCH}.a /usr/lib/libwasmvm_static.a

# Add source files
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ build: go.sum $(BUILDDIR)/ dbbackend $(LIBSODIUM_TARGET)
CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) CGO_ENABLED=$(CGO_ENABLED) go build -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...

build-static: go.sum $(BUILDDIR)/
docker build -t line/lbmnode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH)
docker build -t line/lbmnode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH) --platform="linux/amd64"

build-static-centos7: go.sum $(BUILDDIR)/
docker build -t line/lbm-builder:static_centos7 -f builders/Dockerfile.static_centos7 .
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,10 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0=
github.com/line/lbm-sdk v0.46.0-rc10 h1:MzSIWJQbWFaheoRaq2egHTiT24mH8PxmfJUWMBP+98Q=
github.com/line/lbm-sdk v0.46.0-rc10/go.mod h1:EcflA9fjgm8tjuRtr/m5IRagu2p9MynZ3yDKAGCcL/4=
github.com/line/lbm-sdk v0.46.0-rc8.0.20221026050953-eb1b5e2f9d7d h1:NQZm3oKZ0+s0GvQshMYGLlG3iMu3KojoPBJquzdjM3s=
github.com/line/lbm-sdk v0.46.0-rc8.0.20221026050953-eb1b5e2f9d7d/go.mod h1:WRGlX57Np2OUqp+F2LRVDBENGdZWIthNGiKufwkdFbQ=
github.com/line/lbm-sdk v0.46.0-rc9 h1:DntTpRixOHhAHDLcaPBtPXJm1nS2Jg+LEGDtfwFYeic=
github.com/line/lbm-sdk v0.46.0-rc9/go.mod h1:WRGlX57Np2OUqp+F2LRVDBENGdZWIthNGiKufwkdFbQ=
github.com/line/ostracon v1.0.7-0.20220906074149-e6ecd80874f8 h1:f4qs+qoF28n+bezpZIPAtbdl36l6hwm7EbrZeOGQZhI=
github.com/line/ostracon v1.0.7-0.20220906074149-e6ecd80874f8/go.mod h1:fZk18b2be10fRB4qGM2IyvMIGKuPtBVa8xnPxDg9LRI=
github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486 h1:uvXQdcWaUyNsgkXBz375FpQ285WEJaLXhQ5HtoNK/GU=
Expand Down

0 comments on commit a8a0b78

Please sign in to comment.