-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into roman/e2e-skip
- Loading branch information
Showing
54 changed files
with
1,937 additions
and
1,849 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Default state for all rules | ||
default: true | ||
MD024: false | ||
MD003: | ||
# Heading style | ||
style: "atx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# -------------------------------------------------------- | ||
# Builder | ||
# -------------------------------------------------------- | ||
|
||
FROM golang:1.18.2-alpine3.15 as build | ||
|
||
ARG NAME="osmosis" | ||
ARG APP_NAME="osmosisd" | ||
ARG VERSION | ||
ARG COMMIT | ||
ARG COSMWASM_VERSION="v1.0.0" | ||
ARG BUILD_TAGS="netgo ledger muslc" | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base; | ||
RUN apk add git | ||
# Needed by github.com/zondax/hid | ||
RUN apk add linux-headers | ||
|
||
WORKDIR /osmosis | ||
COPY . /osmosis | ||
|
||
# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/$COSMWASM_VERSION/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/$COSMWASM_VERSION/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
|
||
# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc` | ||
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a | ||
|
||
RUN go build \ | ||
-mod=readonly \ | ||
-tags "$BUILD_TAGS" \ | ||
-ldflags "-X github.com/osmosis-labs/osmosis/version.Name=$NAME -X github.com/osmosis-labs/osmosis/version.AppName=$APP_NAME -X github.com/osmosis-labs/osmosis/version.Version=$VERSION -X github.com/osmosis-labs/osmosis/version.Commit=$COMMIT -X github.com/osmosis-labs/osmosis/version.BuildTags='netgo,ledger,muslc' -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ | ||
-trimpath \ | ||
-o /osmosis/build/ \ | ||
./... | ||
|
||
ENTRYPOINT ["ash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Script to automatically build binaries | ||
# for linux/amd64, linux/arm64 | ||
|
||
# It builds a osmosisd binary while build the docker image | ||
# in order to create a single binary statically linked to cosmwasm | ||
|
||
# Usage: | ||
# | ||
# Create a new release by running from the root of the repository: | ||
# make -f contrib/images/osmobuilder/Makefile release | ||
# | ||
# A release/ folder will be created with the appropriate files | ||
|
||
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') | ||
COMMIT := $(shell git log -1 --format='%H') | ||
COSMWASM_VERSION := "v1.0.0" | ||
BUILD_TAGS := "netgo ledger muslc" | ||
|
||
IMAGE:=osmobuilder:$(VERSION) | ||
|
||
.PHONY: create-dockerx-builder build-binary-amd64 get-binary-amd64 | ||
|
||
release: get-binary-amd64 get-binary-arm64 git sha | ||
|
||
# Run `create-dockerx-builder` to create the builder first | ||
create-dockerx-builder: | ||
docker buildx create --name osmobuilder || true | ||
|
||
# Build image for amd64 architecture | ||
build-binary-amd64: create-dockerx-builder | ||
docker buildx use osmobuilder | ||
docker buildx build \ | ||
--platform linux/amd64 \ | ||
--build-arg VERSION=$(VERSION) \ | ||
--build-arg COMMIT=$(COMMIT) \ | ||
--build-arg COSMWASM_VERSION=$(COSMWASM_VERSION) \ | ||
--build-arg BUILD_TAGS=$(BUILD_TAGS) \ | ||
-t $(IMAGE)-amd64 \ | ||
--load \ | ||
--no-cache \ | ||
--progress plain \ | ||
-f contrib/images/osmobuilder/Dockerfile . | ||
|
||
# Get binary from image for amd64 architecture | ||
get-binary-amd64: build-binary-amd64 | ||
mkdir -p release/ | ||
docker rm -f osmobinary || true | ||
docker create -ti --name osmobinary $(IMAGE)-amd64 | ||
docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-amd64 | ||
tar -zcvf release/osmosis-$(VERSION)-linux-amd64.tar.gz release/osmosis-$(VERSION)-linux-amd64 | ||
docker rm -f osmobinary | ||
|
||
# Build image for arm64 architecture | ||
build-binary-arm64: create-dockerx-builder | ||
docker buildx use osmobuilder | ||
docker buildx build \ | ||
--platform linux/arm64 \ | ||
--build-arg VERSION=$(VERSION) \ | ||
--build-arg COMMIT=$(COMMIT) \ | ||
--build-arg COSMWASM_VERSION=$(COSMWASM_VERSION) \ | ||
--build-arg BUILD_TAGS=$(BUILD_TAGS) \ | ||
-t $(IMAGE)-arm64 \ | ||
--load \ | ||
--no-cache \ | ||
--progress plain \ | ||
-f contrib/images/osmobuilder/Dockerfile . | ||
|
||
# Get binary from image for arm64 architecture | ||
get-binary-arm64: build-binary-arm64 | ||
mkdir -p release/ | ||
docker rm -f osmobinary || true | ||
docker create -ti --name osmobinary $(IMAGE)-arm64 | ||
docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-arm64 | ||
tar -zcvf release/osmosis-$(VERSION)-linux-arm64.tar.gz release/osmosis-$(VERSION)-linux-arm64 | ||
docker rm -f osmobinary | ||
|
||
# Calculate sha | ||
sha: | ||
mkdir -p release/ | ||
rm -f release/sha256sum.txt | ||
sha256sum release/* | sed 's#release/##g' > release/sha256sum.txt | ||
|
||
# Create git archive | ||
git: | ||
mkdir -p release/ | ||
git archive \ | ||
--format zip \ | ||
--prefix "osmosis-$(VERSION)/" \ | ||
-o "release/Source code.zip" \ | ||
HEAD | ||
|
||
git archive \ | ||
--format tar.gz \ | ||
--prefix "osmosis-$(VERSION)/" \ | ||
-o "release/Source code.tar.gz" \ | ||
HEAD | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.