Skip to main content

Google Cloud Run

Runme Cloud Renderers enable you to access various cloud resources directly within your Markdown files without the need to log into your cloud console. With Cloud Renderers, you can manage your Google Cloud Run resources and perform various operations without leaving your Markdown environment.

It is available on Runme client interfaces, including the editor and web browser. This section will explore how you can access the Google Cloud Run with Runme Cloud Renderers in a web browser.

Prerequisites

Before proceeding, ensure you have the following installed:

  • Install Runme

To access Runme on your web browser, you are required to install Runme on your terminal. To do that, run the command below:

brew install runme

Check out our detailed installation guide for instructions on installing Runme CLI on other operation systems.

  • Change directory

The next step is to navigate into your directory. However, if you do not have an existing folder you would love to work on, you can create a new folder or clone the repo you want to work with.

To create a folder, run the command below

mkdir my_new_directory

Where my_new_directory is the name of your folder.

Now, navigate into that directory by changing directory to my_new_directory.

  • Open the Web Browser

Now, open the browser by running this command.

runme open

This will load and open Runme in your default web browser and set up a Runme code-server.

Now, create a README.md file and run the following sections below inside the code cell one after the other.

run-web

  • Install Google Cloud SDK

Google Cloud SDK is one requirement that must be installed to interact with your Google Cloud resources. It provides the necessary tools and libraries for users. To install the Google Cloud SDK, run the command below.

 brew install --cask google-cloud-sdk

For other platforms, consult GCP’s official docs.

Authenticate with Google Cloud

The next step is to authenticate your account. This step is crucial as it allows you to access your cloud resources. To authenticate, run the command below.

 gcloud auth login

Setup Default Credentials

Setting up default application credentials allows applications to access your Google Cloud resources without requiring further authentication prompts. To set up your credentials, run the command below:

gcloud auth application-default login

How to Manage Google Cloud Run with Runme Cloud Renderers

Google Cloud Run is a service that allows you to run your containerized applications directly on Google’s infrastructure without worrying about infrastructure management. With Runme Cloud Renderers, you can access, list, and visualize Cloud Run services directly in your Markdown file.

This section will explain how Google Cloud Run works in Runme Notebook Cloud Renderers.

Set Your Project ID Using an Environment Variable

Use the environment variable prompts to set your project ID. Run the command below to experience how it works.

export PROJECT_ID="runme-ci"
echo "PROJECT_ID set to $PROJECT_ID"

This is how the prompt looks like.

prompt

Specify the Project for Visualization

After setting your project ID, you can visualize your project. To do this, paste a link from your console that specifies the desired project for visualization, like the link below, and click run.

https://console.cloud.google.com/run?project=$PROJECT_ID

In this example, runme-ci is the project ID. Once the operation is successful, you will receive a table displaying your Google Cloud Console page, similar to the one below.

cloud run dashboard

If you would love to view the logs of a particular project under the actions section, click the icon beside Revisons. This will take you to the log page of your console, where you can view the logs.

Access and Manage Project Revisions

Runme Notebook Cloud Renderers makes accessing and managing the details of your Cloud Run project possible. This section will explore how it does it.

Get Revision

To get the revision of a project, click the Revisions icon beside the project name, as indicated in the image below.

Get revision

This will create a new code cell to run automatically and display a table with your project revisions.

project revision

To view more details about your project, click the Details icon beside the project name.

Detail project

This will load a table that will provide details of your project, such as containers, volumes, storage, network, security, and YAML.

Visualize and Download YAML

Once you have gotten the details of your revision, navigate to the section on YAML. You will find two gcloud commands, Visualize and Download.

Visualize and Download YAML

To visualize the project YAML configurations, click Run under the visualize section.

visualize yaml

This will add a new code block, which will run automatically to visualize your YAML configuration in Runme’s terminal.

cat yaml file cloud run

On the other hand, to download the project YAML configurations, click Run under the download section.

download yaml

This will add a new code block that automatically downloads your YAML configuration. Once that is successful, the terminal will show that the operation has been completed, and the .yaml will be added to your current directory.

download yaml

Feedback and Contribution

We are still developing more features for the Runme Notebook Cloud Renderers. If you have feedback on this or new ideas on how to improve this feature, feel free to reach out to us.

Additional Resources

See more resources on the Runme Cloud Notebook Renderer feature: