forked from wormhole-foundation/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Containerize protobuf generation and remove node build dep
The Go dependency is still required to build the pack binary. Use "tilt docker" to use Minikube's Docker instance, if available, removing the local Docker dependency for Minikube users. The Makefile continues to not require Docker and runs buf locally. Remove broken Powershell scripts (can't test on Windows). These scripts should now be substantially easier to write. Change-Id: Ie80bf68e0e468a747861bea36fa5b353d9de110d
- Loading branch information
Leo
committed
Aug 26, 2021
1 parent
e98463c
commit 68be226
Showing
10 changed files
with
64 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# syntax=docker.io/docker/dockerfile:experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44 | ||
FROM docker.io/golang:1.17.0@sha256:06e92e576fc7a7067a268d47727f3083c0a564331bfcbfdde633157fc91fb17d AS go-tools | ||
|
||
RUN mkdir /app | ||
|
||
ADD tools/build.sh /app/tools/ | ||
ADD tools/go.* /app/tools/ | ||
|
||
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ | ||
cd /app/tools && CGO_ENABLED=0 ./build.sh | ||
|
||
# syntax=docker.io/docker/dockerfile:experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44 | ||
FROM docker.io/golang:1.17.0@sha256:06e92e576fc7a7067a268d47727f3083c0a564331bfcbfdde633157fc91fb17d AS go-build | ||
|
||
COPY --from=go-tools /app /app | ||
|
||
ADD buf.* /app | ||
ADD proto /app/proto | ||
|
||
RUN --mount=type=cache,target=/root/.cache \ | ||
cd /app && \ | ||
tools/bin/buf lint && \ | ||
tools/bin/buf generate | ||
|
||
FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 AS node-build | ||
|
||
COPY --from=go-tools /app /app | ||
|
||
ADD buf.* /app | ||
ADD proto /app/proto | ||
|
||
ADD tools/package.json /app/tools/ | ||
ADD tools/package-lock.json /app/tools/ | ||
|
||
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/root/.npm \ | ||
cd /app/tools && npm ci | ||
|
||
RUN --mount=type=cache,target=/root/.cache \ | ||
cd /app && \ | ||
tools/bin/buf generate --template buf.gen.web.yaml | ||
|
||
FROM scratch AS go-export | ||
COPY --from=go-build /app/node/pkg/proto pkg/proto | ||
|
||
FROM scratch AS node-export | ||
COPY --from=node-build /app/sdk/js/src/proto sdk/js/src/proto | ||
COPY --from=node-build /app/explorer/src/proto explorer/src/proto |
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 was deleted.
Oops, something went wrong.
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,11 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
( | ||
cd tools/ | ||
npm ci | ||
) | ||
rm -rf explorer/src/proto sdk/js/src/proto | ||
|
||
rm -rf explorer/src/proto | ||
mkdir -p explorer/src/proto | ||
|
||
tools/bin/buf generate --template buf.gen.web.yaml | ||
DOCKER_BUILDKIT=1 tilt docker build -- --target node-export -f Dockerfile.proto -o type=local,dest=. . |
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,15 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
( | ||
cd tools/ | ||
./build.sh | ||
) | ||
|
||
# TODO(leo): remove after a while | ||
rm -rf bridge | ||
|
||
rm -rf node/pkg/proto | ||
|
||
tools/bin/buf lint | ||
tools/bin/buf generate | ||
DOCKER_BUILDKIT=1 tilt docker build -- --target go-export -f Dockerfile.proto -o type=local,dest=node . |
This file was deleted.
Oops, something went wrong.
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