Skip to main content

Adding a New Job/Microservice

Job

Let <J> be a name of the job service you'd like to create (wfrunner, for example).

  1. Add job definitions to jobQueues field of infra/manifests/mesh.yaml to express possible connectivity among serivces/jobs.
  2. Run ./bazel.sh run //infra/env/remote/aws/common:messages-gen
  3. Create proto/jobqueue/<verb form of J> to use these AWS resources following other implementations.
  4. Create backend/jobs/<J> and define //backend/jobs/<J>:image with go_image or any other Bazel rule generating a container image.
  5. Edit skaffold.yaml to include //backend/jobs/<J>:image.tar to artifacts.
  6. Create infra/manifests/jobs/<J>.yaml and define ServiceAccount, Deployment, and anything you want. You can use the artifact name specified in step 1 as an image name.
  7. Edit infra/manifests/jobs/kustomize.yaml to include infra/manifests/jobs/<J>.yaml to resources.

Microservice

Let <S> be a name of the job service you'd like to create (wfhistory, for example).

  1. Add a service to services field of infra/manifests/mesh.yaml to express possible connectivity among serivces and jobs.
  2. Run ./bazel.sh query kind(copy_to_workspace, //...) | xargs ./bazel.sh run to generate codes.
  3. Edit skaffold.yaml to include //backend/microservices/<S>:image.tar to artifacts.
  4. Create infra/manifests/microservices/<S>.yaml and define ServiceAccount, Deployment, Service, DestinationRule, VirtualService, AuthorizationPolicy, and anything you want. You can use the artifact name specified in step 1 as an image name.
  5. Edit infra/manifests/microservices/kustomization.yaml to include infra/manifests/microservices/<S>.yaml to resources.
  6. Edit infra/env/local/microservices/common.yaml to add hosts to Gateway and VirtualService for local testing.
  7. Create some more YAMLs in infra/env/local/microservices if you need to do.