View on GitHub

core

Cloud Robotics Core: Kubernetes, Federation, App Management

Deploy Cloud Robotics Core from sources

Estimated time: 30 min

This page describes how to set up a Google Cloud Platform (GCP) project containing the Cloud Robotics Core components. In particular, this creates a cluster with Google Kubernetes Engine and prepares it to accept connections from robots, which enables those robots to securely communicate with GCP. The commands were tested on machines running Debian (Stretch) or Ubuntu (16.04 and 18.04) Linux.

  1. In the GCP Console, go to the Manage resources page and select or create a project.
  2. Make sure that billing is enabled for your project.
  3. Install the Cloud SDK. When prompted, choose the project that you created above.
  4. After installing the Cloud SDK, install the kubectl command-line tool and the GKE auth plugin:

     gcloud components install kubectl
     gcloud components gke-gcloud-auth-plugin
    

    If you’re using Debian or Ubuntu, you may need to use apt install kubectl instead.

  5. Install the Bazel build system.

  6. Install additional build dependencies:

     sudo apt-get install default-jdk git python-dev unzip xz-utils
    

Build and deploy the project

  1. Clone the source repo.

     git clone https://github.com/googlecloudrobotics/core
     cd core
    
  2. Create application default credentials, which are used to deploy the cloud project and authorize access to the cloud docker registry.

     gcloud auth application-default login
     gcloud auth configure-docker
    
  3. Create a Cloud Robotics config in your project:

     ./deploy.sh set_config [PROJECT_ID]
    

    You can keep the defaults for the other settings by hitting ENTER.

    This command creates a file config.sh containing your choices and stores in into a cloud-storage bucket named [PROJECT_ID]-cloud-robotics-config. You can verify the settings using:

     gsutil cat gs://[PROJECT_ID]-cloud-robotics-config/config.sh
    
  4. Build the project. Depending on your computer and internet connection, it may take around 15 minutes.

     bazel build //...
    
  5. Deploy the cloud project.

     ./deploy.sh create [PROJECT_ID]
    

Known issue: Sometimes, this command fails with an error message like Error 403: The caller does not have permission, Error 403: Service ... not found or permission denied', Bad status during token exchange: 503, or Error enabling service`. In these cases, wait for a minute and try again.

deploy.sh created a Kubernetes cluster using Google Kubernetes Engine and used Helm to install the Cloud Robotics Core components. You can browse these components on the Workloads dashboard. Alternatively, you can list them from the console on your workstation:

$ kubectl get pods

NAME                READY   STATUS             RESTARTS   AGE
cert-manager-xxx    1/1     Running            0          1m
nginx-ingress-xxx   1/1     Running            0          1m
oauth2-proxy-xxx    0/1     CrashLoopBackOff   4          1m
token-vendor-xxx    1/1     Running            0          1m

Note Unless you already set up OAuth, the oauth2-proxy will show an error which we will ignore for now.

In addition to the cluster, deploy.sh also created:

With the project deployed, you’re ready to connect a robot to the cloud.

Update the project

To apply changes made in the source code, run:

./deploy.sh update [PROJECT_ID]

Clean up

The following command will delete:

This can be useful if the cluster is in a broken state. Be careful with this invocation, since you’ll have to redeploy the project and reconnect any robots afterwards.

./deploy.sh delete [PROJECT_ID]

If you want to completely shut down the project, see the Resource Manager documentation.

What’s next