Skip to content

Commit f4840e2

Browse files
committed
add node build.
1 parent 31d9876 commit f4840e2

File tree

5 files changed

+90
-35
lines changed

5 files changed

+90
-35
lines changed

.github/workflows/docker-build.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build Docker Images
2+
3+
on:
4+
push:
5+
branches: [ main, movement, ci/* ]
6+
tags:
7+
- 'v*'
8+
- 'release-*'
9+
pull_request:
10+
types: [labeled]
11+
workflow_dispatch:
12+
inputs:
13+
ref:
14+
description: 'Branch, tag, or SHA to build (e.g., main, v1.0.0, abc123)'
15+
required: false
16+
default: ''
17+
GIT_SHA:
18+
description: 'Git SHA to build (deprecated - use ref instead)'
19+
required: false
20+
FEATURES:
21+
description: 'Cargo features to enable'
22+
required: false
23+
PROFILE:
24+
description: 'Cargo build profile'
25+
required: false
26+
default: 'release'
27+
28+
# Add permissions block to ensure the workflow has access to packages
29+
permissions:
30+
contents: read
31+
packages: write
32+
33+
jobs:
34+
build:
35+
runs-on: buildjet-16vcpu-ubuntu-2204
36+
# Only run if it's not a PR event, or if it's a PR with the movement-docker-build label
37+
if: |
38+
github.event_name != 'pull_request' ||
39+
(github.event_name == 'pull_request' && github.event.label.name == 'movement-docker-build')
40+
steps:
41+
- uses: actions/checkout@v3
42+
with:
43+
fetch-depth: 0 # Fetch all history
44+
# For PRs, checkout the PR branch; for manual triggers use provided ref; otherwise use github.ref
45+
ref: ${{ github.event.pull_request.head.sha || github.event.inputs.ref || github.event.inputs.GIT_SHA || github.ref }}
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v2
49+
50+
- name: Login to GitHub Container Registry
51+
uses: docker/login-action@v2
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Build and Push Images
58+
run: |
59+
# Use the original working approach from ci/build branch
60+
export TARGET_CACHE_ID=${GITHUB_REF#refs/heads/}
61+
62+
# Set registry variables for GitHub Container Registry only
63+
export GCP_DOCKER_ARTIFACT_REPO="" # Not using GCP
64+
export AWS_ECR_ACCOUNT_NUM="" # Not using AWS
65+
export TARGET_REGISTRY="ghcr.io"
66+
67+
# GitHub Container Registry configuration
68+
export GHCR_ORG="movementlabsxyz"
69+
export PROFILE=${{ github.event.inputs.PROFILE || 'release' }}
70+
export FEATURES="${{ github.event.inputs.FEATURES }}"
71+
export CARGO_TARGET_DIR="target/${FEATURES:-default}"
72+
73+
# Show build configuration
74+
echo "Building with:"
75+
echo " TARGET_CACHE_ID: $TARGET_CACHE_ID"
76+
echo " PROFILE: $PROFILE"
77+
echo " FEATURES: $FEATURES"
78+
echo " Git SHA: $(git rev-parse HEAD)"
79+
echo " Event: ${{ github.event_name }}"
80+
81+
docker/builder/docker-bake-rust-all.sh

docker/builder/build-indexer.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,11 @@ echo "PROFILE: $PROFILE"
1010

1111
echo "CARGO_TARGET_DIR: $CARGO_TARGET_DIR"
1212

13-
# Build all the rust binaries
14-
cargo build --locked --profile=$PROFILE \
15-
-p aptos-indexer-grpc-cache-worker \
16-
-p aptos-indexer-grpc-file-store \
17-
-p aptos-indexer-grpc-data-service \
18-
-p aptos-nft-metadata-crawler-parser \
19-
-p aptos-indexer-grpc-in-memory-cache-benchmark \
20-
"$@"
13+
# Build all the rust binaries - indexer-grpc components removed as not needed
14+
echo "No indexer binaries to build - skipping cargo build"
2115

2216
# After building, copy the binaries we need to `dist` since the `target` directory is used as docker cache mount and only available during the RUN step
23-
BINS=(
24-
aptos-indexer-grpc-cache-worker
25-
aptos-indexer-grpc-file-store
26-
aptos-indexer-grpc-data-service
27-
aptos-nft-metadata-crawler-parser
28-
aptos-indexer-grpc-in-memory-cache-benchmark
29-
)
17+
BINS=()
3018

3119
mkdir dist
3220

docker/builder/build-tools.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ echo "CARGO_TARGET_DIR: $CARGO_TARGET_DIR"
1111

1212
# Build all the rust binaries
1313
cargo build --locked --profile=$PROFILE \
14-
-p aptos \
14+
-p movement \
1515
-p aptos-backup-cli \
1616
-p aptos-faucet-service \
1717
-p aptos-fn-check-client \
@@ -26,7 +26,7 @@ cargo build --locked --profile=$PROFILE \
2626

2727
# After building, copy the binaries we need to `dist` since the `target` directory is used as docker cache mount and only available during the RUN step
2828
BINS=(
29-
aptos
29+
movement
3030
aptos-faucet-service
3131
aptos-node-checker
3232
aptos-openapi-spec-generator

docker/builder/docker-bake-rust-all.hcl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ group "all" {
5555
"forge",
5656
"telemetry-service",
5757
"keyless-pepper-service",
58-
"indexer-grpc",
5958
"validator-testing",
60-
"nft-metadata-crawler",
6159
])
6260
}
6361

@@ -210,19 +208,7 @@ target "keyless-pepper-service" {
210208
tags = generate_tags("keyless-pepper-service")
211209
}
212210

213-
target "indexer-grpc" {
214-
inherits = ["_common"]
215-
dockerfile = "docker/builder/indexer-grpc.Dockerfile"
216-
target = "indexer-grpc"
217-
tags = generate_tags("indexer-grpc")
218-
}
219211

220-
target "nft-metadata-crawler" {
221-
inherits = ["_common"]
222-
target = "nft-metadata-crawler"
223-
dockerfile = "docker/builder/nft-metadata-crawler.Dockerfile"
224-
tags = generate_tags("nft-metadata-crawler")
225-
}
226212

227213
function "generate_tags" {
228214
params = [target]

docker/builder/tools.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ RUN echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.lis
66

77
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
88
--mount=type=cache,target=/var/lib/apt,sharing=locked \
9-
apt-get update && apt-get --no-install-recommends --allow-downgrades -y \
9+
apt-get update && apt-get --no-install-recommends -y \
1010
install \
1111
wget \
1212
curl \
13-
perl-base=5.32.1-4+deb11u1 \
14-
libtinfo6=6.2+20201114-2+deb11u2 \
13+
perl-base \
14+
libtinfo6 \
1515
git \
1616
libssl1.1 \
1717
ca-certificates \
@@ -33,7 +33,7 @@ RUN wget https://storage.googleapis.com/pub/gsutil.tar.gz -O- | tar --gzip --dir
3333
RUN cd /usr/local/bin && wget "https://storage.googleapis.com/kubernetes-release/release/v1.18.6/bin/linux/amd64/kubectl" -O kubectl && chmod +x kubectl
3434

3535
COPY --link --from=tools-builder /aptos/dist/aptos-debugger /usr/local/bin/aptos-debugger
36-
COPY --link --from=tools-builder /aptos/dist/aptos /usr/local/bin/aptos
36+
COPY --link --from=tools-builder /aptos/dist/movement /usr/local/bin/movement
3737
COPY --link --from=tools-builder /aptos/dist/aptos-openapi-spec-generator /usr/local/bin/aptos-openapi-spec-generator
3838
COPY --link --from=tools-builder /aptos/dist/aptos-fn-check-client /usr/local/bin/aptos-fn-check-client
3939
COPY --link --from=tools-builder /aptos/dist/aptos-transaction-emitter /usr/local/bin/aptos-transaction-emitter

0 commit comments

Comments
 (0)