GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — grpc/testctrl at master · codeblooded/grpc

Expand file tree

/

testctrl

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

testctrl

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
auth
auth
 
 
cmd
cmd
 
 
kubernetes/images
kubernetes/images
 
 
proto
proto
 
 
stats
stats
 
 
svc
svc
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

README.md

Outline

TestCtrl

TestCtrl, written and pronounced "test control" in a Kubernetes fashion, provides an interface for scheduling and running benchmarks on Kubernetes.

Overview

The TestCtrl project is composed of three major components:

The server which implements two gRPC services: TestSessions and google.longrunning.Operations. These services process incoming user requests and status updates for the tests, respectively.

A store is created with information about test sessions. It contains the configuration for the tests components. By design, TestCtrl knows nothing about the tests themselves. TestCtrl stores their raw config, some metadata and the current status of the test sessions.

One controller is created which operates a work queue to limit the number of test sessions in progress. It spawns executors that process one test session at a time, provisioning and monitoring resources with Kubernetes. It continually updates the store with the status of the test.

Life of a Test Session

To run benchmarks, a user calls the TestSessions service with the tests they would like to run and the container images that these tests require. This service saves information about the tests in a store, which assigns the test session a globally unique name. This name is stored in the work queue, awaiting an available executor. The server replies with the name in a google.longrunning.Operation protobuf.

When a executor becomes available, it fetches the next session off of the work queue. It provisions the resources and receives updates from the Kubernetes API to monitor the status of the pods that the test requires. It updates the store with significant events and timestamps.

If a user desires to see progress of a test, they make a request with the name to TestCtrl's implementation of the google.longrunning.Operations service. This service queries the store to learn about the status of the test and where to locate test results or error logs upon completion.

Quickstart

To start the service without containers on your local machine, run:

$ go run ./cmd/svc/main.go -alsologtostderr

You can force the service to use a different port with the flag -port:

$ go run ./cmd/svc/main.go -port=4044 -alsologtostderr

When the service is started, it looks for an $APP_ENV environment variable.

If this variable is set to "production", it authenticates with the Kubernetes API using in-cluster authentication.

Otherwise, the environment is assumed to be "development". In this case, the service will fail if the $KUBE_CONFIG_FILE does not contain the absolute path of a kubernetes config for authentication.

Development

To build or contribute to this project, your system must be properly configured with a version of Go that provides module support. Once navigated to the testctrl directory, running make deps should install all the dependencies specified in the go.mod file.

Building Protobufs

The protobufs are defined in the proto/ directory. Since they do not rely on a build system, they require an installation of the protobuf compiler and the go plugins.

To install the go plugin, navigate outside of the project directory and run:

$ go get -u -v github.com/golang/protobuf/protoc-gen-go

This binary will need to be added to your $PATH in order for a successful build. It will be available wherever your system places go binaries.

To build the protos, you must navigate into the proto/ directory, then you can run the ./build.sh script.

Inspecting the Service with grpc_cli

In order to inspect the gRPC service and make remote procedure calls on the command line, gRPC releases the grpc_cli. To build from source, navigate to the root of [grpc/grpc] and run:

$ make grpc_cli

The tool will become available as a binary under the bins/opt/ directory. For easy access, it may be helpful to create a shell alias that expands to it.

Formatting and Linting

Finally, before submitting any code to GitHub, run it through gofmt to ensure that it follows the external Go style guides and golint to point out any lint errors.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.