-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: release build scripts (#1286) * update all builders * rbuilder images are prefixed by osmolabs * update makefile * use root instead of builder user and other minor changes * correct lib path in Makefile * LINK_STATICALLY in Makefile * docs for builder * update README * changelog entry * remove make clean from .build.sh * improve readme * remove spurious whitespace in Makefile * fix formatting for build-reproducible * update cosmwasm path in makefile * copy from /home/builder in build-reproducible * change wasm file pemissions to non-root (cherry picked from commit 2029415) # Conflicts: # CHANGELOG.md * fix: release build scripts (#1286) * update all builders * rbuilder images are prefixed by osmolabs * update makefile * use root instead of builder user and other minor changes * correct lib path in Makefile * LINK_STATICALLY in Makefile * docs for builder * update README * changelog entry * remove make clean from .build.sh * improve readme * remove spurious whitespace in Makefile * fix formatting for build-reproducible * update cosmwasm path in makefile * copy from /home/builder in build-reproducible * change wasm file pemissions to non-root * fix changelog Co-authored-by: Roman <34196718+p0mvn@users.noreply.github.com> Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
- Loading branch information
1 parent
4da7a77
commit 445cbc1
Showing
6 changed files
with
107 additions
and
38 deletions.
There are no files selected for viewing
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
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,16 +1,37 @@ | ||
FROM golang:1.15.2-alpine3.12 | ||
|
||
FROM golang:1.18-bullseye | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get --no-install-recommends -y install \ | ||
pciutils build-essential git wget \ | ||
lsb-release dpkg-dev curl bsdmainutils fakeroot | ||
RUN mkdir -p /usr/local/share/cosmos-sdk/ | ||
COPY buildlib.sh /usr/local/share/cosmos-sdk/ | ||
RUN mkdir -p /usr/local/share/osmosis/ | ||
|
||
# Deploy the shell functions library. | ||
COPY buildlib.sh /usr/local/share/osmosis/ | ||
|
||
# Create the 'builder' user. | ||
RUN useradd -ms /bin/bash -U builder | ||
ARG APP | ||
ARG DEBUG | ||
ENV APP ${APP:-cosmos-sdk} | ||
ENV DEBUG ${DEBUG} VERSION unknown COMMIT unknown LEDGER_ENABLE true | ||
ARG TARGET_PLATFORMS | ||
ENV APP ${APP:-app} | ||
ENV DEBUG ${DEBUG} | ||
ENV VERSION unknown | ||
ENV COMMIT unknown | ||
ENV LEDGER_ENABLE true | ||
ENV TARGET_PLATFORMS ${TARGET_PLATFORMS:-linux/amd64} | ||
ENV BUILD_SCRIPT ${BUILD_SCRIPT:-/sources/.build.sh} | ||
|
||
# From https://github.com/CosmWasm/wasmd/blob/master/Dockerfile | ||
# For more details see https://github.com/CosmWasm/wasmvm#builds-of-libwasmvm | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta7/libwasmvm_muslc.a /usr/local/lib/libwasmvm_muslc.a | ||
RUN chown builder /usr/local/lib/libwasmvm_muslc.a | ||
RUN sha256sum /usr/local/lib/libwasmvm_muslc.a | grep d0152067a5609bfdfb3f0d5d6c0f2760f79d5f2cd7fd8513cafa9932d22eb350 | ||
|
||
# Drop root privileges. | ||
USER builder:builder | ||
WORKDIR /sources | ||
VOLUME [ "/sources" ] | ||
ENTRYPOINT [ "/sources/build.sh" ] | ||
|
||
# Run the application's build.sh. | ||
ENTRYPOINT [ "/bin/bash", "-c", "${BUILD_SCRIPT}" ] |
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,44 @@ | ||
# Reproducible Build System | ||
|
||
This image and scripts are meant to provide a minimal deterministic | ||
build system for the Osmosis application. | ||
|
||
It was created by referencing Tendermint's [implementation](https://github.com/tendermint/images/blob/cf0d1a9f3731e30540bbfa36a36d13e4dcccf5eb/rbuilder/README.md) | ||
|
||
# Requirements And Usage | ||
|
||
The Osmosis repository must include a`.build.sh` executable file | ||
in the root folder meant to drive the build process. | ||
|
||
The build's outputs are produced in the top-level `artifacts` directory. | ||
|
||
## Building the Image Locally | ||
|
||
``` | ||
cd ./contrib/images | ||
make rbuilder | ||
``` | ||
|
||
This creates the `rbuilder` image. To run a container of this image locally and build the binaries: | ||
``` | ||
cd <osmosis root> | ||
make build-reproducible | ||
``` | ||
|
||
This spins up an `rbuilder` container with a volume installed to the | ||
root of the repository. This way, the builder has access to the `.build.sh`file and is | ||
able to execute it. | ||
|
||
## Wasmvm dependency | ||
|
||
Currently, only `linux/amd64` is supported. Adding more support is blocked by our dependency on wasmvm. | ||
|
||
The support of some platforms is already added in new versions of wasmvm. | ||
Follow the release log for more detaisl when updating our builder: | ||
https://github.com/CosmWasm/wasmvm/releases | ||
|
||
Once wasmvm is upgraded, more platforms may be built by changing | ||
`TARGET_PLATFORMS` environment variable in `build-reproducible` | ||
Makefile step. |
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