-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: release build scripts #1286
Merged
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
621b7ec
update all builders
p0mvn 952e456
rbuilder images are prefixed by osmolabs
p0mvn 07fca8e
update makefile
p0mvn fc44e74
use root instead of builder user and other minor changes
p0mvn 069ed13
correct lib path in Makefile
p0mvn d4f95c0
LINK_STATICALLY in Makefile
p0mvn 1d1ad14
docs for builder
p0mvn a052b20
update README
p0mvn b2b1579
changelog entry
p0mvn f7b91bd
remove make clean from .build.sh
p0mvn 33a436a
improve readme
p0mvn 802e94e
remove spurious whitespace in Makefile
p0mvn 5844a17
fix formatting for build-reproducible
p0mvn e243e35
update cosmwasm path in makefile
p0mvn 290bb29
copy from /home/builder in build-reproducible
p0mvn 3b38167
change wasm file pemissions to non-root
p0mvn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,35 @@ | ||
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 useradd -ms /bin/bash -U builder | ||
RUN mkdir -p /usr/local/share/osmosis/ | ||
|
||
# Deploy the shell functions library. | ||
COPY buildlib.sh /usr/local/share/osmosis/ | ||
|
||
# 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 /lib/libwasmvm_muslc.a | ||
RUN sha256sum /lib/libwasmvm_muslc.a | grep d0152067a5609bfdfb3f0d5d6c0f2760f79d5f2cd7fd8513cafa9932d22eb350 | ||
|
||
ARG APP | ||
ARG DEBUG | ||
ENV APP ${APP:-cosmos-sdk} | ||
ENV DEBUG ${DEBUG} VERSION unknown COMMIT unknown LEDGER_ENABLE true | ||
USER builder:builder | ||
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} | ||
|
||
WORKDIR /sources | ||
|
||
# Mount the application's 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this leading space right? I thought make file commands have to have no leading spaces for the definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typo that is fixed now. Thanks for catching that
It worked locally for me. I remember we were having issues in CI when having 4 spaces instead of tabs. That seems to be breaking things