• Stars
    star
    105
  • Rank 318,549 (Top 7 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

General-purpose build server

mistry logo


Build Status Go report License: GPL v3

mistry is a general-purpose build server that enables fast workflows by employing artifact caching and incremental building techniques.

mistry executes user-defined build steps inside isolated environments and saves build artifacts for later consumption.

Refer to the introductory blog post Speeding Up Our Build Pipelines for more information.

At Skroutz we use mistry to speed our development and deployment processes:

  • Rails asset compilation (rails assets:precompile)
  • Bundler dependency resolution and download (bundle install)
  • Yarn dependency resolution and download (yarn install)

In the above use cases, mistry executes these commands once they are needed for the first time and caches the results. Then, when anyone else executes the same commands (i.e. application servers, developer workstations, CI server etc.) they instantly get the results back.

Features

  • execute user-defined build steps in pre-defined environments, provided as Docker images
  • build artifact caching
  • incremental building (see "Build cache")
  • CLI client for interacting with the server (scheduling jobs etc.) via a JSON API
  • a web view for inspecting the progress of builds (see "Web view")
  • efficient use of disk space due to copy-on-write semantics (using Btrfs snapshotting)

For more information visit the wiki.

Getting started

You can get the binaries from the latest releases.

Alternatively, if you have Go 1.10 or later you can get the latest development version.

NOTE: statik is a build-time dependency, so it should be installed in your system and present in your PATH.

$ go get github.com/rakyll/statik

# server
$ go get -u github.com/skroutz/mistry/cmd/mistryd

# client
$ go get -u github.com/skroutz/mistry/cmd/mistry

Usage

To boot the server a configuration file is needed:

$ mistryd --config config.json

You can use the sample config as a starting point.

Use mistryd --help for more info.

Adding projects

Projects are essentially directories with at minimum a Dockerfile at their root. Each project directory should be placed in the path denoted by projects_path (see Configuration.

Refer to File system layout - Projects directory for more info.

API

Interacting with mistry (scheduling builds etc.) can be done in two ways: (1) using the client and (2) using the HTTP API directly (see below).

We recommended using the client whenever possible.

Client

Schedule a build for project foo and download the artifacts:

$ mistry build --project foo --target /tmp/foo

The above command will block until the build is complete and then download the resulting artifacts to /tmp/foo/.

Schedule a build without fetching the artifacts:

$ mistry build --project foo --no-wait

The above will just schedule the build and return immediately - it will not wait for it to complete and will not fetch the artifacts.

For more info refer to the client's README.

HTTP Endpoints

Schedule a new build without fetching artifacts (this is equivalent to passing --no-wait when using the client):

$ curl -X POST /jobs \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"project": "foo"}'
{
    "Params": {"foo": "xzv"},
    "Path": "<artifact path>",
    "Cached": true,
    "Coalesced": false,
    "ExitCode": 0,
    "Err": null,
    "TransportMethod": "rsync"
}

Web view

mistry comes with a web view where progress and logs of each build can be inspected.

Browse to http://0.0.0.0:8462 (or whatever address the server listens to).

Configuration

Configuration is provided in JSON format. The following settings are currently supported:

Setting Description Default
projects_path (string) The path where project folders are located ""
build_path (string) The root path where artifacts will be placed ""
mounts (object{string:string}) The paths from the host machine that should be mounted inside the execution containers {}
job_concurrency (int) Maximum number of builds that may run in parallel (logical-cpu-count)
job_backlog (int) Used for back-pressure - maximum number of outstanding build requests. If exceeded subsequent build requests will fail (job_concurrency * 2)

The paths denoted by projects_path and build_path should be present and writable by the user running the server.

For an example refer to the sample config.

Development

Before anything, make sure you install the dependencies:

make deps

The tests will attempt to ssh to localhost. You will need to add your public key to the authorized keys as if you were setting this up to a remote host.

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

To run the tests, the Docker daemon should be running and SSH access to localhost should be configured.

$ make test

Note: the command above may take more time the first time it's run, since some Docker images will have to be fetched from the internet.

License

mistry is released under the GNU General Public License version 3. See COPYING.

mistry logo contributed by @cyfugr

More Repositories

1

rspecq

Distribute and run RSpec suites among parallel workers; for faster CI builds
Ruby
156
star
2

elasticsearch-analysis-turkishstemmer

ElasticSearch analysis plugin providing Turkish stemming functionality
Java
76
star
3

elasticsearch-skroutz-greekstemmer

Greek Stemmer for elasticsearch
Java
71
star
4

greek_stemmer

A simple Greek stemming library
Ruby
53
star
5

elasticsearch-analysis-greeklish

A greeklish token filter for elasticsearch
Java
44
star
6

turkish_stemmer

A simple Turkish stemming library
Ruby
42
star
7

developer.skroutz.gr

The Skroutz developer platform
HTML
33
star
8

css-style-guide

The CSS coding style guide we use at Skroutz
25
star
9

downloader

Async rate-limited downloading service
Go
23
star
10

greeklish

Generates greeklish forms
Ruby
22
star
11

cogy

Cog commands from your Rails app
Ruby
21
star
12

analytics.js

Analytics client
CoffeeScript
18
star
13

selectorablium

Enhance <select> elements with localstorage and filtering
CoffeeScript
18
star
14

skroutz.rb

Official Ruby Client for Skroutz API v3 https://developer.skroutz.gr
Ruby
16
star
15

wappalyzer-ruby

Ruby port of https://github.com/AliasIO/Wappalyzer
Ruby
15
star
16

skroutz-analytics-woocommerce

Integrate Skroutz Analytics to your WooCommerce enabled Wordpress site.
PHP
12
star
17

javascript-style-guide

JavaScript/CoffeeScript coding style guide in use at Skroutz SA
10
star
18

rafka-rb

Ruby client library for Rafka
Ruby
8
star
19

kafka-cluster-testbed

A Kafka cluster testbed for testing & development
Dockerfile
8
star
20

rafka

Kafka proxy with a simple API, speaking the Redis protocol
Go
8
star
21

elasticsearch-dynamic-word-delimiter

Dynamically specify protected words for ElasticSearch word delimiter
Java
8
star
22

skroutz.ex

Official Elixir client for Skroutz API v3 https://developer.skroutz.gr
Elixir
6
star
23

clj-skroutz

A Clojure client for Skroutz API (v3 and above)
Clojure
6
star
24

biskoto

Tiny cookie manipulation library
CoffeeScript
6
star
25

string_metric

A simple library with String Metric algorithms
Ruby
5
star
26

ferto

Ruby client for https://github.com/skroutz/downloader
Ruby
4
star
27

AdapterDelegatesSample

A simple Adapter Delegates refactoring example
Java
4
star
28

aws-lambda-secrets

Go
4
star
29

aws-securityhub-configuration

Configure AWS SecurityHub Subscriptions and Exceptions using GitOps
HCL
3
star
30

hasEvent

JavaScript test support utility
JavaScript
3
star
31

GirlsDoTech

Skroutz Girls Do Tech base repository
2
star
32

oauth2-oscommerce-module

osCommerce module for Skroutz Easy
PHP
2
star
33

rails-kafka-consumers

Companion source code to https://engineering.skroutz.gr/blog/kafka-rails-integration/
Ruby
2
star
34

oauth2-rails-demo

OAuth2 Rails Demo for Skroutz Easy
Ruby
1
star
35

oauth2-joomla-component

Joomla / Virtuemart component for Skroutz Easy
PHP
1
star
36

oauth2-joomla-plugin

Joomla / Virtuemart authentication plugin for Skroutz Easy
PHP
1
star
37

oauth2-joomla-module

Joomla / Virtuemart module for Skroutz Easy
PHP
1
star