From b73f5f70ac4184b56a0a03922731c5f2f69b9566 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin <91209855+snkalinin@users.noreply.github.com> Date: Tue, 16 Nov 2021 14:59:11 +0300 Subject: [PATCH 1/3] [Playground][BEAM-12941][Bugfix] Fix workflows for playground applications (#83) * Update workflows for playground * Attempt to fix tests * Remove continue on error to catch errors * Fix linter problem for backend dockerfile * Update folder to run backend go linter * Moved flutter test to execution via gradle tasks --- .../workflows/build_playground_backend.yml | 14 ++++++++----- .../workflows/build_playground_frontend.yml | 20 +++++++------------ playground/backend/containers/java/Dockerfile | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index 96e8aae9b0d5..bd2868768246 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -17,10 +17,8 @@ name: Build And Deploy Playground Backend Application on: push: - branches: ['master', 'release-*'] tags: 'v*' pull_request: - branches: ['master', 'release-*'] tags: 'v*' paths: ['playground/backend/**'] workflow_dispatch: @@ -45,12 +43,14 @@ jobs: - name: Prepare Go lint env run: "sudo ./playground/backend/env_setup.sh" - name: Run Lint - run: "golangci-lint run internal/..." +# run: "golangci-lint run internal/..." + run: "golangci-lint run cmd/server/..." working-directory: playground/backend/ - continue-on-error: true + - name: Remove default github maven configuration + # This step is a workaround to avoid a decryption issue + run: rm ~/.m2/settings.xml - name: Run Tests run: ./gradlew playground:backend:test - continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -62,12 +62,16 @@ jobs: working-directory: playground/backend/containers/java - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json + if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} + if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew playground:backend:containers:java:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' -Pbase-image='apache/beam_java8_sdk:${{ env.BEAM_VERSION }}' + if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend + if: startsWith(github.ref, 'ref/tags/') diff --git a/.github/workflows/build_playground_frontend.yml b/.github/workflows/build_playground_frontend.yml index 9c2d56a52428..f93e330442b0 100644 --- a/.github/workflows/build_playground_frontend.yml +++ b/.github/workflows/build_playground_frontend.yml @@ -17,12 +17,10 @@ name: Build And Deploy Playground Frontend Application on: push: - branches: ['master', 'release-*'] tags: 'v*' pull_request: - branches: ['master', 'release-*'] tags: 'v*' - paths: ['playground/backend/**'] + paths: ['playground/frontend/**'] workflow_dispatch: jobs: @@ -43,18 +41,10 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' - - name: Prepare Flutter lint - run: "flutter pub add flutter_lints --dev" - working-directory: playground/frontend/ - continue-on-error: true - name: Run Lint - run: "flutter analyze" - working-directory: playground/frontend/ - continue-on-error: true + run: ./gradlew playground:frontend:analyze - name: Run Tests - run: flutter test - working-directory: playground/frontend/ - continue-on-error: true + run: ./gradlew playground:frontend:test - name: install npm uses: actions/setup-node@v2 with: @@ -66,12 +56,16 @@ jobs: working-directory: playground/frontend - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json + if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} + if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew --debug playground:frontend:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' + if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend + if: startsWith(github.ref, 'ref/tags/') diff --git a/playground/backend/containers/java/Dockerfile b/playground/backend/containers/java/Dockerfile index d7275020dcfa..8846368ff8b6 100644 --- a/playground/backend/containers/java/Dockerfile +++ b/playground/backend/containers/java/Dockerfile @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### -ARG BASE_IMAGE +ARG BASE_IMAGE=apache/beam_java8_sdk:latest FROM golang:1.17-buster AS build # Setup Go Environment From d449275b8ebd623760b34981f56c8f62b140ad9d Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 16 Nov 2021 15:07:49 +0300 Subject: [PATCH 2/3] Revert "[Playground][BEAM-12941][Bugfix] Fix workflows for playground applications (#83)" (#88) This reverts commit b73f5f70ac4184b56a0a03922731c5f2f69b9566. --- .../workflows/build_playground_backend.yml | 14 +++++-------- .../workflows/build_playground_frontend.yml | 20 ++++++++++++------- playground/backend/containers/java/Dockerfile | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index bd2868768246..96e8aae9b0d5 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -17,8 +17,10 @@ name: Build And Deploy Playground Backend Application on: push: + branches: ['master', 'release-*'] tags: 'v*' pull_request: + branches: ['master', 'release-*'] tags: 'v*' paths: ['playground/backend/**'] workflow_dispatch: @@ -43,14 +45,12 @@ jobs: - name: Prepare Go lint env run: "sudo ./playground/backend/env_setup.sh" - name: Run Lint -# run: "golangci-lint run internal/..." - run: "golangci-lint run cmd/server/..." + run: "golangci-lint run internal/..." working-directory: playground/backend/ - - name: Remove default github maven configuration - # This step is a workaround to avoid a decryption issue - run: rm ~/.m2/settings.xml + continue-on-error: true - name: Run Tests run: ./gradlew playground:backend:test + continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -62,16 +62,12 @@ jobs: working-directory: playground/backend/containers/java - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json - if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} - if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew playground:backend:containers:java:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' -Pbase-image='apache/beam_java8_sdk:${{ env.BEAM_VERSION }}' - if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend - if: startsWith(github.ref, 'ref/tags/') diff --git a/.github/workflows/build_playground_frontend.yml b/.github/workflows/build_playground_frontend.yml index f93e330442b0..9c2d56a52428 100644 --- a/.github/workflows/build_playground_frontend.yml +++ b/.github/workflows/build_playground_frontend.yml @@ -17,10 +17,12 @@ name: Build And Deploy Playground Frontend Application on: push: + branches: ['master', 'release-*'] tags: 'v*' pull_request: + branches: ['master', 'release-*'] tags: 'v*' - paths: ['playground/frontend/**'] + paths: ['playground/backend/**'] workflow_dispatch: jobs: @@ -41,10 +43,18 @@ jobs: uses: subosito/flutter-action@v1 with: channel: 'stable' + - name: Prepare Flutter lint + run: "flutter pub add flutter_lints --dev" + working-directory: playground/frontend/ + continue-on-error: true - name: Run Lint - run: ./gradlew playground:frontend:analyze + run: "flutter analyze" + working-directory: playground/frontend/ + continue-on-error: true - name: Run Tests - run: ./gradlew playground:frontend:test + run: flutter test + working-directory: playground/frontend/ + continue-on-error: true - name: install npm uses: actions/setup-node@v2 with: @@ -56,16 +66,12 @@ jobs: working-directory: playground/frontend - name: Setup GCP account run: echo ${{ secrets.GCP_ACCESS_KEY }} | base64 -d > /tmp/gcp_access.json - if: startsWith(github.ref, 'ref/tags/') - name: Login to Docker Registry run: cat /tmp/gcp_access.json | docker login -u _json_key --password-stdin https://${{ secrets.REGISTRY_NAME }} - if: startsWith(github.ref, 'ref/tags/') - name: Preapre Build run: ./gradlew --debug playground:frontend:dockerPush -Pdocker-repository-root='${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository' - if: startsWith(github.ref, 'ref/tags/') - name: Deploy Backend Application env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: terraform init && terraform apply -auto-approve -var="project_id=${{ secrets.PROJECT_ID }}" -var="docker_registry_address=${{ secrets.REGISTRY_NAME}}/${{ secrets.PROJECT_ID }}/playground-repository" working-directory: playground/terraform/applications/backend - if: startsWith(github.ref, 'ref/tags/') diff --git a/playground/backend/containers/java/Dockerfile b/playground/backend/containers/java/Dockerfile index 8846368ff8b6..d7275020dcfa 100644 --- a/playground/backend/containers/java/Dockerfile +++ b/playground/backend/containers/java/Dockerfile @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### -ARG BASE_IMAGE=apache/beam_java8_sdk:latest +ARG BASE_IMAGE FROM golang:1.17-buster AS build # Setup Go Environment From bf93c17f2d80e873ca90de61ccf5c727b517131f Mon Sep 17 00:00:00 2001 From: AydarZaynutdinov Date: Mon, 22 Nov 2021 13:40:48 +0300 Subject: [PATCH 3/3] [BEAM-13129][Playground] Added base structure to find and verify beam examples --- playground/infrastructure/api/api_pb2.py | 1059 ----------------- playground/infrastructure/api/api_pb2_grpc.py | 319 ----- playground/infrastructure/api/v1/api_pb2.py | 1039 ++++++++++++++++ .../infrastructure/api/v1/api_pb2_grpc.py | 319 +++++ playground/infrastructure/cd_helper.py | 54 + playground/infrastructure/ci_cd.py | 40 + playground/infrastructure/ci_helper.py | 51 + playground/infrastructure/config.py | 3 + playground/infrastructure/grpc_client.py | 4 +- playground/infrastructure/helper.py | 72 ++ playground/infrastructure/test_cd_helper.py | 28 + playground/infrastructure/test_ci_cd.py | 46 + playground/infrastructure/test_ci_helper.py | 28 + playground/infrastructure/test_grpc_client.py | 17 +- 14 files changed, 1692 insertions(+), 1387 deletions(-) delete mode 100644 playground/infrastructure/api/api_pb2.py delete mode 100644 playground/infrastructure/api/api_pb2_grpc.py create mode 100644 playground/infrastructure/api/v1/api_pb2.py create mode 100644 playground/infrastructure/api/v1/api_pb2_grpc.py create mode 100644 playground/infrastructure/cd_helper.py create mode 100644 playground/infrastructure/ci_cd.py create mode 100644 playground/infrastructure/ci_helper.py create mode 100644 playground/infrastructure/helper.py create mode 100644 playground/infrastructure/test_cd_helper.py create mode 100644 playground/infrastructure/test_ci_cd.py create mode 100644 playground/infrastructure/test_ci_helper.py diff --git a/playground/infrastructure/api/api_pb2.py b/playground/infrastructure/api/api_pb2.py deleted file mode 100644 index 9a59596f92a4..000000000000 --- a/playground/infrastructure/api/api_pb2.py +++ /dev/null @@ -1,1059 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: api.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='api.proto', - package='api.v1', - syntax='proto3', - serialized_options=b'Z6beam.apache.org/playground/backend/internal;playground', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\tapi.proto\x12\x06\x61pi.v1\"8\n\x0eRunCodeRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x18\n\x03sdk\x18\x02 \x01(\x0e\x32\x0b.api.v1.Sdk\"(\n\x0fRunCodeResponse\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"+\n\x12\x43heckStatusRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"5\n\x13\x43heckStatusResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0e\x32\x0e.api.v1.Status\"0\n\x17GetCompileOutputRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"V\n\x18GetCompileOutputResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\x12*\n\x12\x63ompilation_status\x18\x02 \x01(\x0e\x32\x0e.api.v1.Status\",\n\x13GetRunOutputRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"&\n\x14GetRunOutputResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\"+\n\x12GetRunErrorRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"%\n\x13GetRunErrorResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\"F\n\x18GetListOfExamplesRequest\x12\x18\n\x03sdk\x18\x01 \x01(\x0e\x32\x0b.api.v1.Sdk\x12\x10\n\x08\x63\x61tegory\x18\x02 \x01(\t\"e\n\x07\x45xample\x12\x14\n\x0c\x65xample_uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12!\n\x04type\x18\x04 \x01(\x0e\x32\x13.api.v1.ExampleType\"\x9d\x01\n\nCategories\x12\x18\n\x03sdk\x18\x01 \x01(\x0e\x32\x0b.api.v1.Sdk\x12/\n\ncategories\x18\x02 \x03(\x0b\x32\x1b.api.v1.Categories.Category\x1a\x44\n\x08\x43\x61tegory\x12\x15\n\rcategory_name\x18\x01 \x01(\t\x12!\n\x08\x65xamples\x18\x02 \x03(\x0b\x32\x0f.api.v1.Example\"E\n\x19GetListOfExamplesResponse\x12(\n\x0csdk_examples\x18\x01 \x03(\x0b\x32\x12.api.v1.Categories\")\n\x11GetExampleRequest\x12\x14\n\x0c\x65xample_uuid\x18\x01 \x01(\t\"\"\n\x12GetExampleResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t*R\n\x03Sdk\x12\x13\n\x0fSDK_UNSPECIFIED\x10\x00\x12\x0c\n\x08SDK_JAVA\x10\x01\x12\n\n\x06SDK_GO\x10\x02\x12\x0e\n\nSDK_PYTHON\x10\x03\x12\x0c\n\x08SDK_SCIO\x10\x04*\xa3\x02\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x15\n\x11STATUS_VALIDATING\x10\x01\x12\x1b\n\x17STATUS_VALIDATION_ERROR\x10\x02\x12\x14\n\x10STATUS_PREPARING\x10\x03\x12\x1c\n\x18STATUS_PREPARATION_ERROR\x10\x04\x12\x14\n\x10STATUS_COMPILING\x10\x05\x12\x18\n\x14STATUS_COMPILE_ERROR\x10\x06\x12\x14\n\x10STATUS_EXECUTING\x10\x07\x12\x13\n\x0fSTATUS_FINISHED\x10\x08\x12\x14\n\x10STATUS_RUN_ERROR\x10\t\x12\x10\n\x0cSTATUS_ERROR\x10\n\x12\x16\n\x12STATUS_RUN_TIMEOUT\x10\x0b*Z\n\x0b\x45xampleType\x12\x18\n\x14\x45XAMPLE_TYPE_DEFAULT\x10\x00\x12\x15\n\x11\x45XAMPLE_TYPE_KATA\x10\x01\x12\x1a\n\x16\x45XAMPLE_TYPE_UNIT_TEST\x10\x02\x32\xed\x04\n\x11PlaygroundService\x12:\n\x07RunCode\x12\x16.api.v1.RunCodeRequest\x1a\x17.api.v1.RunCodeResponse\x12\x46\n\x0b\x43heckStatus\x12\x1a.api.v1.CheckStatusRequest\x1a\x1b.api.v1.CheckStatusResponse\x12I\n\x0cGetRunOutput\x12\x1b.api.v1.GetRunOutputRequest\x1a\x1c.api.v1.GetRunOutputResponse\x12\x46\n\x0bGetRunError\x12\x1a.api.v1.GetRunErrorRequest\x1a\x1b.api.v1.GetRunErrorResponse\x12U\n\x10GetCompileOutput\x12\x1f.api.v1.GetCompileOutputRequest\x1a .api.v1.GetCompileOutputResponse\x12X\n\x11GetListOfExamples\x12 .api.v1.GetListOfExamplesRequest\x1a!.api.v1.GetListOfExamplesResponse\x12\x43\n\nGetExample\x12\x19.api.v1.GetExampleRequest\x1a\x1a.api.v1.GetExampleResponse\x12K\n\x10GetExampleOutput\x12\x19.api.v1.GetExampleRequest\x1a\x1c.api.v1.GetRunOutputResponseB8Z6beam.apache.org/playground/backend/internal;playgroundb\x06proto3' -) - -_SDK = _descriptor.EnumDescriptor( - name='Sdk', - full_name='api.v1.Sdk', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SDK_UNSPECIFIED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SDK_JAVA', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SDK_GO', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SDK_PYTHON', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SDK_SCIO', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=1014, - serialized_end=1096, -) -_sym_db.RegisterEnumDescriptor(_SDK) - -Sdk = enum_type_wrapper.EnumTypeWrapper(_SDK) -_STATUS = _descriptor.EnumDescriptor( - name='Status', - full_name='api.v1.Status', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='STATUS_UNSPECIFIED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_VALIDATING', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_VALIDATION_ERROR', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_PREPARING', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_PREPARATION_ERROR', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_COMPILING', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_COMPILE_ERROR', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_EXECUTING', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_FINISHED', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_RUN_ERROR', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_ERROR', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='STATUS_RUN_TIMEOUT', index=11, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=1099, - serialized_end=1390, -) -_sym_db.RegisterEnumDescriptor(_STATUS) - -Status = enum_type_wrapper.EnumTypeWrapper(_STATUS) -_EXAMPLETYPE = _descriptor.EnumDescriptor( - name='ExampleType', - full_name='api.v1.ExampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EXAMPLE_TYPE_DEFAULT', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EXAMPLE_TYPE_KATA', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EXAMPLE_TYPE_UNIT_TEST', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=1392, - serialized_end=1482, -) -_sym_db.RegisterEnumDescriptor(_EXAMPLETYPE) - -ExampleType = enum_type_wrapper.EnumTypeWrapper(_EXAMPLETYPE) -SDK_UNSPECIFIED = 0 -SDK_JAVA = 1 -SDK_GO = 2 -SDK_PYTHON = 3 -SDK_SCIO = 4 -STATUS_UNSPECIFIED = 0 -STATUS_VALIDATING = 1 -STATUS_VALIDATION_ERROR = 2 -STATUS_PREPARING = 3 -STATUS_PREPARATION_ERROR = 4 -STATUS_COMPILING = 5 -STATUS_COMPILE_ERROR = 6 -STATUS_EXECUTING = 7 -STATUS_FINISHED = 8 -STATUS_RUN_ERROR = 9 -STATUS_ERROR = 10 -STATUS_RUN_TIMEOUT = 11 -EXAMPLE_TYPE_DEFAULT = 0 -EXAMPLE_TYPE_KATA = 1 -EXAMPLE_TYPE_UNIT_TEST = 2 - - - -_RUNCODEREQUEST = _descriptor.Descriptor( - name='RunCodeRequest', - full_name='api.v1.RunCodeRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='code', full_name='api.v1.RunCodeRequest.code', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sdk', full_name='api.v1.RunCodeRequest.sdk', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=21, - serialized_end=77, -) - - -_RUNCODERESPONSE = _descriptor.Descriptor( - name='RunCodeResponse', - full_name='api.v1.RunCodeResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='pipeline_uuid', full_name='api.v1.RunCodeResponse.pipeline_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=79, - serialized_end=119, -) - - -_CHECKSTATUSREQUEST = _descriptor.Descriptor( - name='CheckStatusRequest', - full_name='api.v1.CheckStatusRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='pipeline_uuid', full_name='api.v1.CheckStatusRequest.pipeline_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=121, - serialized_end=164, -) - - -_CHECKSTATUSRESPONSE = _descriptor.Descriptor( - name='CheckStatusResponse', - full_name='api.v1.CheckStatusResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='api.v1.CheckStatusResponse.status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=166, - serialized_end=219, -) - - -_GETCOMPILEOUTPUTREQUEST = _descriptor.Descriptor( - name='GetCompileOutputRequest', - full_name='api.v1.GetCompileOutputRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='pipeline_uuid', full_name='api.v1.GetCompileOutputRequest.pipeline_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=221, - serialized_end=269, -) - - -_GETCOMPILEOUTPUTRESPONSE = _descriptor.Descriptor( - name='GetCompileOutputResponse', - full_name='api.v1.GetCompileOutputResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='output', full_name='api.v1.GetCompileOutputResponse.output', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='compilation_status', full_name='api.v1.GetCompileOutputResponse.compilation_status', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=271, - serialized_end=357, -) - - -_GETRUNOUTPUTREQUEST = _descriptor.Descriptor( - name='GetRunOutputRequest', - full_name='api.v1.GetRunOutputRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='pipeline_uuid', full_name='api.v1.GetRunOutputRequest.pipeline_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=359, - serialized_end=403, -) - - -_GETRUNOUTPUTRESPONSE = _descriptor.Descriptor( - name='GetRunOutputResponse', - full_name='api.v1.GetRunOutputResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='output', full_name='api.v1.GetRunOutputResponse.output', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=405, - serialized_end=443, -) - - -_GETRUNERRORREQUEST = _descriptor.Descriptor( - name='GetRunErrorRequest', - full_name='api.v1.GetRunErrorRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='pipeline_uuid', full_name='api.v1.GetRunErrorRequest.pipeline_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=445, - serialized_end=488, -) - - -_GETRUNERRORRESPONSE = _descriptor.Descriptor( - name='GetRunErrorResponse', - full_name='api.v1.GetRunErrorResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='output', full_name='api.v1.GetRunErrorResponse.output', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=490, - serialized_end=527, -) - - -_GETLISTOFEXAMPLESREQUEST = _descriptor.Descriptor( - name='GetListOfExamplesRequest', - full_name='api.v1.GetListOfExamplesRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='sdk', full_name='api.v1.GetListOfExamplesRequest.sdk', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='category', full_name='api.v1.GetListOfExamplesRequest.category', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=529, - serialized_end=599, -) - - -_EXAMPLE = _descriptor.Descriptor( - name='Example', - full_name='api.v1.Example', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='example_uuid', full_name='api.v1.Example.example_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='name', full_name='api.v1.Example.name', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='description', full_name='api.v1.Example.description', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='type', full_name='api.v1.Example.type', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=601, - serialized_end=702, -) - - -_CATEGORIES_CATEGORY = _descriptor.Descriptor( - name='Category', - full_name='api.v1.Categories.Category', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='category_name', full_name='api.v1.Categories.Category.category_name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='examples', full_name='api.v1.Categories.Category.examples', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=794, - serialized_end=862, -) - -_CATEGORIES = _descriptor.Descriptor( - name='Categories', - full_name='api.v1.Categories', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='sdk', full_name='api.v1.Categories.sdk', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='categories', full_name='api.v1.Categories.categories', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_CATEGORIES_CATEGORY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=705, - serialized_end=862, -) - - -_GETLISTOFEXAMPLESRESPONSE = _descriptor.Descriptor( - name='GetListOfExamplesResponse', - full_name='api.v1.GetListOfExamplesResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='sdk_examples', full_name='api.v1.GetListOfExamplesResponse.sdk_examples', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=864, - serialized_end=933, -) - - -_GETEXAMPLEREQUEST = _descriptor.Descriptor( - name='GetExampleRequest', - full_name='api.v1.GetExampleRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='example_uuid', full_name='api.v1.GetExampleRequest.example_uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=935, - serialized_end=976, -) - - -_GETEXAMPLERESPONSE = _descriptor.Descriptor( - name='GetExampleResponse', - full_name='api.v1.GetExampleResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='code', full_name='api.v1.GetExampleResponse.code', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=978, - serialized_end=1012, -) - -_RUNCODEREQUEST.fields_by_name['sdk'].enum_type = _SDK -_CHECKSTATUSRESPONSE.fields_by_name['status'].enum_type = _STATUS -_GETCOMPILEOUTPUTRESPONSE.fields_by_name['compilation_status'].enum_type = _STATUS -_GETLISTOFEXAMPLESREQUEST.fields_by_name['sdk'].enum_type = _SDK -_EXAMPLE.fields_by_name['type'].enum_type = _EXAMPLETYPE -_CATEGORIES_CATEGORY.fields_by_name['examples'].message_type = _EXAMPLE -_CATEGORIES_CATEGORY.containing_type = _CATEGORIES -_CATEGORIES.fields_by_name['sdk'].enum_type = _SDK -_CATEGORIES.fields_by_name['categories'].message_type = _CATEGORIES_CATEGORY -_GETLISTOFEXAMPLESRESPONSE.fields_by_name['sdk_examples'].message_type = _CATEGORIES -DESCRIPTOR.message_types_by_name['RunCodeRequest'] = _RUNCODEREQUEST -DESCRIPTOR.message_types_by_name['RunCodeResponse'] = _RUNCODERESPONSE -DESCRIPTOR.message_types_by_name['CheckStatusRequest'] = _CHECKSTATUSREQUEST -DESCRIPTOR.message_types_by_name['CheckStatusResponse'] = _CHECKSTATUSRESPONSE -DESCRIPTOR.message_types_by_name['GetCompileOutputRequest'] = _GETCOMPILEOUTPUTREQUEST -DESCRIPTOR.message_types_by_name['GetCompileOutputResponse'] = _GETCOMPILEOUTPUTRESPONSE -DESCRIPTOR.message_types_by_name['GetRunOutputRequest'] = _GETRUNOUTPUTREQUEST -DESCRIPTOR.message_types_by_name['GetRunOutputResponse'] = _GETRUNOUTPUTRESPONSE -DESCRIPTOR.message_types_by_name['GetRunErrorRequest'] = _GETRUNERRORREQUEST -DESCRIPTOR.message_types_by_name['GetRunErrorResponse'] = _GETRUNERRORRESPONSE -DESCRIPTOR.message_types_by_name['GetListOfExamplesRequest'] = _GETLISTOFEXAMPLESREQUEST -DESCRIPTOR.message_types_by_name['Example'] = _EXAMPLE -DESCRIPTOR.message_types_by_name['Categories'] = _CATEGORIES -DESCRIPTOR.message_types_by_name['GetListOfExamplesResponse'] = _GETLISTOFEXAMPLESRESPONSE -DESCRIPTOR.message_types_by_name['GetExampleRequest'] = _GETEXAMPLEREQUEST -DESCRIPTOR.message_types_by_name['GetExampleResponse'] = _GETEXAMPLERESPONSE -DESCRIPTOR.enum_types_by_name['Sdk'] = _SDK -DESCRIPTOR.enum_types_by_name['Status'] = _STATUS -DESCRIPTOR.enum_types_by_name['ExampleType'] = _EXAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -RunCodeRequest = _reflection.GeneratedProtocolMessageType('RunCodeRequest', (_message.Message,), { - 'DESCRIPTOR' : _RUNCODEREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.RunCodeRequest) - }) -_sym_db.RegisterMessage(RunCodeRequest) - -RunCodeResponse = _reflection.GeneratedProtocolMessageType('RunCodeResponse', (_message.Message,), { - 'DESCRIPTOR' : _RUNCODERESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.RunCodeResponse) - }) -_sym_db.RegisterMessage(RunCodeResponse) - -CheckStatusRequest = _reflection.GeneratedProtocolMessageType('CheckStatusRequest', (_message.Message,), { - 'DESCRIPTOR' : _CHECKSTATUSREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.CheckStatusRequest) - }) -_sym_db.RegisterMessage(CheckStatusRequest) - -CheckStatusResponse = _reflection.GeneratedProtocolMessageType('CheckStatusResponse', (_message.Message,), { - 'DESCRIPTOR' : _CHECKSTATUSRESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.CheckStatusResponse) - }) -_sym_db.RegisterMessage(CheckStatusResponse) - -GetCompileOutputRequest = _reflection.GeneratedProtocolMessageType('GetCompileOutputRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETCOMPILEOUTPUTREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetCompileOutputRequest) - }) -_sym_db.RegisterMessage(GetCompileOutputRequest) - -GetCompileOutputResponse = _reflection.GeneratedProtocolMessageType('GetCompileOutputResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETCOMPILEOUTPUTRESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetCompileOutputResponse) - }) -_sym_db.RegisterMessage(GetCompileOutputResponse) - -GetRunOutputRequest = _reflection.GeneratedProtocolMessageType('GetRunOutputRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETRUNOUTPUTREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetRunOutputRequest) - }) -_sym_db.RegisterMessage(GetRunOutputRequest) - -GetRunOutputResponse = _reflection.GeneratedProtocolMessageType('GetRunOutputResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETRUNOUTPUTRESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetRunOutputResponse) - }) -_sym_db.RegisterMessage(GetRunOutputResponse) - -GetRunErrorRequest = _reflection.GeneratedProtocolMessageType('GetRunErrorRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETRUNERRORREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetRunErrorRequest) - }) -_sym_db.RegisterMessage(GetRunErrorRequest) - -GetRunErrorResponse = _reflection.GeneratedProtocolMessageType('GetRunErrorResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETRUNERRORRESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetRunErrorResponse) - }) -_sym_db.RegisterMessage(GetRunErrorResponse) - -GetListOfExamplesRequest = _reflection.GeneratedProtocolMessageType('GetListOfExamplesRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETLISTOFEXAMPLESREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetListOfExamplesRequest) - }) -_sym_db.RegisterMessage(GetListOfExamplesRequest) - -Example = _reflection.GeneratedProtocolMessageType('Example', (_message.Message,), { - 'DESCRIPTOR' : _EXAMPLE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.Example) - }) -_sym_db.RegisterMessage(Example) - -Categories = _reflection.GeneratedProtocolMessageType('Categories', (_message.Message,), { - - 'Category' : _reflection.GeneratedProtocolMessageType('Category', (_message.Message,), { - 'DESCRIPTOR' : _CATEGORIES_CATEGORY, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.Categories.Category) - }) - , - 'DESCRIPTOR' : _CATEGORIES, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.Categories) - }) -_sym_db.RegisterMessage(Categories) -_sym_db.RegisterMessage(Categories.Category) - -GetListOfExamplesResponse = _reflection.GeneratedProtocolMessageType('GetListOfExamplesResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETLISTOFEXAMPLESRESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetListOfExamplesResponse) - }) -_sym_db.RegisterMessage(GetListOfExamplesResponse) - -GetExampleRequest = _reflection.GeneratedProtocolMessageType('GetExampleRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETEXAMPLEREQUEST, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetExampleRequest) - }) -_sym_db.RegisterMessage(GetExampleRequest) - -GetExampleResponse = _reflection.GeneratedProtocolMessageType('GetExampleResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETEXAMPLERESPONSE, - '__module__' : 'api_pb2' - # @@protoc_insertion_point(class_scope:api.v1.GetExampleResponse) - }) -_sym_db.RegisterMessage(GetExampleResponse) - - -DESCRIPTOR._options = None - -_PLAYGROUNDSERVICE = _descriptor.ServiceDescriptor( - name='PlaygroundService', - full_name='api.v1.PlaygroundService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=1485, - serialized_end=2106, - methods=[ - _descriptor.MethodDescriptor( - name='RunCode', - full_name='api.v1.PlaygroundService.RunCode', - index=0, - containing_service=None, - input_type=_RUNCODEREQUEST, - output_type=_RUNCODERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CheckStatus', - full_name='api.v1.PlaygroundService.CheckStatus', - index=1, - containing_service=None, - input_type=_CHECKSTATUSREQUEST, - output_type=_CHECKSTATUSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetRunOutput', - full_name='api.v1.PlaygroundService.GetRunOutput', - index=2, - containing_service=None, - input_type=_GETRUNOUTPUTREQUEST, - output_type=_GETRUNOUTPUTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetRunError', - full_name='api.v1.PlaygroundService.GetRunError', - index=3, - containing_service=None, - input_type=_GETRUNERRORREQUEST, - output_type=_GETRUNERRORRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetCompileOutput', - full_name='api.v1.PlaygroundService.GetCompileOutput', - index=4, - containing_service=None, - input_type=_GETCOMPILEOUTPUTREQUEST, - output_type=_GETCOMPILEOUTPUTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetListOfExamples', - full_name='api.v1.PlaygroundService.GetListOfExamples', - index=5, - containing_service=None, - input_type=_GETLISTOFEXAMPLESREQUEST, - output_type=_GETLISTOFEXAMPLESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetExample', - full_name='api.v1.PlaygroundService.GetExample', - index=6, - containing_service=None, - input_type=_GETEXAMPLEREQUEST, - output_type=_GETEXAMPLERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetExampleOutput', - full_name='api.v1.PlaygroundService.GetExampleOutput', - index=7, - containing_service=None, - input_type=_GETEXAMPLEREQUEST, - output_type=_GETRUNOUTPUTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_PLAYGROUNDSERVICE) - -DESCRIPTOR.services_by_name['PlaygroundService'] = _PLAYGROUNDSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/playground/infrastructure/api/api_pb2_grpc.py b/playground/infrastructure/api/api_pb2_grpc.py deleted file mode 100644 index 0fbf5cfa9bcf..000000000000 --- a/playground/infrastructure/api/api_pb2_grpc.py +++ /dev/null @@ -1,319 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -from . import api_pb2 as api__pb2 - - -class PlaygroundServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.RunCode = channel.unary_unary( - '/api.v1.PlaygroundService/RunCode', - request_serializer=api__pb2.RunCodeRequest.SerializeToString, - response_deserializer=api__pb2.RunCodeResponse.FromString, - ) - self.CheckStatus = channel.unary_unary( - '/api.v1.PlaygroundService/CheckStatus', - request_serializer=api__pb2.CheckStatusRequest.SerializeToString, - response_deserializer=api__pb2.CheckStatusResponse.FromString, - ) - self.GetRunOutput = channel.unary_unary( - '/api.v1.PlaygroundService/GetRunOutput', - request_serializer=api__pb2.GetRunOutputRequest.SerializeToString, - response_deserializer=api__pb2.GetRunOutputResponse.FromString, - ) - self.GetRunError = channel.unary_unary( - '/api.v1.PlaygroundService/GetRunError', - request_serializer=api__pb2.GetRunErrorRequest.SerializeToString, - response_deserializer=api__pb2.GetRunErrorResponse.FromString, - ) - self.GetCompileOutput = channel.unary_unary( - '/api.v1.PlaygroundService/GetCompileOutput', - request_serializer=api__pb2.GetCompileOutputRequest.SerializeToString, - response_deserializer=api__pb2.GetCompileOutputResponse.FromString, - ) - self.GetListOfExamples = channel.unary_unary( - '/api.v1.PlaygroundService/GetListOfExamples', - request_serializer=api__pb2.GetListOfExamplesRequest.SerializeToString, - response_deserializer=api__pb2.GetListOfExamplesResponse.FromString, - ) - self.GetExample = channel.unary_unary( - '/api.v1.PlaygroundService/GetExample', - request_serializer=api__pb2.GetExampleRequest.SerializeToString, - response_deserializer=api__pb2.GetExampleResponse.FromString, - ) - self.GetExampleOutput = channel.unary_unary( - '/api.v1.PlaygroundService/GetExampleOutput', - request_serializer=api__pb2.GetExampleRequest.SerializeToString, - response_deserializer=api__pb2.GetRunOutputResponse.FromString, - ) - - -class PlaygroundServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def RunCode(self, request, context): - """Submit the job for an execution and get the pipeline uuid. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CheckStatus(self, request, context): - """Get the status of pipeline execution. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetRunOutput(self, request, context): - """Get the result of pipeline execution. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetRunError(self, request, context): - """Get the error of pipeline execution. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetCompileOutput(self, request, context): - """Get the result of pipeline compilation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetListOfExamples(self, request, context): - """Get the list of precompiled examples. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetExample(self, request, context): - """Get the code of an example. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetExampleOutput(self, request, context): - """Get the precompiled details of an example. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_PlaygroundServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'RunCode': grpc.unary_unary_rpc_method_handler( - servicer.RunCode, - request_deserializer=api__pb2.RunCodeRequest.FromString, - response_serializer=api__pb2.RunCodeResponse.SerializeToString, - ), - 'CheckStatus': grpc.unary_unary_rpc_method_handler( - servicer.CheckStatus, - request_deserializer=api__pb2.CheckStatusRequest.FromString, - response_serializer=api__pb2.CheckStatusResponse.SerializeToString, - ), - 'GetRunOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetRunOutput, - request_deserializer=api__pb2.GetRunOutputRequest.FromString, - response_serializer=api__pb2.GetRunOutputResponse.SerializeToString, - ), - 'GetRunError': grpc.unary_unary_rpc_method_handler( - servicer.GetRunError, - request_deserializer=api__pb2.GetRunErrorRequest.FromString, - response_serializer=api__pb2.GetRunErrorResponse.SerializeToString, - ), - 'GetCompileOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetCompileOutput, - request_deserializer=api__pb2.GetCompileOutputRequest.FromString, - response_serializer=api__pb2.GetCompileOutputResponse.SerializeToString, - ), - 'GetListOfExamples': grpc.unary_unary_rpc_method_handler( - servicer.GetListOfExamples, - request_deserializer=api__pb2.GetListOfExamplesRequest.FromString, - response_serializer=api__pb2.GetListOfExamplesResponse.SerializeToString, - ), - 'GetExample': grpc.unary_unary_rpc_method_handler( - servicer.GetExample, - request_deserializer=api__pb2.GetExampleRequest.FromString, - response_serializer=api__pb2.GetExampleResponse.SerializeToString, - ), - 'GetExampleOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetExampleOutput, - request_deserializer=api__pb2.GetExampleRequest.FromString, - response_serializer=api__pb2.GetRunOutputResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'api.v1.PlaygroundService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class PlaygroundService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def RunCode(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/RunCode', - api__pb2.RunCodeRequest.SerializeToString, - api__pb2.RunCodeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def CheckStatus(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/CheckStatus', - api__pb2.CheckStatusRequest.SerializeToString, - api__pb2.CheckStatusResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetRunOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetRunOutput', - api__pb2.GetRunOutputRequest.SerializeToString, - api__pb2.GetRunOutputResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetRunError(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetRunError', - api__pb2.GetRunErrorRequest.SerializeToString, - api__pb2.GetRunErrorResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetCompileOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetCompileOutput', - api__pb2.GetCompileOutputRequest.SerializeToString, - api__pb2.GetCompileOutputResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetListOfExamples(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetListOfExamples', - api__pb2.GetListOfExamplesRequest.SerializeToString, - api__pb2.GetListOfExamplesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetExample(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetExample', - api__pb2.GetExampleRequest.SerializeToString, - api__pb2.GetExampleResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetExampleOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetExampleOutput', - api__pb2.GetExampleRequest.SerializeToString, - api__pb2.GetRunOutputResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/playground/infrastructure/api/v1/api_pb2.py b/playground/infrastructure/api/v1/api_pb2.py new file mode 100644 index 000000000000..11aab06d3d06 --- /dev/null +++ b/playground/infrastructure/api/v1/api_pb2.py @@ -0,0 +1,1039 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: api.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + +DESCRIPTOR = _descriptor.FileDescriptor( + name='api.proto', + package='api.v1', + syntax='proto3', + serialized_options=b'Z6beam.apache.org/playground/backend/internal;playground', + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\tapi.proto\x12\x06\x61pi.v1\"8\n\x0eRunCodeRequest\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x18\n\x03sdk\x18\x02 \x01(\x0e\x32\x0b.api.v1.Sdk\"(\n\x0fRunCodeResponse\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"+\n\x12\x43heckStatusRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"5\n\x13\x43heckStatusResponse\x12\x1e\n\x06status\x18\x01 \x01(\x0e\x32\x0e.api.v1.Status\"0\n\x17GetCompileOutputRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"V\n\x18GetCompileOutputResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\x12*\n\x12\x63ompilation_status\x18\x02 \x01(\x0e\x32\x0e.api.v1.Status\",\n\x13GetRunOutputRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"&\n\x14GetRunOutputResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\"+\n\x12GetRunErrorRequest\x12\x15\n\rpipeline_uuid\x18\x01 \x01(\t\"%\n\x13GetRunErrorResponse\x12\x0e\n\x06output\x18\x01 \x01(\t\"F\n\x18GetListOfExamplesRequest\x12\x18\n\x03sdk\x18\x01 \x01(\x0e\x32\x0b.api.v1.Sdk\x12\x10\n\x08\x63\x61tegory\x18\x02 \x01(\t\"e\n\x07\x45xample\x12\x14\n\x0c\x65xample_uuid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12!\n\x04type\x18\x04 \x01(\x0e\x32\x13.api.v1.ExampleType\"\x9d\x01\n\nCategories\x12\x18\n\x03sdk\x18\x01 \x01(\x0e\x32\x0b.api.v1.Sdk\x12/\n\ncategories\x18\x02 \x03(\x0b\x32\x1b.api.v1.Categories.Category\x1a\x44\n\x08\x43\x61tegory\x12\x15\n\rcategory_name\x18\x01 \x01(\t\x12!\n\x08\x65xamples\x18\x02 \x03(\x0b\x32\x0f.api.v1.Example\"E\n\x19GetListOfExamplesResponse\x12(\n\x0csdk_examples\x18\x01 \x03(\x0b\x32\x12.api.v1.Categories\")\n\x11GetExampleRequest\x12\x14\n\x0c\x65xample_uuid\x18\x01 \x01(\t\"\"\n\x12GetExampleResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t*R\n\x03Sdk\x12\x13\n\x0fSDK_UNSPECIFIED\x10\x00\x12\x0c\n\x08SDK_JAVA\x10\x01\x12\n\n\x06SDK_GO\x10\x02\x12\x0e\n\nSDK_PYTHON\x10\x03\x12\x0c\n\x08SDK_SCIO\x10\x04*\xa3\x02\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x15\n\x11STATUS_VALIDATING\x10\x01\x12\x1b\n\x17STATUS_VALIDATION_ERROR\x10\x02\x12\x14\n\x10STATUS_PREPARING\x10\x03\x12\x1c\n\x18STATUS_PREPARATION_ERROR\x10\x04\x12\x14\n\x10STATUS_COMPILING\x10\x05\x12\x18\n\x14STATUS_COMPILE_ERROR\x10\x06\x12\x14\n\x10STATUS_EXECUTING\x10\x07\x12\x13\n\x0fSTATUS_FINISHED\x10\x08\x12\x14\n\x10STATUS_RUN_ERROR\x10\t\x12\x10\n\x0cSTATUS_ERROR\x10\n\x12\x16\n\x12STATUS_RUN_TIMEOUT\x10\x0b*Z\n\x0b\x45xampleType\x12\x18\n\x14\x45XAMPLE_TYPE_DEFAULT\x10\x00\x12\x15\n\x11\x45XAMPLE_TYPE_KATA\x10\x01\x12\x1a\n\x16\x45XAMPLE_TYPE_UNIT_TEST\x10\x02\x32\xed\x04\n\x11PlaygroundService\x12:\n\x07RunCode\x12\x16.api.v1.RunCodeRequest\x1a\x17.api.v1.RunCodeResponse\x12\x46\n\x0b\x43heckStatus\x12\x1a.api.v1.CheckStatusRequest\x1a\x1b.api.v1.CheckStatusResponse\x12I\n\x0cGetRunOutput\x12\x1b.api.v1.GetRunOutputRequest\x1a\x1c.api.v1.GetRunOutputResponse\x12\x46\n\x0bGetRunError\x12\x1a.api.v1.GetRunErrorRequest\x1a\x1b.api.v1.GetRunErrorResponse\x12U\n\x10GetCompileOutput\x12\x1f.api.v1.GetCompileOutputRequest\x1a .api.v1.GetCompileOutputResponse\x12X\n\x11GetListOfExamples\x12 .api.v1.GetListOfExamplesRequest\x1a!.api.v1.GetListOfExamplesResponse\x12\x43\n\nGetExample\x12\x19.api.v1.GetExampleRequest\x1a\x1a.api.v1.GetExampleResponse\x12K\n\x10GetExampleOutput\x12\x19.api.v1.GetExampleRequest\x1a\x1c.api.v1.GetRunOutputResponseB8Z6beam.apache.org/playground/backend/internal;playgroundb\x06proto3' +) + +_SDK = _descriptor.EnumDescriptor( + name='Sdk', + full_name='api.v1.Sdk', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SDK_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SDK_JAVA', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SDK_GO', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SDK_PYTHON', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SDK_SCIO', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1014, + serialized_end=1096, +) +_sym_db.RegisterEnumDescriptor(_SDK) + +Sdk = enum_type_wrapper.EnumTypeWrapper(_SDK) +_STATUS = _descriptor.EnumDescriptor( + name='Status', + full_name='api.v1.Status', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='STATUS_UNSPECIFIED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_VALIDATING', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_VALIDATION_ERROR', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_PREPARING', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_PREPARATION_ERROR', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_COMPILING', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_COMPILE_ERROR', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_EXECUTING', index=7, number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_FINISHED', index=8, number=8, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_RUN_ERROR', index=9, number=9, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_ERROR', index=10, number=10, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATUS_RUN_TIMEOUT', index=11, number=11, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1099, + serialized_end=1390, +) +_sym_db.RegisterEnumDescriptor(_STATUS) + +Status = enum_type_wrapper.EnumTypeWrapper(_STATUS) +_EXAMPLETYPE = _descriptor.EnumDescriptor( + name='ExampleType', + full_name='api.v1.ExampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='EXAMPLE_TYPE_DEFAULT', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EXAMPLE_TYPE_KATA', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='EXAMPLE_TYPE_UNIT_TEST', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1392, + serialized_end=1482, +) +_sym_db.RegisterEnumDescriptor(_EXAMPLETYPE) + +ExampleType = enum_type_wrapper.EnumTypeWrapper(_EXAMPLETYPE) +SDK_UNSPECIFIED = 0 +SDK_JAVA = 1 +SDK_GO = 2 +SDK_PYTHON = 3 +SDK_SCIO = 4 +STATUS_UNSPECIFIED = 0 +STATUS_VALIDATING = 1 +STATUS_VALIDATION_ERROR = 2 +STATUS_PREPARING = 3 +STATUS_PREPARATION_ERROR = 4 +STATUS_COMPILING = 5 +STATUS_COMPILE_ERROR = 6 +STATUS_EXECUTING = 7 +STATUS_FINISHED = 8 +STATUS_RUN_ERROR = 9 +STATUS_ERROR = 10 +STATUS_RUN_TIMEOUT = 11 +EXAMPLE_TYPE_DEFAULT = 0 +EXAMPLE_TYPE_KATA = 1 +EXAMPLE_TYPE_UNIT_TEST = 2 + +_RUNCODEREQUEST = _descriptor.Descriptor( + name='RunCodeRequest', + full_name='api.v1.RunCodeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='code', full_name='api.v1.RunCodeRequest.code', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sdk', full_name='api.v1.RunCodeRequest.sdk', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=21, + serialized_end=77, +) + +_RUNCODERESPONSE = _descriptor.Descriptor( + name='RunCodeResponse', + full_name='api.v1.RunCodeResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pipeline_uuid', full_name='api.v1.RunCodeResponse.pipeline_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=79, + serialized_end=119, +) + +_CHECKSTATUSREQUEST = _descriptor.Descriptor( + name='CheckStatusRequest', + full_name='api.v1.CheckStatusRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pipeline_uuid', full_name='api.v1.CheckStatusRequest.pipeline_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=121, + serialized_end=164, +) + +_CHECKSTATUSRESPONSE = _descriptor.Descriptor( + name='CheckStatusResponse', + full_name='api.v1.CheckStatusResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='status', full_name='api.v1.CheckStatusResponse.status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=166, + serialized_end=219, +) + +_GETCOMPILEOUTPUTREQUEST = _descriptor.Descriptor( + name='GetCompileOutputRequest', + full_name='api.v1.GetCompileOutputRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pipeline_uuid', full_name='api.v1.GetCompileOutputRequest.pipeline_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=221, + serialized_end=269, +) + +_GETCOMPILEOUTPUTRESPONSE = _descriptor.Descriptor( + name='GetCompileOutputResponse', + full_name='api.v1.GetCompileOutputResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='output', full_name='api.v1.GetCompileOutputResponse.output', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='compilation_status', full_name='api.v1.GetCompileOutputResponse.compilation_status', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=271, + serialized_end=357, +) + +_GETRUNOUTPUTREQUEST = _descriptor.Descriptor( + name='GetRunOutputRequest', + full_name='api.v1.GetRunOutputRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pipeline_uuid', full_name='api.v1.GetRunOutputRequest.pipeline_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=359, + serialized_end=403, +) + +_GETRUNOUTPUTRESPONSE = _descriptor.Descriptor( + name='GetRunOutputResponse', + full_name='api.v1.GetRunOutputResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='output', full_name='api.v1.GetRunOutputResponse.output', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=405, + serialized_end=443, +) + +_GETRUNERRORREQUEST = _descriptor.Descriptor( + name='GetRunErrorRequest', + full_name='api.v1.GetRunErrorRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='pipeline_uuid', full_name='api.v1.GetRunErrorRequest.pipeline_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=445, + serialized_end=488, +) + +_GETRUNERRORRESPONSE = _descriptor.Descriptor( + name='GetRunErrorResponse', + full_name='api.v1.GetRunErrorResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='output', full_name='api.v1.GetRunErrorResponse.output', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=490, + serialized_end=527, +) + +_GETLISTOFEXAMPLESREQUEST = _descriptor.Descriptor( + name='GetListOfExamplesRequest', + full_name='api.v1.GetListOfExamplesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='sdk', full_name='api.v1.GetListOfExamplesRequest.sdk', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='category', full_name='api.v1.GetListOfExamplesRequest.category', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=529, + serialized_end=599, +) + +_EXAMPLE = _descriptor.Descriptor( + name='Example', + full_name='api.v1.Example', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='example_uuid', full_name='api.v1.Example.example_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='name', full_name='api.v1.Example.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='description', full_name='api.v1.Example.description', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='type', full_name='api.v1.Example.type', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=601, + serialized_end=702, +) + +_CATEGORIES_CATEGORY = _descriptor.Descriptor( + name='Category', + full_name='api.v1.Categories.Category', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='category_name', full_name='api.v1.Categories.Category.category_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='examples', full_name='api.v1.Categories.Category.examples', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=794, + serialized_end=862, +) + +_CATEGORIES = _descriptor.Descriptor( + name='Categories', + full_name='api.v1.Categories', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='sdk', full_name='api.v1.Categories.sdk', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='categories', full_name='api.v1.Categories.categories', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_CATEGORIES_CATEGORY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=705, + serialized_end=862, +) + +_GETLISTOFEXAMPLESRESPONSE = _descriptor.Descriptor( + name='GetListOfExamplesResponse', + full_name='api.v1.GetListOfExamplesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='sdk_examples', full_name='api.v1.GetListOfExamplesResponse.sdk_examples', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=864, + serialized_end=933, +) + +_GETEXAMPLEREQUEST = _descriptor.Descriptor( + name='GetExampleRequest', + full_name='api.v1.GetExampleRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='example_uuid', full_name='api.v1.GetExampleRequest.example_uuid', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=935, + serialized_end=976, +) + +_GETEXAMPLERESPONSE = _descriptor.Descriptor( + name='GetExampleResponse', + full_name='api.v1.GetExampleResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='code', full_name='api.v1.GetExampleResponse.code', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=978, + serialized_end=1012, +) + +_RUNCODEREQUEST.fields_by_name['sdk'].enum_type = _SDK +_CHECKSTATUSRESPONSE.fields_by_name['status'].enum_type = _STATUS +_GETCOMPILEOUTPUTRESPONSE.fields_by_name['compilation_status'].enum_type = _STATUS +_GETLISTOFEXAMPLESREQUEST.fields_by_name['sdk'].enum_type = _SDK +_EXAMPLE.fields_by_name['type'].enum_type = _EXAMPLETYPE +_CATEGORIES_CATEGORY.fields_by_name['examples'].message_type = _EXAMPLE +_CATEGORIES_CATEGORY.containing_type = _CATEGORIES +_CATEGORIES.fields_by_name['sdk'].enum_type = _SDK +_CATEGORIES.fields_by_name['categories'].message_type = _CATEGORIES_CATEGORY +_GETLISTOFEXAMPLESRESPONSE.fields_by_name['sdk_examples'].message_type = _CATEGORIES +DESCRIPTOR.message_types_by_name['RunCodeRequest'] = _RUNCODEREQUEST +DESCRIPTOR.message_types_by_name['RunCodeResponse'] = _RUNCODERESPONSE +DESCRIPTOR.message_types_by_name['CheckStatusRequest'] = _CHECKSTATUSREQUEST +DESCRIPTOR.message_types_by_name['CheckStatusResponse'] = _CHECKSTATUSRESPONSE +DESCRIPTOR.message_types_by_name['GetCompileOutputRequest'] = _GETCOMPILEOUTPUTREQUEST +DESCRIPTOR.message_types_by_name['GetCompileOutputResponse'] = _GETCOMPILEOUTPUTRESPONSE +DESCRIPTOR.message_types_by_name['GetRunOutputRequest'] = _GETRUNOUTPUTREQUEST +DESCRIPTOR.message_types_by_name['GetRunOutputResponse'] = _GETRUNOUTPUTRESPONSE +DESCRIPTOR.message_types_by_name['GetRunErrorRequest'] = _GETRUNERRORREQUEST +DESCRIPTOR.message_types_by_name['GetRunErrorResponse'] = _GETRUNERRORRESPONSE +DESCRIPTOR.message_types_by_name['GetListOfExamplesRequest'] = _GETLISTOFEXAMPLESREQUEST +DESCRIPTOR.message_types_by_name['Example'] = _EXAMPLE +DESCRIPTOR.message_types_by_name['Categories'] = _CATEGORIES +DESCRIPTOR.message_types_by_name['GetListOfExamplesResponse'] = _GETLISTOFEXAMPLESRESPONSE +DESCRIPTOR.message_types_by_name['GetExampleRequest'] = _GETEXAMPLEREQUEST +DESCRIPTOR.message_types_by_name['GetExampleResponse'] = _GETEXAMPLERESPONSE +DESCRIPTOR.enum_types_by_name['Sdk'] = _SDK +DESCRIPTOR.enum_types_by_name['Status'] = _STATUS +DESCRIPTOR.enum_types_by_name['ExampleType'] = _EXAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +RunCodeRequest = _reflection.GeneratedProtocolMessageType('RunCodeRequest', (_message.Message,), { + 'DESCRIPTOR': _RUNCODEREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.RunCodeRequest) +}) +_sym_db.RegisterMessage(RunCodeRequest) + +RunCodeResponse = _reflection.GeneratedProtocolMessageType('RunCodeResponse', (_message.Message,), { + 'DESCRIPTOR': _RUNCODERESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.RunCodeResponse) +}) +_sym_db.RegisterMessage(RunCodeResponse) + +CheckStatusRequest = _reflection.GeneratedProtocolMessageType('CheckStatusRequest', (_message.Message,), { + 'DESCRIPTOR': _CHECKSTATUSREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.CheckStatusRequest) +}) +_sym_db.RegisterMessage(CheckStatusRequest) + +CheckStatusResponse = _reflection.GeneratedProtocolMessageType('CheckStatusResponse', (_message.Message,), { + 'DESCRIPTOR': _CHECKSTATUSRESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.CheckStatusResponse) +}) +_sym_db.RegisterMessage(CheckStatusResponse) + +GetCompileOutputRequest = _reflection.GeneratedProtocolMessageType('GetCompileOutputRequest', (_message.Message,), { + 'DESCRIPTOR': _GETCOMPILEOUTPUTREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetCompileOutputRequest) +}) +_sym_db.RegisterMessage(GetCompileOutputRequest) + +GetCompileOutputResponse = _reflection.GeneratedProtocolMessageType('GetCompileOutputResponse', (_message.Message,), { + 'DESCRIPTOR': _GETCOMPILEOUTPUTRESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetCompileOutputResponse) +}) +_sym_db.RegisterMessage(GetCompileOutputResponse) + +GetRunOutputRequest = _reflection.GeneratedProtocolMessageType('GetRunOutputRequest', (_message.Message,), { + 'DESCRIPTOR': _GETRUNOUTPUTREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetRunOutputRequest) +}) +_sym_db.RegisterMessage(GetRunOutputRequest) + +GetRunOutputResponse = _reflection.GeneratedProtocolMessageType('GetRunOutputResponse', (_message.Message,), { + 'DESCRIPTOR': _GETRUNOUTPUTRESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetRunOutputResponse) +}) +_sym_db.RegisterMessage(GetRunOutputResponse) + +GetRunErrorRequest = _reflection.GeneratedProtocolMessageType('GetRunErrorRequest', (_message.Message,), { + 'DESCRIPTOR': _GETRUNERRORREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetRunErrorRequest) +}) +_sym_db.RegisterMessage(GetRunErrorRequest) + +GetRunErrorResponse = _reflection.GeneratedProtocolMessageType('GetRunErrorResponse', (_message.Message,), { + 'DESCRIPTOR': _GETRUNERRORRESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetRunErrorResponse) +}) +_sym_db.RegisterMessage(GetRunErrorResponse) + +GetListOfExamplesRequest = _reflection.GeneratedProtocolMessageType('GetListOfExamplesRequest', (_message.Message,), { + 'DESCRIPTOR': _GETLISTOFEXAMPLESREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetListOfExamplesRequest) +}) +_sym_db.RegisterMessage(GetListOfExamplesRequest) + +Example = _reflection.GeneratedProtocolMessageType('Example', (_message.Message,), { + 'DESCRIPTOR': _EXAMPLE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.Example) +}) +_sym_db.RegisterMessage(Example) + +Categories = _reflection.GeneratedProtocolMessageType('Categories', (_message.Message,), { + + 'Category': _reflection.GeneratedProtocolMessageType('Category', (_message.Message,), { + 'DESCRIPTOR': _CATEGORIES_CATEGORY, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.Categories.Category) + }) + , + 'DESCRIPTOR': _CATEGORIES, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.Categories) +}) +_sym_db.RegisterMessage(Categories) +_sym_db.RegisterMessage(Categories.Category) + +GetListOfExamplesResponse = _reflection.GeneratedProtocolMessageType('GetListOfExamplesResponse', (_message.Message,), { + 'DESCRIPTOR': _GETLISTOFEXAMPLESRESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetListOfExamplesResponse) +}) +_sym_db.RegisterMessage(GetListOfExamplesResponse) + +GetExampleRequest = _reflection.GeneratedProtocolMessageType('GetExampleRequest', (_message.Message,), { + 'DESCRIPTOR': _GETEXAMPLEREQUEST, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetExampleRequest) +}) +_sym_db.RegisterMessage(GetExampleRequest) + +GetExampleResponse = _reflection.GeneratedProtocolMessageType('GetExampleResponse', (_message.Message,), { + 'DESCRIPTOR': _GETEXAMPLERESPONSE, + '__module__': 'api_pb2' + # @@protoc_insertion_point(class_scope:api.v1.GetExampleResponse) +}) +_sym_db.RegisterMessage(GetExampleResponse) + +DESCRIPTOR._options = None + +_PLAYGROUNDSERVICE = _descriptor.ServiceDescriptor( + name='PlaygroundService', + full_name='api.v1.PlaygroundService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=1485, + serialized_end=2106, + methods=[ + _descriptor.MethodDescriptor( + name='RunCode', + full_name='api.v1.PlaygroundService.RunCode', + index=0, + containing_service=None, + input_type=_RUNCODEREQUEST, + output_type=_RUNCODERESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='CheckStatus', + full_name='api.v1.PlaygroundService.CheckStatus', + index=1, + containing_service=None, + input_type=_CHECKSTATUSREQUEST, + output_type=_CHECKSTATUSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetRunOutput', + full_name='api.v1.PlaygroundService.GetRunOutput', + index=2, + containing_service=None, + input_type=_GETRUNOUTPUTREQUEST, + output_type=_GETRUNOUTPUTRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetRunError', + full_name='api.v1.PlaygroundService.GetRunError', + index=3, + containing_service=None, + input_type=_GETRUNERRORREQUEST, + output_type=_GETRUNERRORRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetCompileOutput', + full_name='api.v1.PlaygroundService.GetCompileOutput', + index=4, + containing_service=None, + input_type=_GETCOMPILEOUTPUTREQUEST, + output_type=_GETCOMPILEOUTPUTRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetListOfExamples', + full_name='api.v1.PlaygroundService.GetListOfExamples', + index=5, + containing_service=None, + input_type=_GETLISTOFEXAMPLESREQUEST, + output_type=_GETLISTOFEXAMPLESRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetExample', + full_name='api.v1.PlaygroundService.GetExample', + index=6, + containing_service=None, + input_type=_GETEXAMPLEREQUEST, + output_type=_GETEXAMPLERESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetExampleOutput', + full_name='api.v1.PlaygroundService.GetExampleOutput', + index=7, + containing_service=None, + input_type=_GETEXAMPLEREQUEST, + output_type=_GETRUNOUTPUTRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + ]) +_sym_db.RegisterServiceDescriptor(_PLAYGROUNDSERVICE) + +DESCRIPTOR.services_by_name['PlaygroundService'] = _PLAYGROUNDSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/playground/infrastructure/api/v1/api_pb2_grpc.py b/playground/infrastructure/api/v1/api_pb2_grpc.py new file mode 100644 index 000000000000..ef83f6d2f858 --- /dev/null +++ b/playground/infrastructure/api/v1/api_pb2_grpc.py @@ -0,0 +1,319 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +from api.v1 import api_pb2 as api__pb2 + + +class PlaygroundServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RunCode = channel.unary_unary( + '/api.v1.PlaygroundService/RunCode', + request_serializer=api__pb2.RunCodeRequest.SerializeToString, + response_deserializer=api__pb2.RunCodeResponse.FromString, + ) + self.CheckStatus = channel.unary_unary( + '/api.v1.PlaygroundService/CheckStatus', + request_serializer=api__pb2.CheckStatusRequest.SerializeToString, + response_deserializer=api__pb2.CheckStatusResponse.FromString, + ) + self.GetRunOutput = channel.unary_unary( + '/api.v1.PlaygroundService/GetRunOutput', + request_serializer=api__pb2.GetRunOutputRequest.SerializeToString, + response_deserializer=api__pb2.GetRunOutputResponse.FromString, + ) + self.GetRunError = channel.unary_unary( + '/api.v1.PlaygroundService/GetRunError', + request_serializer=api__pb2.GetRunErrorRequest.SerializeToString, + response_deserializer=api__pb2.GetRunErrorResponse.FromString, + ) + self.GetCompileOutput = channel.unary_unary( + '/api.v1.PlaygroundService/GetCompileOutput', + request_serializer=api__pb2.GetCompileOutputRequest.SerializeToString, + response_deserializer=api__pb2.GetCompileOutputResponse.FromString, + ) + self.GetListOfExamples = channel.unary_unary( + '/api.v1.PlaygroundService/GetListOfExamples', + request_serializer=api__pb2.GetListOfExamplesRequest.SerializeToString, + response_deserializer=api__pb2.GetListOfExamplesResponse.FromString, + ) + self.GetExample = channel.unary_unary( + '/api.v1.PlaygroundService/GetExample', + request_serializer=api__pb2.GetExampleRequest.SerializeToString, + response_deserializer=api__pb2.GetExampleResponse.FromString, + ) + self.GetExampleOutput = channel.unary_unary( + '/api.v1.PlaygroundService/GetExampleOutput', + request_serializer=api__pb2.GetExampleRequest.SerializeToString, + response_deserializer=api__pb2.GetRunOutputResponse.FromString, + ) + + +class PlaygroundServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def RunCode(self, request, context): + """Submit the job for an execution and get the pipeline uuid. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CheckStatus(self, request, context): + """Get the status of pipeline execution. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetRunOutput(self, request, context): + """Get the result of pipeline execution. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetRunError(self, request, context): + """Get the error of pipeline execution. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetCompileOutput(self, request, context): + """Get the result of pipeline compilation. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetListOfExamples(self, request, context): + """Get the list of precompiled examples. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetExample(self, request, context): + """Get the code of an example. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetExampleOutput(self, request, context): + """Get the precompiled details of an example. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_PlaygroundServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RunCode': grpc.unary_unary_rpc_method_handler( + servicer.RunCode, + request_deserializer=api__pb2.RunCodeRequest.FromString, + response_serializer=api__pb2.RunCodeResponse.SerializeToString, + ), + 'CheckStatus': grpc.unary_unary_rpc_method_handler( + servicer.CheckStatus, + request_deserializer=api__pb2.CheckStatusRequest.FromString, + response_serializer=api__pb2.CheckStatusResponse.SerializeToString, + ), + 'GetRunOutput': grpc.unary_unary_rpc_method_handler( + servicer.GetRunOutput, + request_deserializer=api__pb2.GetRunOutputRequest.FromString, + response_serializer=api__pb2.GetRunOutputResponse.SerializeToString, + ), + 'GetRunError': grpc.unary_unary_rpc_method_handler( + servicer.GetRunError, + request_deserializer=api__pb2.GetRunErrorRequest.FromString, + response_serializer=api__pb2.GetRunErrorResponse.SerializeToString, + ), + 'GetCompileOutput': grpc.unary_unary_rpc_method_handler( + servicer.GetCompileOutput, + request_deserializer=api__pb2.GetCompileOutputRequest.FromString, + response_serializer=api__pb2.GetCompileOutputResponse.SerializeToString, + ), + 'GetListOfExamples': grpc.unary_unary_rpc_method_handler( + servicer.GetListOfExamples, + request_deserializer=api__pb2.GetListOfExamplesRequest.FromString, + response_serializer=api__pb2.GetListOfExamplesResponse.SerializeToString, + ), + 'GetExample': grpc.unary_unary_rpc_method_handler( + servicer.GetExample, + request_deserializer=api__pb2.GetExampleRequest.FromString, + response_serializer=api__pb2.GetExampleResponse.SerializeToString, + ), + 'GetExampleOutput': grpc.unary_unary_rpc_method_handler( + servicer.GetExampleOutput, + request_deserializer=api__pb2.GetExampleRequest.FromString, + response_serializer=api__pb2.GetRunOutputResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'api.v1.PlaygroundService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class PlaygroundService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def RunCode(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/RunCode', + api__pb2.RunCodeRequest.SerializeToString, + api__pb2.RunCodeResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CheckStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/CheckStatus', + api__pb2.CheckStatusRequest.SerializeToString, + api__pb2.CheckStatusResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetRunOutput(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetRunOutput', + api__pb2.GetRunOutputRequest.SerializeToString, + api__pb2.GetRunOutputResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetRunError(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetRunError', + api__pb2.GetRunErrorRequest.SerializeToString, + api__pb2.GetRunErrorResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetCompileOutput(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetCompileOutput', + api__pb2.GetCompileOutputRequest.SerializeToString, + api__pb2.GetCompileOutputResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetListOfExamples(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetListOfExamples', + api__pb2.GetListOfExamplesRequest.SerializeToString, + api__pb2.GetListOfExamplesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetExample(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetExample', + api__pb2.GetExampleRequest.SerializeToString, + api__pb2.GetExampleResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def GetExampleOutput(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/api.v1.PlaygroundService/GetExampleOutput', + api__pb2.GetExampleRequest.SerializeToString, + api__pb2.GetRunOutputResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/playground/infrastructure/cd_helper.py b/playground/infrastructure/cd_helper.py new file mode 100644 index 000000000000..d597102f5f91 --- /dev/null +++ b/playground/infrastructure/cd_helper.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import List +from helper import Example + + +class CDHelper: + """ + Helper for CD step. + + It is used to save beam examples/katas/tests and their output on the Google Cloud. + """ + + def store_examples(self, examples: List[Example]): + """ + Store beam examples and their output in the Google Cloud. + """ + self._run_code(examples) + self._save_to_cloud(examples) + + def _run_code(self, examples: List[Example]): + """ + Run beam examples and keep their ouput. + + Call the backend to start code processing for the examples. Then receive code output. + + Args: + examples: beam examples that should be run + """ + # TODO [BEAM-13258] Implement logic + pass + + def _save_to_cloud(self, examples: List[Example]): + """ + Save beam examples and their output using backend instance. + + Args: + examples: beam examples with their output + """ + # TODO [BEAM-13258] Implement logic of saving examples + pass diff --git a/playground/infrastructure/ci_cd.py b/playground/infrastructure/ci_cd.py new file mode 100644 index 000000000000..23312c63878b --- /dev/null +++ b/playground/infrastructure/ci_cd.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +from cd_helper import CDHelper +from ci_helper import CIHelper +from helper import find_examples + + +def ci_step(): + """ + CI step to verify all beam examples/tests/katas + """ + root_dir = os.getenv("BEAM_ROOT_DIR") + ci_helper = CIHelper() + examples = find_examples(root_dir) + ci_helper.verify_examples(examples) + + +def cd_step(): + """ + CD step to save all beam examples/tests/katas and their outputs on the Google Cloud + """ + root_dir = os.getenv("BEAM_ROOT_DIR") + cd_helper = CDHelper() + examples = find_examples(root_dir) + cd_helper.store_examples(examples) diff --git a/playground/infrastructure/ci_helper.py b/playground/infrastructure/ci_helper.py new file mode 100644 index 000000000000..2822b732f6e8 --- /dev/null +++ b/playground/infrastructure/ci_helper.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import List +from helper import Example, get_statuses + + +class CIHelper: + """ + Helper for CI step. + + It is used to find and verify correctness if beam examples/katas/tests. + """ + + def verify_examples(self, examples: List[Example]): + """ + Verify correctness of beam examples. + + 1. Find all beam examples starting from directory os.getenv("BEAM_ROOT_DIR"). + 2. Group code of examples by their SDK. + 3. Run processing for all examples to verify examples' code. + """ + get_statuses(examples) + self._verify_examples_status(examples) + + def _verify_examples_status(self, examples: List[Example]): + """ + Verify statuses of beam examples. + + Check example.status for each examples. If the status of the example is: + - STATUS_VALIDATION_ERROR/STATUS_PREPARATION_ERROR/STATUS_ERROR/STATUS_RUN_TIMEOUT: log error + - STATUS_COMPILE_ERROR: get logs using GetCompileOutput request and log them with error. + - STATUS_RUN_ERROR: get logs using GetRunError request and log them with error. + + Args: + examples: beam examples that should be verified + """ + # TODO [BEAM-13256] Implement + pass diff --git a/playground/infrastructure/config.py b/playground/infrastructure/config.py index 21da2d010fa3..33e1ed7bfbaf 100644 --- a/playground/infrastructure/config.py +++ b/playground/infrastructure/config.py @@ -16,7 +16,10 @@ import os from dataclasses import dataclass +from api.v1.api_pb2 import SDK_JAVA + @dataclass(frozen=True) class Config: SERVER_ADDRESS = os.getenv("SERVER_ADDRESS", "localhost:8080") + SUPPORTED_SDK = {'java': SDK_JAVA} diff --git a/playground/infrastructure/grpc_client.py b/playground/infrastructure/grpc_client.py index 9e4e0dc74968..3b5279952c97 100644 --- a/playground/infrastructure/grpc_client.py +++ b/playground/infrastructure/grpc_client.py @@ -16,8 +16,8 @@ import grpc -from infrastructure.api import api_pb2_grpc, api_pb2 -from infrastructure.config import Config +from api.v1 import api_pb2_grpc, api_pb2 +from config import Config class GRPCClient: diff --git a/playground/infrastructure/helper.py b/playground/infrastructure/helper.py new file mode 100644 index 000000000000..0c1a72c88a3f --- /dev/null +++ b/playground/infrastructure/helper.py @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from dataclasses import dataclass +from typing import List +from api.v1.api_pb2 import SDK_UNSPECIFIED, STATUS_UNSPECIFIED + + +@dataclass +class Example: + """ + Class which contains all information about beam example + """ + name: str + pipeline_id: str + sdk: SDK_UNSPECIFIED + filepath: str + code: str + output: str + status: STATUS_UNSPECIFIED + + +def find_examples(work_dir: str) -> List[Example]: + """ + Find and return beam examples. + + Search throws all child files of work_dir directory files with beam tag: + Beam-playground: + name: NameOfExample + description: Description of NameOfExample. + multifile: false + categories: + - category-1 + - category-2 + + Args: + work_dir: directory where to search examples. + + Returns: + List of Examples. + """ + # TODO [BEAM-13135] Implement + pass + + +def get_statuses(examples: List[Example]): + """ + Receive statuses for examples and update example.status and example.pipelineId + + Use client to send requests to the backend: + 1. Start code processing. + 2. Ping the backend while status is STATUS_VALIDATING/STATUS_PREPARING/STATUS_COMPILING/STATUS_EXECUTING + Update example.pipelineId with resulting pipelineId. + Update example.status with resulting status. + + Args: + examples: beam examples for processing and updating statuses. + """ + # TODO [BEAM-13267] Implement + pass diff --git a/playground/infrastructure/test_cd_helper.py b/playground/infrastructure/test_cd_helper.py new file mode 100644 index 000000000000..ab4ae7ae7d48 --- /dev/null +++ b/playground/infrastructure/test_cd_helper.py @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import mock + +from cd_helper import CDHelper + + +@mock.patch('cd_helper.CDHelper._save_to_cloud') +@mock.patch('cd_helper.CDHelper._run_code') +def test_store_examples(mock_run_code, mock_save_to_cloud): + helper = CDHelper() + helper.store_examples([]) + + mock_run_code.assert_called_once_with([]) + mock_save_to_cloud.assert_called_once_with([]) diff --git a/playground/infrastructure/test_ci_cd.py b/playground/infrastructure/test_ci_cd.py new file mode 100644 index 000000000000..07032c70361b --- /dev/null +++ b/playground/infrastructure/test_ci_cd.py @@ -0,0 +1,46 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import mock + +from ci_cd import ci_step, cd_step + + +@mock.patch('ci_helper.CIHelper.verify_examples') +@mock.patch('ci_cd.find_examples') +@mock.patch('ci_cd.os.getenv') +def test_ci_step(mock_os_getenv, mock_find_examples, mock_verify_examples): + mock_os_getenv.return_value = "MOCK_VALUE" + mock_find_examples.return_value = [] + + ci_step() + + mock_os_getenv.assert_called_once_with("BEAM_ROOT_DIR") + mock_find_examples.assert_called_once_with("MOCK_VALUE") + mock_verify_examples.assert_called_once_with([]) + + +@mock.patch('cd_helper.CDHelper.store_examples') +@mock.patch('ci_cd.find_examples') +@mock.patch('ci_cd.os.getenv') +def test_cd_step(mock_os_getenv, mock_find_examples, mock_store_examples): + mock_os_getenv.return_value = "MOCK_VALUE" + mock_find_examples.return_value = [] + + cd_step() + + mock_os_getenv.assert_called_once_with("BEAM_ROOT_DIR") + mock_find_examples.assert_called_once_with("MOCK_VALUE") + mock_store_examples.assert_called_once_with([]) diff --git a/playground/infrastructure/test_ci_helper.py b/playground/infrastructure/test_ci_helper.py new file mode 100644 index 000000000000..65cc8285159f --- /dev/null +++ b/playground/infrastructure/test_ci_helper.py @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import mock + +from ci_helper import CIHelper + + +@mock.patch('ci_helper.CIHelper._verify_examples_status') +@mock.patch('ci_helper.get_statuses') +def test_verify_examples(mock_get_statuses, mock_verify_examples_statuses): + helper = CIHelper() + helper.verify_examples([]) + + mock_get_statuses.assert_called_once_with([]) + mock_verify_examples_statuses.assert_called_once_with([]) diff --git a/playground/infrastructure/test_grpc_client.py b/playground/infrastructure/test_grpc_client.py index 627733149441..8302fa2ba9c8 100644 --- a/playground/infrastructure/test_grpc_client.py +++ b/playground/infrastructure/test_grpc_client.py @@ -17,42 +17,42 @@ from unittest.mock import AsyncMock import pytest -from infrastructure.api import api_pb2 -from infrastructure.grpc_client import GRPCClient +from api.v1 import api_pb2 +from grpc_client import GRPCClient @pytest.fixture() def mock_run_code(mocker): async_mock = AsyncMock(return_value=str(uuid.uuid4())) - mocker.patch('infrastructure.grpc_client.GRPCClient.run_code', side_effect=async_mock) + mocker.patch('grpc_client.GRPCClient.run_code', side_effect=async_mock) return async_mock @pytest.fixture() def mock_check_status(mocker): async_mock = AsyncMock(return_value=api_pb2.STATUS_FINISHED) - mocker.patch('infrastructure.grpc_client.GRPCClient.check_status', side_effect=async_mock) + mocker.patch('grpc_client.GRPCClient.check_status', side_effect=async_mock) return async_mock @pytest.fixture() def mock_get_run_error(mocker): async_mock = AsyncMock(return_value="MOCK_ERROR") - mocker.patch('infrastructure.grpc_client.GRPCClient.get_run_error', side_effect=async_mock) + mocker.patch('grpc_client.GRPCClient.get_run_error', side_effect=async_mock) return async_mock @pytest.fixture() def mock_get_run_output(mocker): async_mock = AsyncMock(return_value="MOCK_RUN_OUTPUT") - mocker.patch('infrastructure.grpc_client.GRPCClient.get_run_output', side_effect=async_mock) + mocker.patch('grpc_client.GRPCClient.get_run_output', side_effect=async_mock) return async_mock @pytest.fixture() def mock_get_compile_output(mocker): async_mock = AsyncMock(return_value="MOCK_COMPILE_OUTPUT") - mocker.patch('infrastructure.grpc_client.GRPCClient.get_compile_output', side_effect=async_mock) + mocker.patch('grpc_client.GRPCClient.get_compile_output', side_effect=async_mock) return async_mock @@ -68,14 +68,17 @@ async def test_check_status(self, mock_check_status): result = await GRPCClient().check_status(str(uuid.uuid4())) assert result == api_pb2.STATUS_FINISHED + @pytest.mark.asyncio async def test_get_run_error(self, mock_get_run_error): result = await GRPCClient().get_run_error(str(uuid.uuid4())) assert result == "MOCK_ERROR" + @pytest.mark.asyncio async def test_get_run_output(self, mock_get_run_output): result = await GRPCClient().get_run_output(str(uuid.uuid4())) assert result == "MOCK_RUN_OUTPUT" + @pytest.mark.asyncio async def test_get_compile_output(self, mock_get_compile_output): result = await GRPCClient().get_compile_output(str(uuid.uuid4())) assert result == "MOCK_COMPILE_OUTPUT"