Skip to content

Commit

Permalink
[indexer grpc][docker] add the docker image building script for index…
Browse files Browse the repository at this point in the history
…er grpc. (#6585)
larry-aptos authored Feb 17, 2023

Verified

This commit was signed with the committer’s verified signature.
Nuru Nuru
1 parent d320276 commit 397a412
Showing 4 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker/build-rust-all.sh
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ cargo build --locked --profile=$PROFILE \
-p aptos-telemetry-service \
-p aptos-db-bootstrapper \
-p aptos-transaction-emitter \
-p aptos-indexer-grpc-cache-worker \
-p aptos-indexer-grpc-file-store \
-p aptos-indexer-grpc-data-service \
"$@"

# Build aptos-node separately
@@ -43,6 +46,9 @@ BINS=(
aptos-node-checker
aptos-openapi-spec-generator
aptos-telemetry-service
aptos-indexer-grpc-cache-worker
aptos-indexer-grpc-file-store
aptos-indexer-grpc-data-service
aptos-fn-check-client
db-backup
db-backup-verify
9 changes: 9 additions & 0 deletions docker/docker-bake-rust-all.hcl
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ group "all" {
"faucet",
"forge",
"telemetry-service",
"indexer-grpc",
BUILD_ADDL_TESTING_IMAGES == "true" ? [
"validator-testing"
] : []
@@ -76,6 +77,7 @@ target "_common" {
generate_cache_from("faucet"),
generate_cache_from("forge"),
generate_cache_from("telemetry-service"),
generate_cache_from("indexer-grpc"),

// testing targets
generate_cache_from("validator-testing"),
@@ -146,6 +148,13 @@ target "telemetry-service" {
tags = generate_tags("telemetry-service")
}

target "indexer-grpc" {
inherits = ["_common"]
target = "indexer-grpc"
cache-to = generate_cache_to("indexer-grpc")
tags = generate_tags("indexer-grpc")
}

function "generate_cache_from" {
params = [target]
result = CI == "true" ? [
1 change: 1 addition & 0 deletions docker/retag-rust-images.sh
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ IMAGES=(
faucet
forge
telemetry-service
indexer-grpc
)

for IMAGE in "${IMAGES[@]}"
33 changes: 33 additions & 0 deletions docker/rust-all.Dockerfile
Original file line number Diff line number Diff line change
@@ -274,6 +274,39 @@ ENV GIT_BRANCH ${GIT_BRANCH}
ARG GIT_SHA
ENV GIT_SHA ${GIT_SHA}

### Indexer GRPC Image ###

FROM debian-base AS indexer-grpc

RUN apt-get update && apt-get install -y \
libssl1.1 \
ca-certificates \
net-tools \
tcpdump \
iproute2 \
netcat \
libpq-dev \
curl \
&& apt-get clean && rm -r /var/lib/apt/lists/*

COPY --link --from=builder /aptos/dist/aptos-indexer-grpc-cache-worker /usr/local/bin/aptos-indexer-grpc-cache-worker
COPY --link --from=builder /aptos/dist/aptos-indexer-grpc-file-store /usr/local/bin/aptos-indexer-grpc-file-store
COPY --link --from=builder /aptos/dist/aptos-indexer-grpc-data-service /usr/local/bin/aptos-indexer-grpc-data-service

# The health check port
EXPOSE 8080
# The gRPC port
EXPOSE 50501

ENV RUST_LOG_FORMAT=json

# add build info
ARG GIT_TAG
ENV GIT_TAG ${GIT_TAG}
ARG GIT_BRANCH
ENV GIT_BRANCH ${GIT_BRANCH}
ARG GIT_SHA
ENV GIT_SHA ${GIT_SHA}

### EXPERIMENTAL ###

0 comments on commit 397a412

Please sign in to comment.