GithubHelp home page GithubHelp logo

isabella232 / gifinator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/gifinator

0.0 0.0 0.0 1.19 MB

A sample application demonstrating Kubernetes, gRPC, Go and cute Gophers demoed at Google GCP Next 2017

Home Page: https://www.youtube.com/watch?v=YiNt4kUnnIM

License: Apache License 2.0

Makefile 2.52% Go 76.18% CSS 2.59% JavaScript 6.21% HTML 6.05% Protocol Buffer 6.45%

gifinator's Introduction

Kubernetes Render Demo

This is a demonstration of how to build an application using Go, gRPC and Kubernetes. The application - Gifinator - creates 3D animated gifs for no obvious purpose (except to show how these technologies can be used together).

This project is a compliment to a talk given at GCP Next 2017, for a demo and a walk-through of the application and the design choices we made, you can watch the session on YouTube.

This project currently assumes an import path of github.com/GoogleCloudPlatform/gifinator.

Building

Prerequisites

This project relies on Glide for dependency management and optionally Goreman (a clone of the popular Foreman tool, but written in Go) to make it easy to run the services locally for testing purposes.

git clone ... $GOPATH/src/github.com/GoogleCloudPlatform/gifinator
curl https://glide.sh/get | sh
go get github.com/mattn/goreman

You will also need to install the Google Cloud SDK to build and deploy to Kubernetes.

You will also need to have created a Google Cloud Storage bucket, for exclusive use by the application. If you plan to deploy to GKE, it is suggested to create your bucket in the same project.

To run and test locally, you will also need to have Redis installed and running.

Building Locally

cd $GOPATH/src/github.com/GoogleCloudPlatform/gifinator
glide install
make

Regenerating Protos

If you need to rebuild the generated code for the protos, then install protoc and run make proto.

Running Locally

Configure .env as appropriate. By default it assumes everything is running on localhost, including Redis.

gcloud auth application-default login # first time only
export $(cat .env | xargs)
make && goreman start

Ignore the port numbers, as they are specified in the .env file.

If you run into the gopkg.in issue, then run:

git clone https://p3.gopkg.in/yaml.v2 $GOPATH/src/gopkg.in/yaml.v2

Building the container image with Container Builder

A single image contains all three binaries, along with assets for the web-server frontend.

gcloud container builds submit . --config=cloudbuild.yaml

This will build and push the image to gcr.io/YOUR_PROJECT_ID/gifcreator

Deploy the solution to a Kubernetes cluster

First create a Kubernetes cluster and make sure kubectl is installed and configured to talk to it.

Configure the files in the k8s directory as appropriate. Mainly this will mean adjusting the value of the GOOGLE_PROJECT_ID and GCS_BUCKET_NAME to something appropriate for your usage.

To deploy the three services, and Redis, to the cluster for the first time, run:

kubectl create -f k8s

gifinator's People

Contributors

ajessup avatar zombiezen 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.