Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/e2e-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v9.0.2
Expand Down Expand Up @@ -68,9 +71,6 @@ jobs:
go-version: 1.24
id: go

- name: Checkout repository
uses: actions/checkout@v6

- name: Download dependencies for interchaintest
run: |
cd interchaintest && go mod download
Expand Down
171 changes: 171 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
ARG BASE_VERSION=1.24-alpine3.23
FROM golang:${BASE_VERSION} AS init-env

RUN apk add --update --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev ncurses-dev

ARG TARGETARCH
ARG BUILDARCH
ARG GITHUB_ORGANIZATION
ARG REPO_HOST
ARG GITHUB_REPO
ARG WASMVM_VERSION

WORKDIR /go/src/${REPO_HOST}/${GITHUB_ORGANIZATION}/${GITHUB_REPO}

# Download CosmWasm libwasmvm if found
RUN set -eux; \
export ARCH=$(uname -m); \
if [ ! -z "${WASMVM_VERSION}" ]; then\
WASMVM_REPO=$(echo $WASMVM_VERSION | awk '{print $1}');\
WASMVM_VERS=$(echo $WASMVM_VERSION | awk '{print $2}');\
wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
ln /lib/libwasmvm_muslc.a /lib/libwasmvm_muslc.$(uname -m).a;\
fi;

ARG BUILD_DIR

ADD ${BUILD_DIR}/go.mod ${BUILD_DIR}/go.sum ./

ARG CLONE_KEY

RUN if [ ! -z "${CLONE_KEY}" ]; then\
mkdir -p ~/.ssh;\
echo "${CLONE_KEY}" | base64 -d > ~/.ssh/id_ed25519;\
chmod 600 ~/.ssh/id_ed25519;\
apk add openssh;\
git config --global --add url."ssh://git@github.com/".insteadOf "https://github.com/";\
ssh-keyscan github.com >> ~/.ssh/known_hosts;\
fi

ARG VENDOR

# Download go mod dependencies
RUN set -eux; \
if [[ "${BUILD_DIR}" == "." && "${VENDOR}" == "false" ]]; then\
go mod download;\
fi;

# Use minimal busybox from infra-toolkit image
FROM ghcr.io/strangelove-ventures/infra-toolkit:v0.1.12 AS infra-toolkit
RUN addgroup --gid 1025 -S heighliner && adduser --uid 1025 -S heighliner -G heighliner

# Use alpine to source CA certificates
FROM alpine:3 as alpine-3

# Build binary from local source
FROM init-env AS build-env

ARG BUILD_TARGET
ARG BUILD_ENV
ARG BUILD_TAGS
ARG PRE_BUILD
ARG BUILD_DIR

ADD . .

RUN set -eux; \
export CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \
if [ ! -z "$PRE_BUILD" ]; then sh -c "${PRE_BUILD}"; fi; \
if [ ! -z "$BUILD_TARGET" ]; then \
if [ ! -z "$BUILD_ENV" ]; then export ${BUILD_ENV}; fi; \
if [ ! -z "$BUILD_TAGS" ]; then export "${BUILD_TAGS}"; fi; \
if [ ! -z "$BUILD_DIR" ]; then cd "${BUILD_DIR}"; fi; \
sh -c "${BUILD_TARGET}"; \
fi

# Collect binaries
RUN mkdir /root/bin
ARG RACE
ARG BINARIES
ENV BINARIES_ENV ${BINARIES}

RUN bash -c 'set -eux;\
BINARIES_ARR=();\
IFS=, read -ra BINARIES_ARR <<< "$BINARIES_ENV";\
for BINARY in "${BINARIES_ARR[@]}"; do\
BINSPLIT=();\
IFS=: read -ra BINSPLIT <<< "$BINARY";\
BINPATH=${BINSPLIT[1]+"${BINSPLIT[1]}"};\
BIN="$(eval "echo "${BINSPLIT[0]+"${BINSPLIT[0]}"}"")";\
if [ ! -z "$RACE" ] && GOVERSIONOUT=$(go version -m $BIN); then\
if echo $GOVERSIONOUT | grep build | grep "-race=true"; then\
echo "Race detection is enabled in binary";\
else\
echo "Race detection not enabled in binary!";\
exit 1;\
fi;\
fi;\
if [ ! -z "$BINPATH" ]; then\
if [[ $BINPATH == *"/"* ]]; then\
mkdir -p "$(dirname "${BINPATH}")";\
cp "$BIN" "${BINPATH}";\
else\
cp "$BIN" "/root/bin/${BINPATH}";\
fi;\
else\
cp "$BIN" /root/bin/;\
fi;\
done'

# Libraries
RUN mkdir -p /root/lib
ARG LIBRARIES
ENV LIBRARIES_ENV ${LIBRARIES}

RUN bash -c 'set -eux;\
LIBRARIES_ARR=($LIBRARIES_ENV); \
for LIBRARY in "${LIBRARIES_ARR[@]}"; do cp $LIBRARY /root/lib/; done'

# Directories
RUN mkdir -p /root/dir_abs && touch /root/dir_abs.list
ARG DIRECTORIES
ENV DIRECTORIES_ENV ${DIRECTORIES}

RUN bash -c 'set -eux;\
DIRECTORIES_ARR=($DIRECTORIES_ENV);\
i=0;\
for DIRECTORY in "${DIRECTORIES_ARR[@]}"; do \
cp -R $DIRECTORY /root/dir_abs/$i;\
echo $DIRECTORY >> /root/dir_abs.list;\
((i = i + 1));\
done'

# Final image
FROM scratch

LABEL org.opencontainers.image.source="https://github.com/strangelove-ventures/heighliner"

WORKDIR /bin

COPY --from=infra-toolkit /busybox/busybox /bin/sh
COPY --from=infra-toolkit /busybox/busybox /bin/ln
COPY --from=infra-toolkit /usr/local/bin/jq /bin/

RUN for b in \
cat date df dirname du env grep head less ls md5sum mkdir mv pwd rm sed \
sha1sum sha256sum sha3sum sha512sum sleep stty tail tar tee tr vi watch which \
; do ln ln $b; done; \
rm -rf sh; \
ln ln sh;

COPY --from=build-env /root/dir_abs /root/dir_abs
COPY --from=build-env /root/dir_abs.list /root/dir_abs.list

RUN sh -c 'i=0; while read DIR; do\
PLACEDIR="$(dirname "$DIR")";\
mkdir -p "$PLACEDIR";\
mv /root/dir_abs/$i $DIR;\
i=$((i+1));\
done < /root/dir_abs.list'

COPY --from=alpine-3 /etc/ssl/cert.pem /etc/ssl/cert.pem

COPY --from=infra-toolkit /etc/passwd /etc/passwd
COPY --from=infra-toolkit --chown=1025:1025 /home/heighliner /home/heighliner
COPY --from=infra-toolkit --chown=1025:1025 /tmp /tmp

COPY --from=build-env /root/bin /bin
COPY --from=build-env /root/lib /lib

WORKDIR /home/heighliner
USER heighliner
53 changes: 26 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/persistenceOne/persistenceCore/v17

go 1.24
go 1.24.0

toolchain go1.24.6

Expand Down Expand Up @@ -39,18 +39,18 @@ require (
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7
google.golang.org/grpc v1.75.0
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217
google.golang.org/grpc v1.79.3
google.golang.org/protobuf v1.36.11
gopkg.in/yaml.v2 v2.4.0
)

require (
cel.dev/expr v0.24.0 // indirect
cel.dev/expr v0.25.1 // indirect
cloud.google.com/go v0.120.0 // indirect
cloud.google.com/go/auth v0.16.4 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.8.0 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
cloud.google.com/go/monitoring v1.24.2 // indirect
cloud.google.com/go/storage v1.50.0 // indirect
Expand All @@ -62,7 +62,7 @@ require (
github.com/CosmWasm/wasmvm/v2 v2.2.4 // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/zstd v1.5.7 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
Expand All @@ -80,7 +80,7 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/cockroachdb/errors v1.12.0 // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
Expand Down Expand Up @@ -109,14 +109,14 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/emicklei/dot v1.8.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect
github.com/ethereum/go-ethereum v1.15.11 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/getsentry/sentry-go v0.35.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.1 // indirect
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand Down Expand Up @@ -197,46 +197,45 @@ require (
github.com/shamaton/msgpack/v2 v2.2.0 // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ulikunitz/xz v0.5.14 // indirect
github.com/zeebo/errs v1.4.0 // indirect
github.com/zondax/golem v0.27.0 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v1.0.1 // indirect
go.etcd.io/bbolt v1.4.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.opentelemetry.io/otel v1.39.0 // indirect
go.opentelemetry.io/otel/metric v1.39.0 // indirect
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect
go.opentelemetry.io/otel/trace v1.39.0 // indirect
go.uber.org/mock v0.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.17.0 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.12.0 // indirect
google.golang.org/api v0.247.0 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.2 // indirect
nhooyr.io/websocket v1.8.17 // indirect
Expand Down
Loading
Loading