Learn R Programming

googleCloudRunner

As easy as possible R scripts in the cloud, via Cloud Run, Cloud Build and Cloud Scheduler. Continuous Development and Integration tools on Google Cloud Platform.

Not an official Google product.

Ambition

Select an R file, and have it scheduled in the cloud with a couple of clicks.

Deploy your plumber API code automatically on Cloud Run to scale from 0 (no cost) to millions (auto-scaling)

Integrate R inputs and outputs with other languages in a serverless cloud environment.

Have R code react to events such as GitHub pushes, pub/sub messages and Cloud Storage file events.

Install

Get the CRAN stable version via

install.packages("googleCloudRunner")

Or the development version via:

remotes::install_github("MarkEdmondson1234/googleCloudRunner")

The dev version of the website is here which may include documentation of features not yet on CRAN.

Usage

Browse the googleCloudRunner website for topics on how to use:

Diagrams

Some overviews of the function dependencies are below:

Scheduling using Cloud Scheduler

Building using Cloud Build

Helper deployment functions calling lower-level functions

Cloud Run functionality

library(targets) integration functions

Sponsor

Resources

Read the blog introducing the googleCloudRunner package that goes into some background.

A talk at R's 20th anniversary was performed at celebRation in Copenhagen on 29th Feb, 2020. The slides from the talk are here and a video of it is here:

A googleCloudRunner YouTube playlist of the demos is here.

If you blog anything interesting about the package let me know and I will list it here.

Copy Link

Version

Install

install.packages('googleCloudRunner')

Monthly Downloads

110

Version

0.5.0

License

MIT + file LICENSE

Maintainer

Mark Edmondson

Last Published

February 28th, 2022

Functions in googleCloudRunner (0.5.0)

GitHubEventsConfig

GitHubEventsConfig Object
Job

Job Schedule Object
RepoSource

RepoSource Object
HttpTarget

HttpTarget Object
Build

Build Object
StorageSource

StorageSource Object
Source

Source Object
PubsubTarget

Pubsub Target Object (Cloud Scheduler)
PubsubConfig

Pubsub Config (Build Trigger)
BuildTrigger

BuildTrigger Object
cr_build_status

Returns information about a previously requested build.
cr_build_source

Build a source object
cr_build_make

Make a Cloud Build object out of a cloudbuild.yml file
WebhookConfig

WebhookConfig (Build Triggers)
cr_bucket_set

Get/Set the Cloud Storage bucket for your Cloud Build Service
cr_build_artifacts

Download artifacts from a build
cr_build

Starts a build with the specified configuration.
cr_build_targets

Set up Google Cloud Build to run a targets pipeline
cr_build_yaml

Create a cloudbuild Yaml object in R
cr_build_logs

Download logs from a Cloud Build
cr_build_wait

Wait for a Build to run
cr_build_upload_gcs

Create a StorageSource
cr_build_write

Write out a Build object to cloudbuild.yaml
cr_build_list

Lists the build
cr_buildstep_bash

Run a bash script in a Cloud Build step
cr_buildstep

Create a yaml build step
cr_build_yaml_secrets

Create an availableSecrets entry for build yaml
cr_build_yaml_artifact

Add an artifact for cloudbuild.yaml
cr_buildstep_decrypt

Create a build step for decrypting files via KMS
cr_buildstep_compute_container

Buildstep to deploy to Google Compute Engine
cr_buildstep_edit

Modify an existing buildstep with new parameters
cr_buildstep_extract

Extract a buildstep from a Build object
cr_buildstep_pkgdown

Create buildsteps for deploying an R pkgdown website to GitHub
cr_buildstep_packagetests

Do R package tests and upload to Codecov
cr_buildstep_df

Convert a data.frame into cr_buildstep
cr_buildstep_docker

Create a build step to build and push a docker image
cr_buildtrigger_edit

Updates a `BuildTrigger` by its project ID and trigger ID.This API is experimental.
cr_buildstep_secret

Create a buildstep for using Secret Manager
cr_buildstep_slack

Send a Slack message to a channel from a Cloud Build step
cr_buildtrigger

Create a new BuildTrigger
cr_buildstep_targets

Buildstep to run a targets pipeline on Cloud Build
cr_deploy_gadget

Launch the googleCloudRunner deployment RStudio gadget
cr_deploy_packagetests

Deploy a cloudbuild.yml for R package tests and upload to Codecov
cr_buildstep_gcloud

A buildstep template for gcloud
cr_buildstep_gitsetup

Create a build step for authenticating with Git
cr_deploy_r

Deploy an R script with an optional schedule
cr_deploy_pkgdown

Deploy a cloudbuild.yml for a pkgdown website of an R package
cr_buildtrigger_get

Returns information about a `BuildTrigger`.This API is experimental.
cr_buildtrigger_pubsub

Create a buildtrigger pub/sub object
cr_buildtrigger_list

Lists existing `BuildTrigger`s.This API is experimental.
cr_buildtrigger_copy

Copy a buildtrigger
cr_buildtrigger_delete

Deletes a `BuildTrigger` by its project ID and trigger ID.This API is experimental.
cr_pubsub

Send a message to pubsub
cr_region_set

Get/Set the endpoint for your CloudRun services
cr_jwt_create

Create a JSON Web Token (JWT) from your service client and call Google services
cr_email_get

Get/Set cloud build email
cr_schedule_delete

Deletes a scheduled job.
cr_run_schedule_http

Create a Cloud Scheduler HTTP target for a private Cloud Run URI
cr_run_list

List CloudRun services.
cr_buildstep_mailgun

Send an email in a Cloud Build step via MailGun.org
cr_deploy_docker

Deploy a local Dockerfile to be built on ContainerRegistry
cr_deploy_docker_trigger

Deploy Docker build from a Git repo
cr_buildstep_r

Run an R script in a Cloud Build R step
cr_buildstep_nginx_setup

Setup nginx for Cloud Run in a buildstep
cr_buildstep_run

Create buildsteps to deploy to Cloud Run
cr_buildtrigger_webhook

Create a buildtrigger webhook object
cr_schedule_get

Gets a scheduler job.
cr_deploy_badger

Deploy a Cloud Run app to display build badges
cr_project_set

Get/Set the projectId for your CloudRun services
cr_plumber_pubsub

Plumber - Pub/Sub parser
cr_setup_auth

Create a service account for googleCloudRunner
cr_setup_service

Give a service account the right permissions for googleCloudRunner operations
cr_buildtrigger_run

Runs a `BuildTrigger` at a particular source revision.
cr_buildtrigger_repo

Create a buildtrigger repo object
cr_run_get

Get information about a Cloud Run service.
cr_run_email

Create an invoker email for use within authenticated Cloud Run
cr_schedule_run

Forces a job to run now.
cr_setup

A helper setup function for setting up use with googleCloudRunner
cr_regions

Cloud Run Regions
cr_build_schedule_http

Create a Cloud Scheduler HTTP target from a Cloud Build object
cr_schedule_build

Schedule a Build object via HTTP or PubSub
cr_run

Create a CloudRun service.
cr_deploy_run

Deploy to Cloud Run
cr_deploy_run_website

Deploy HTML built from a repo each commit
googleCloudRunner

Launch R scripts into the Google Cloud via Cloud Build, Cloud Run and Cloud Scheduler
cr_schedule_pause

Pauses and resumes a scheduled job.
cr_schedule_list

Lists Cloud Scheduler jobs.
cr_setup_test

Run tests over your setup
cr_sourcerepo_list

List source repositories available under a project