This guide consists of:
See also:
backend/ ├── cmd │ ├── migration_tool # tool to apply database migrations │ ├── remove_unused_snippets # tool to remove old snippets manually │ └── server # entry point to the backend application ├── configs # config files for each SDK ├── containers # set up and build backend docker images ├── datasets # datasets for examples using Kafka emulator ├── internal # backend logic │ ├── api # generated grpc API files │ ├── cache # logic for working with cache │ ├── code_processing # logic for processing the received code │ ├── components # backend components │ ├── constants # code constants used in the application │ ├── db # logic for working with database, e.g. the Cloud Datastore │ ├── emulators # logic for starting various emulators, e.g. Kafka │ ├── environment # tools for working with application environment settings │ ├── errors # custom errors │ ├── executors # logic used to run the user submitted code │ ├── external_functions # logic for calling Google Cloud Functions │ ├── fs_tool # logic for woking with filesystem operations during run preparation │ ├── logger # cusotm logger │ ├── preparers # logic for preparing the user submitted code before execution │ ├── setup_tools # logic for setting up executors │ ├── streaming # implementation of run output streamer │ ├── tasks # periodic tasks scheduler │ ├── tests # common testing logic │ ├── utils # miscellaneous tools │ └── validators # logic for pre-execution code validation ├── playground_functions # Google Cloud Functions for write access to the database ├── functions.go # entry point for Cloud Functions ├── go.mod # Go project build configuration ├── logging.properties # configuration for Java runner logger ├── new_scio_project.sh # script for creating new SCIO project, used by SCIO runner └── properties.yaml # application properties ...
All generated files (generated grpc API files, go.sum
) should be published to the repository.
RunCode
API methoduuid
format), saves it to the cache, and sends it back to the client.Each step (3-6
steps) is a separate goroutine and could be stopped if code processing has been canceled, or it takes too much time.
After each step (even if it ends with failure) status of the code processing changes according to a finished step, so the client clearly understands what is happening with the code processing at the moment.
Status, all outputs, and all error messages are placed to the one common cache, so even if there are several instances it does not matter which instance process the code.
enum Sdk { SDK_UNSPECIFIED = 0; SDK_JAVA = 1; SDK_GO = 2; SDK_PYTHON = 3; SDK_SCIO = 4; }
NewLifeCycle()
method)Setup()
method)Compiler()
method)Runner()
method)TestRunner()
method)compileStep()
method)runStep()
method)playground/backend/datasets
beam-playground: name: { example name } description: { description } multifile: { true | false } context_line: { the line where the code starts } categories: - { category } complexity: { BASIC | MEDIUM | ADVANCED } tags: - { tag } emulators: kafka: topic: id: { topic name } dataset: { dataset_1 } datasets: { dataset_1 }: location: local format: { json | avro }