forked from Layr-Labs/eigenda
-
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.
'make protoc' now utilizes docker workflow by default. (Layr-Labs#748)
Signed-off-by: Cody Littley <[email protected]>
- Loading branch information
1 parent
09c300e
commit 45f6941
Showing
8 changed files
with
80 additions
and
37 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 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,5 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Cleans the docker image and all cached steps. | ||
docker image rm pbuf-compiler 2> /dev/null || true | ||
docker builder prune -f | ||
# This script finds and deletes all compiled protobufs. | ||
|
||
# The location where this script can be found. | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
API_DIR="${SCRIPT_DIR}/.." | ||
GRPC_DIR="${API_DIR}/grpc" | ||
find "${GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf | ||
|
||
DISPERSER_DIR="$SCRIPT_DIR/../../disperser" | ||
DISPERSER_GRPC_DIR="$DISPERSER_DIR/api/grpc" | ||
find "${DISPERSER_GRPC_DIR}" -name '*.pb.go' -type f | xargs rm -rf |
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script builds the eigenDA protobufs. It does this by running protoc.sh inside of the pbuf-compiler container. | ||
|
||
# The location where this script can be found. | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
ROOT="${SCRIPT_DIR}/../.." | ||
|
||
if [ -z "$(docker images -q pbuf-compiler:latest 2> /dev/null)" ]; then | ||
echo "Docker image pbuf-compiler:latest does not exist. Building it now..." | ||
"${SCRIPT_DIR}"/build-docker.sh | ||
fi | ||
|
||
|
||
docker container run \ | ||
--rm \ | ||
--mount "type=bind,source=${ROOT},target=/home/user/eigenda" \ | ||
pbuf-compiler bash -c "source ~/.bashrc && eigenda/api/builder/protoc.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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script builds the eigenDA protobufs. | ||
|
||
# The location where this script can be found. | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
# Build protobufs in the api/proto directory. | ||
|
||
API_DIR="${SCRIPT_DIR}/.." | ||
PROTO_DIR="${API_DIR}/proto" | ||
GRPC_DIR="${API_DIR}/grpc" | ||
mkdir -p "${GRPC_DIR}" | ||
|
||
protoc -I "${PROTO_DIR}" \ | ||
--go_out="${GRPC_DIR}" \ | ||
--go_opt=paths=source_relative \ | ||
--go-grpc_out="${GRPC_DIR}" \ | ||
--go-grpc_opt=paths=source_relative \ | ||
"${PROTO_DIR}"/**/*.proto | ||
|
||
# Build protobufs in the disperser/api/proto directory. | ||
|
||
DISPERSER_DIR="$SCRIPT_DIR/../../disperser" | ||
DISPERSER_PROTO_DIR="$DISPERSER_DIR/api/proto" | ||
DISPERSER_GRPC_DIR="$DISPERSER_DIR/api/grpc" | ||
mkdir -p "${DISPERSER_GRPC_DIR}" | ||
|
||
protoc -I "${DISPERSER_PROTO_DIR}" -I "${PROTO_DIR}" \ | ||
--go_out="${DISPERSER_GRPC_DIR}" \ | ||
--go_opt=paths=source_relative \ | ||
--go-grpc_out="${DISPERSER_GRPC_DIR}" \ | ||
--go-grpc_opt=paths=source_relative \ | ||
"${DISPERSER_PROTO_DIR}"/**/*.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script fully deletes the pbuf-compiler docker image and all cached steps. | ||
|
||
# Cleans the docker image and all cached steps. | ||
docker image rm pbuf-compiler 2> /dev/null || true | ||
docker builder prune -f |