Giter Club home page Giter Club logo

changes-lxc-wrapper's Introduction

Changes LXC Wrapper

Handles automating launching containers for running Changes builds.

Requirements

  • LXC 1.0
  • AWS CLI Tools (for snapshot integration)

Development

Provision the Vagrant VM:

$ vagrant up --provision

This will install various system dependencies as well as setting up a symlink for the changes-lxc-wrapper package.

Run a Build

Provision and use ubuntu minimal install:

$ changes-lxc-wrapper

Note

You will likely need to run these commands as root, and assuming you're passing AWS credentials via environment variables you'll want to run everything with sudo -E.

Use a snapshot rather than bootstrapping a fresh container, add --snapshot:

$ changes-lxc-wrapper \
    --snapshot 65072990854348a1a80c94bb0b6089e5

When running in production, you'll be passing two values which will automatically specify the project and snapshot for you:

$ changes-lxc-wrapper \
    --api-url https://changes.example.com/api/0/ \
    --jobstep-id 65072990854348a1a80c94bb0b6089e5

Creating a snapshot

This will create a meta.tar.xz and a rootfs.tar.xz:

$ changes-lxc-wrapper \
    --snapshot 65072990854348a1a80c94bb0b6089e5 \
    --save-snapshot \
    --clean

To rebuild the cached Ubuntu minimal install base rootfs, pass --flush-cache

Note

You must use --clean if you're passing a --snapshot (explicit snapshot name)

Run Command

Simply launch a container and run a command:

$ changes-lxc-wrapper \
    -- echo "hello world"

Running the Sample Build

Assuming you're using the VM, login and jump into /vagrant/. Once there, you can run the following:

$ sudo changes-lxc-wrapper --script examples/changes

changes-lxc-wrapper's People

Contributors

dctrwatson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

changes-lxc-wrapper's Issues

Handle cancelled builds

When we initially start up (and query Changes) for the JobStep configuration, it's possible that things have already been cancelled. In this case we need to abort the build (cleanly) as it has been cancelled upstream.

Abstract logging function

Continue to output to console unless server & job id are passed, then stream to changes

Also, hook into subprocess calls for their stdout/stderr

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.