GithubHelp home page GithubHelp logo

isabella232 / servantes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tilt-dev/servantes

0.0 0.0 0.0 5.04 MB

A microservice app that demonstrates the power of tilt

License: Apache License 2.0

Dockerfile 4.53% Makefile 0.77% Python 10.89% Go 61.47% Smarty 13.79% JavaScript 1.33% Rust 0.28% Starlark 6.95%

servantes's Introduction

servantes

A microservice app that demonstrates the power of Tilt.

(Like Miguel de Cervantes, but with servers!)

Quick start

  1. Install tilt
  2. Start a local Kubernetes cluster
  3. Verify you have m4 (either through XCode Command Line Tools on Mac or apt install m4 on Linux)
  4. git clone [email protected]:windmilleng/servantes.git
  5. cd servantes
  6. tilt up

This will deploy several microservice apps in to the default namespace of your current kubernetes cluster. Use the arrow keys to navigate between services in the Tilt HUD. Hit 'b' to open a service in the (B)rowser; the service fe is the frontend, and the most interesting to look at.

Screenshot

Screenshot of Servantes

Demo Workflows

If you're exploring Tilt via Servantes, here are some things you can do to Servantes to see features of Tilt.

Update Your App

The Snack service is easy to edit. Open the file snack/main.go and find the constant strings that are the options for snacks it will recommend. Comment all them out and write "Hello Tilt". Save, and watch Tilt build and update. Then reload Servantes in your web browse and see the new string.

Pinpoint Problems

Tilt's UX is built to highlight active problems, no matter where they're happening. Here are some ways you can break Servantes and see errors in Tilt.

Build Breakage

In snack/main.go, type in random characters and save. Tilt will start a build, and when it fails put the error in the HUD.

Fix the error and move on.

Startup Error

Kubernetes Pods can get into CrashLoopBackOff when they can't startup, e.g. because they can't find a necessary resource file.

Interactive Onboarding

Tilt's onboarding is nifty because you can do it interactively, as described in our Tutorial. Instead of writing your config first then running Tilt, Tilt watches your config and updates itself as you configure it.

You can recreate this experience by resetting to a pre-Tilt state and then adding it back in:

  1. Stop tilt
  2. Run tilt down to delete what Tilt has created
  3. Open Tiltfile in your editor and delete/comment out the entire contents.
  4. Run tilt up with an empty Tiltfile
  5. Add lines back (you'll want to add it back in the order in the original Tiltfile).

You can see Tilt spring to life as it gets more data.

live_update

Tilt can update Kubernetes in seconds, not minutes by using live_update. Because Servantes is a demo app, most services are small enough that they don't need optimizations. We purposely built our frontend to have a slow build (it links in the Kubernetes client library which can take minutes to build). Servantes uses live_update for the frontend to demo Tilt's speed at updating running services.

In fe/main.go, change the constant maxWidgets to display fewer widgets. Tilt will update fe in-place in seconds. Then reload Servantes and you should see your chosen number of services.

servantes's People

Contributors

dbentley avatar hyu avatar landism avatar maiamcc avatar nicks 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.