Coder Social home page Coder Social logo

veggiemonk / cloud-run-jobs-demo Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 5.74 MB

Cloud Run Jobs demo to fetch your GitHub starred repositories

Dockerfile 4.03% Makefile 10.98% Shell 30.53% Go 54.46%
cloud-build cloud-run cloud-run-jobs cloud-workflows google-cloud batch demo gcloud golang github-stars

cloud-run-jobs-demo's Introduction

Cloud Run Jobs Demo

Downloading Starred Repositories

This project is a demonstration of how to use Google Cloud Run Jobs to periodically download and update a user's starred repositories from the GitHub API. It includes a sample Cloud Run Job that uses the GitHub API to fetch the list of repositories starred by a specified user and log them in order to route those logs to a sink such as BigQuery.

Prerequisites

To run the demo, you will need:

  • A Google Cloud account with access to the Google Cloud Run, Cloud Workflow, and Cloud Scheduler services.
  • The Google Cloud SDK, which includes the gcloud command-line tool for managing Google Cloud resources.
  • A GitHub personal access token with the public_repo scope, which will be used to authenticate the GitHub API requests.

Running the demo

To run the demo, follow these steps:

Clone or download the Cloud Run Jobs Demo repository to your local machine. Open a terminal and navigate to the root directory of the project.

git clone https://github.com/veggiemonk/cloud-run-jobs-demo
cd cloud-run-jobs-demo

Locally

Set the environment variable GITHUB_TOKEN to your GitHub personal access token:

./build.sh
export GITHUB_TOKEN=<your-github-token>
./bin/batch --username <your-github-username> --github-token $GITHUB_TOKEN

In Cloud Run

Use the gcloud tool to authenticate and set your default project and region:

gcloud auth login

gcloud config set project <your-project-id>

gcloud config set run/region <your-preferred-region>

Read the setup.sh script to understand what is needed to run the demo.

cat setup.sh

Here is a sample of what will be deployed:

cloud run jobs demo on GCP

Start presentation

 go get golang.org/x/tools/cmd/present # install present binary in your $GOPATH
 make presentation

Resources

Interesting projects

cloud-run-jobs-demo's People

Contributors

veggiemonk avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.