mygreeterv3

Stars
0

mygreeterv3

Prerequisites

Installations

  • Follow the steps to install Go if you do not already have it.

  • Follow the steps to install Docker if you do not already have it.

  • Set up GOPROXY for AKS

Setup and Development

Note that we use the remote aks middleware. This middleware is responsible for features such as logging, retry, and input validation. To learn more, please visit the repo.

Initialize service

./init.sh
# Follow instructions from the scripts to create the api module, etc.

Run Service Locally

There is a simple way to run the MyGreeter service, after everything has been properly generated. Inside the MyGreeter directory, you can run the client, demoserver and server.

Server

To run the server:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/server start 

By default the server starts in port localhost:50051 and the enable-azureSDK-calls flag is set to false.

To run the server with the azureSDK calls enabled:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/server start --enable-azureSDK-calls true --subscription-id <sub_id>

By default, the sayHello calls are served directly by the server. In order to forward the call to the demoserver:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/server start --remote-addr <remote_addr>

Client

To run the client:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/client hello

By default the client sends messages to port localhost:50051. This can be changed by running

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/client hello --remote-addr <remote_addr>

Demoserver

To run the demoserver, you must use a different port than the server is already using, so you can send messages to the demoserver from the server.

To run the demoserver:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/demoserver start

To run the demoserver in a particular port:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/demoserver start --port <local_port>

Help

You can run help on every command in order to get more information on how to use them.

Examples:

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/client help

go run go.goms.io/aks/rp/mygreeterv3/server/cmd/demoserver start -h

Run service on AKS internal standalone

  • Rename or delete your go.work file. Reason: aksbuilder doesn't work with go.work.
  • Create your standalone
  • Make the targets in the order that they appear in the Makefile.

Debugging and Common Failures

aksbuilder problems

  • Clean up repo and aksbuilder cache.
git clean -xdf
sudo rm -rf ~/.aksbuilder 

Monitoring

To view your service in Azure Data Explorer (ADX), follow ADX dashboard creation/update instructions.