Giter Site home page Giter Site logo

googlearchive / prpl-rain Goto Github PK

View Code? Open in Web Editor NEW
0.0 21.0 3.0 12 KB

Tools for setting up Google Compute Engine resources for hosting PRPL apps (such as shop.polymer-project.org and news.polymer-project.org)

License: BSD 3-Clause "New" or "Revised" License

Ruby 100.00%

prpl-rain's Introduction

prpl-rain

Tools for setting up Google Compute Engine resources for hosting PRPL apps (such as shop.polymer-project.org and news.polymer-project.org)

The PRPL Rain Server Configuration

We deployed to GCE (Google Compute Engine) and everything here works if you do the same. However, you could apply this to another provider with very little modification.

Current architecture of our servers required explicit installation of only two packages: nghttpx and nginx on GCE instances using latest Ubuntu image (at time of writing: "Ubuntu 16.10 - amd64 yakkety built on 2017-01-03").

Why does this repo contain all those Ruby scripts?

There are a collection of simple command line scripts, written in Ruby, for doing simple tasks associated with the configuration and deployment of the instances. At some point we may decide to port these to TypeScript and node like all our standard tools, but these Ruby scripts were more expedient for me to write and use to get these deployments done. Alternatively, we may add features into polymer-cli to do some of this stuff. There's nothing special about the code being in Ruby other than its terse and I could write it faster.

If you don't have Ruby installed (unlikely), I recommend using rbenv and ruby-build to install and manage it.

How to I configure a PRPL rain server on GCE?

There aren't many steps. Here they are:

  1. Create a VM instance on GCE (preferably Ubuntu)
  2. Put your SSL certs onto the instance somewhere
  3. Install the nghttp2 package, containing the nghttpx proxy server
  4. Generate nghttpx config
  5. Put the nghttpx config on the server
  6. Restart nghttpx service
  7. Install nginx
  8. Disable the default nginx site
  9. Enable the unknown-hosts-kthxbye.conf site
  10. Restart nginx service

Now, how to deploy an app? Lets look at the build script in an example. examples/news.polymer-project.org/build.rb

If we run that it will, clone the news repo, run polymer build, then generate server configs for nginx and put them in build/unbundled/.nginx. It outputs a few instructions when its done:

1. Copy the /Users/brendanb/src/github.com/polymerlabs/prpl-rain/examples/news.polymer-project.org/news.git/build/unbundled folder to the server at /var/www/news.polymer-project.org
2. On server: sudo chown -R root /var/www/news.polymer-project.org
3. On server: sudo chgrp -R root /var/www/news.polymer-project.org
4. On server: sudo ln -s /var/www/news.polymer-project.org/news.polymer-project.org.conf /etc/nginx/sites-enabled/news.polymer-project.org.conf
5. On server: sudo nginx -t # verify configs
6. On server: sudo systemctl restart nginx # activate new site

TODO(usergenic): gcloud commands to facilitate automatic deployment... TODO(usergenic): finish README.

prpl-rain's People

Contributors

usergenic avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

prpl-rain's Issues

Any chance of examples in the readme?

At the moment the readme is geared towards how to use this tool but I'm fairly lost in terms of what it actually does.

When I first looked at this repo I was lookgin to see what the inputs and outputs are of the ruby tools and how that is used by nginx.

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.