GithubHelp home page GithubHelp logo

tbrand / famo Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 84 KB

Command line tool for caching builds on S3

Dockerfile 0.87% Rust 89.12% PowerShell 1.86% Shell 8.15%
rust command-line-tool cache devops ci-cd s3

famo's Introduction

logo

Build Status Build status

This project is developed for my personal practice. Not recommented to be used in your productions.

Famo is a command line tool for caching builds on S3 similer to sccache. Famo is assumed to be used in many CI/CD platforms and for many languages.

Still under super development.

Main Features

  • ✔️ Quite easy and simple to use.
  • ✔️ Detect languages automatically.
  • ✔️ [WIP] Single Binary (For Linux, MacOS) which could be easily installed on CI/CD platforms.
  • ✔️ [WIP] Asyncronous uploading.

Quick Start

To use famo, you need

  • ✔️ famo command
  • ✔️ S3 or its compatibles with access key and secret access key.

Install famo command

TBD

Setting up S3

You need below information about S3.

  • Access Key ID (e.g. AKIAXXXXXXXXXXXXXXXX)
  • Secret Access Key (e.g. HLn2U3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
  • Region (e.g. ap-northeast-1)
  • Endpoint (e.g. s3-ap-northeast-1.amazonaws.com)
  • Bucket (e.g. famo-cache)

You could pass them as command line arguments. But access key id and secret access key should be passed as environment variables to hide their actual values. Use systems called "secrets" or "credentials" on your CI/CD platforms to set them.

export FAMO_ACCESS_KEY=AKIAXXXXXXXXXXXXXXXX
export FAMO_SECRET_ACCESS_LEY=HLn2U3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Use it!

famo --bucket=famo-cache --region=ap-northeast-1 --endpoint=s3-ap-northeast-1.amazonaws.com

Options

famo -h to show other options.

How does Famo work?

  1. Watch package files (like Cargo.toml, Gemfile, package.json ...).
  2. Calculate unique hash (hex) from them.
  3. Check the existance of the cache on S3.
  4. If the cache exists, download and unpack it into current directory.
  5. Builds project. If the cache was hit, it's very fast.
  6. Upload an archive of the cache if cache didn't exist on step 4.

So basically cache is effective until package files are not changed. The cache will reduce the build time especially for the big projects.

Comparing to similer works

There are several works which Famo was inspired. sscache developed by Mozilla is also caching builds onto cloud storages but supported languages (build tools) are limited. sccache is inspired by ccache which only support gcc.

CircleCI, TravisCI and other famous platforms have their caching system. Famo is used in platforms which doesn't have such system.

Supports

Supported Languages (Package Managers)

They are targets of auto detection. You can use Famo to other languages (not be listed below) by specifying --watches and --archive options.

  • Rust (cargo)
  • Node.js (npm, yarn)
  • Ruby (gem)
  • Crystal (shards)

Supported Platforms

Basically, Famo can be used in every platforms. Here are basic steps to use famo in your platform.

  • Pre-download famo or include famo in build image.
  • Setting up S3 environment on your build platform.
  • Insert famo step into your build process.

Supported Backend

Currently only S3 and its compatibles are supported. Please suggest on issues when you need others. (e.g. Redis)

Development and Contribution

We need your supports especially for

  • Adding another languages as a target of auto detection.
  • Adding another awesome option. (e.g. Asyncronous uploading)
  • Bug fixes

We don't need issues for each pull request. Please submit pull request directly. 😄

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.