[#3] Added generate proto script create container method
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
parent
9a1b5d778b
commit
1783e4e34c
53 changed files with 1337 additions and 122 deletions
|
@ -6,30 +6,26 @@
|
|||
|
||||
|
||||
# Define directories
|
||||
PROTOS_DIR="./protos"
|
||||
PROTOS_DIR="./frostfs_sdk/protos"
|
||||
SOURCE_DIR="${PROTOS_DIR}/source"
|
||||
MODELS_DIR="${PROTOS_DIR}/models"
|
||||
REPO_FROSTFS_API_PROTOS="https://git.frostfs.info/TrueCloudLab/frostfs-api.git"
|
||||
|
||||
rm -rf "$PROTOS_DIR"
|
||||
|
||||
# Step 1: Create folder ./protos
|
||||
echo "1. Create folder ./protos"
|
||||
mkdir -p "$PROTOS_DIR"
|
||||
|
||||
# Step 2: Cloning repository into ./protos/source
|
||||
echo "2. Cloning repository into ./protos/source..."
|
||||
mkdir -p "$SOURCE_DIR"
|
||||
git clone "$REPO_FROSTFS_API_PROTOS" "$SOURCE_DIR"
|
||||
|
||||
# Step 3: Generating Python code from .proto files
|
||||
echo "3. Generating Python code from .proto files to $MODELS_DIR"
|
||||
mkdir -p "$MODELS_DIR"
|
||||
find "$SOURCE_DIR" -name "*.proto" | while read -r proto_file; do
|
||||
python -m grpc_tools.protoc -I "$SOURCE_DIR" --python_out="$MODELS_DIR" --pyi_out="$MODELS_DIR" --grpc_python_out="$MODELS_DIR" "$proto_file"
|
||||
done
|
||||
|
||||
# Step 4: Making ./protos/models a Python package
|
||||
echo "4. Making ./protos/models a Python package..."
|
||||
touch "$MODELS_DIR/__init__.py"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue