Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Add generated grpc protos for ml_metadata
Browse files Browse the repository at this point in the history
* Uses the version from Pipelines
  • Loading branch information
kwasi committed Oct 31, 2019
1 parent 43c43fd commit 13794fc
Show file tree
Hide file tree
Showing 11 changed files with 26,492 additions and 0 deletions.
18 changes: 18 additions & 0 deletions frontend/gen_grpc_web_protos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts"
OUT_DIR="./src/generated"

if [[ ! -d ${OUT_DIR} ]]; then
mkdir ${OUT_DIR}
fi

# Expects protoc to be on your PATH.
#
# From npm/google-protobuf:
# The compiler is not currently available via npm, but you can download a
# pre-built binary on GitHub (look for the protoc-*.zip files under Downloads).
protoc \
--plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \
--js_out="import_style=commonjs,binary:${OUT_DIR}" \
--ts_out="service=grpc-web:${OUT_DIR}" \
src/apis/**/*.proto
15 changes: 15 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
"enzyme-to-json": "^3.3.5",
"license-checker": "^25.0.1",
"react-router-test-context": "^0.1.0",
"ts-protoc-gen": "^0.12.0",
"typescript": "^3.4.5"
},
"scripts": {
"apis": "npm run apis:api && npm run apis:service",
"apis:api": "java -jar swagger-codegen-cli.jar generate -i ../api/api.swagger.json -l typescript-fetch -o ./src/apis/api -c ./swagger-config.json",
"apis:metadata": "bash generate_grpc_web_protos.sh",
"apis:service": "java -jar swagger-codegen-cli.jar generate -i ../api/service.swagger.json -l typescript-fetch -o ./src/apis/service -c ./swagger-config.json",
"build": "react-scripts build",
"docker": "COMMIT_HASH=`git rev-parse HEAD`; docker build -t gcr.io/kubeflow-images-public/metadata-frontend:${COMMIT_HASH} --build-arg COMMIT_HASH=${COMMIT_HASH} --build-arg DATE=\"`date -u`\" .",
Expand Down
Loading

0 comments on commit 13794fc

Please sign in to comment.