Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

(Archived) Serverless deployment platform powered by Google Cloud

Notifications You must be signed in to change notification settings

rafter-platform/rafter-alpha

Repository files navigation

Rafter 🏡

Update: Rafter is pivoting to a hosted model. This open-source code remains as a fun reference. Enjoy!

Rafter is a serverless deployment platform powered by Google Cloud. It leverages Google Cloud Run (and many other tools) to transform your Git repository into a fully-scalable serverless application running in the cloud - with zero configuration.

💰 Scales to zero when not in use, saving you money — perfect for hobby projects
🔥 Automatically scales to handle load
🔌 Manages, connects and creates Cloud SQL databases for your applications automatically
⚡️ Connects to GitHub and supports deploy-on-push
🚀 Spin up multiple environments available at vanity URLs at the click of a button
✨ No Dockerfiles required

⚠️ Rafter is still very much a work-in-progress! ⚠️

Google Cloud Services

Cloud Run (web service)

Official Documentation

  • Creates services for each environment of each project, automatically
  • Cloud Run handles all traffic roll-out, scaling, and configuration
  • Environment variables are assigned to each unique service through the API

Cloud Build (image creation)

Official Documentation

  • Docker images are created when code is pushed to GitHub
  • Dockerfile is automatically provided based on type of project
  • Currently supported: Laravel, Node.js

Cloud SQL (database)

Official Documentation

  • Database instances are provisioned by Rafter through the API
  • Databases are created and assigned to projects automatically using the Admin API
  • Environmental variables are properly assigned based on type of project

Cloud Firestore (cache and session drivers)

UPDATE: This... doesn't work great, due to a number of factors. Looking into alternatives.

Official Documentation

  • NoSQL database to support key-value caching and session management
  • Drivers integrated automatically based on project
  • No additional credentials required for consumer apps to use, since credentials are supplied within Cloud Run

Cloud Tasks (queue driver)

Official Documentation

  • Robust queue management platform
  • Queues are automatically created for each environment
  • Dedicated Cloud Run service is created for each project to handle incoming jobs through HTTP request payloads
  • No daemon or worker instance is required
  • Since Cloud Run is serverless, instances can fan out, thousands of jobs can be processed in a matter of seconds

Cloud Storage (image artifacts and uploads)

Official Documentation

  • Object storage, similar to S3
  • Automatically handles uploaded artifacts from Cloud Build
  • Integrated into application helpers based on project type to handle user uploads

Cloud Scheduler

Official Documentation

  • Used for firing cron events in e.g. Laravel

Cloud Logging

Official Documentation

  • HTTP requests, stdout and app logs displayed inside Rafter log viewer

Roadmap

Here are things I'd like to work on next:

  • Extract laravel-rafter-core into a package
  • Inject Laravel Stackdriver log driver config
  • Support other projects:
    • Node
    • WordPress
    • Rails
    • Go
    • Custom Dockerfile
  • Email driver support (does Google offer this as part of GCP?)
  • Integration of Secret Manager
  • Integration of commands
  • Integration of GCS for better uploads with Laravel
  • Better Database operations
  • Leverage GitHub Deployment API to mark when a branch has been deployed
  • Lots of UI upgrades:
    • Log viewer
    • Database information
    • User profile/settings
  • Better Cloud Build optimization
    • Clone using ZIP instead of Git
    • Use secrets rather than plain text tokens for security
    • Consider adding multistage builds for Nodejs, Composer building steps
  • Implement Custom Domain assignment and onboarding
  • Implement an environment deletion workflow to delete resources/schedulers/etc
  • Allow users to clone a public project without having to connect a source provider
  • Create a CLI to allow users to push a local project without connecting a source provider

Development notes

  • Clone it
  • Use Valet to run it and connect to a local MySQL database
  • Run make share to fire up ngrok.io local tunnel
  • Requires grpc PHP extension to be installed locally: pecl install grpc

Inspiration

About

(Archived) Serverless deployment platform powered by Google Cloud

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages