forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buildsystem: simplify Makefile and ci automation (cosmos#7189)
Move images into contrib/images/. Replace "bad tag" cosmos-sdk/simapp with cosmos-sdk/simd-env. 'simapp' is a misnomer as the images serves only as host environment for the binaries that are in fact built by the developer on their machine. Remove the build-docker-local-simapp target altogether from the Makefile in favor of an inline conditional statement that causes the image to be rebuilt if and only if it had not been built before. simd binary won't run as root anymore as root privileges are dropped upon simd binary installation. Co-authored-by: Marko Baricevic <[email protected]> Co-authored-by: Alexander Bezobchuk <[email protected]> Co-authored-by: Alessio Treglia <[email protected]>
- Loading branch information
1 parent
db9b69d
commit 91ff9fa
Showing
7 changed files
with
76 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
all: simd-env | ||
|
||
simd-env: | ||
docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag cosmossdk/simd-env simd-env | ||
|
||
.PHONY: all simd-env |
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,18 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get -y install curl jq file | ||
|
||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
USER ${UID}:${GID} | ||
VOLUME [ /simd ] | ||
WORKDIR /simd | ||
EXPOSE 26656 26657 | ||
ENTRYPOINT ["/usr/bin/wrapper.sh"] | ||
CMD ["start"] | ||
STOPSIGNAL SIGTERM | ||
|
||
COPY wrapper.sh /usr/bin/wrapper.sh |
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,25 @@ | ||
#!/usr/bin/env sh | ||
|
||
BINARY=/simd/${BINARY:-simd} | ||
ID=${ID:-0} | ||
LOG=${LOG:-simd.log} | ||
|
||
if ! [ -f "${BINARY}" ]; then | ||
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'simd'" | ||
exit 1 | ||
fi | ||
|
||
BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')" | ||
|
||
if [ -z "${BINARY_CHECK}" ]; then | ||
echo "Binary needs to be OS linux, ARCH amd64" | ||
exit 1 | ||
fi | ||
|
||
export SIMDHOME="/simd/node${ID}/simd" | ||
|
||
if [ -d "$(dirname "${SIMDHOME}"/"${LOG}")" ]; then | ||
"${BINARY}" --home "${SIMDHOME}" "$@" | tee "${SIMDHOME}/${LOG}" | ||
else | ||
"${BINARY}" --home "${SIMDHOME}" "$@" | ||
fi |
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