Giter VIP home page Giter VIP logo

dcos-vagrant-box's Introduction

DC/OS Vagrant Box

Vagrant box builder for dcos-vagrant using Packer.

The box produced by this builder does not include DC/OS, just it's dependencies.

Pre-provisioning this box front-loads internet access requirements, flakiness, and slowness resulting from third party package managemers and installers. This makes DC/OS installation faster and more reliable at the cost of potentially having slightly outdated dependencies.

Issue tracking is on the DCOS JIRA.

Provisioning Summary

  • Ansible (used for provisioning)
    • Python 2.7+
    • Pip 8.1+
    • Ansible 2.1+
  • CentOS
    • Latest CentOS 7+ kernel & packages
    • Enable Overlay file system
    • Disable kdump
  • DC/OS Node
    • Docker 1.11 w/ OverlayFS
    • curl, bash, ping, tar, xz, unzip, ipset
    • Disable firewalld
    • Disable IPv6
    • Cache docker images: nginx, zookeeper, registry
  • Debug
    • jq
    • probe
    • net-utils
  • Vagrant
    • Default Vagrant SSH key
    • Configure SSH
  • VirtualBox
    • Guest Additions
    • Reset network interface config
    • Remove packages to reduce image size
  • Zero out free space to improve image compression

Build

The DC/OS Vagrant Box is normally built in CI, on demand, but can be built manually as well.

Note that because the build process uses internet repositories with unversioned requirements, it's not exactly reproducible. Each built box may be slightly different than the last, but installations using the same box should be exactly the same.

Build Requirements

  • Packer - tool for OS image building
  • VirtualBox (>= 4.3)
  • Git - for updating the Vagrant Box Catalog Metadata
  • Docker - for running various other dependencies
  • OpenSSL - for generating box checksums

Build Pipeline

  1. Checkout - Clone or pull this repo
  2. Clean - Delete any left over box files
  3. Build - Use Packer to install the OS, runs all the build scripts, and export a compressed box file (~700MB)
  4. Upload - Upload the new box to S3
  5. Add - Add the new box version to the Vagrant Box Catalog Metadata (metadata.json)
  6. Publish - Upload the updated Vagrant Box Catalog Metadata to S3

Note that because the build process uses internet repositories with unversioned requirements, it's not exactly reproducible. Each built box may be slightly different than the last, but installations using the same box should be exactly the same.

Manual Build

Use the following commands to build a dcos-centos-virtualbox box:

cd <dcos-vagrant-box>
packer build packer-template.json

Test

New boxes can be tested with either the Vagrantfile in this repo or (preferably) with dcos-vagrant.

Test Requirements

Install Vagrant VBGuest Plugin

The VBGuest Plugin manages automatically installing VirtualBox Guest Additions appropriate to your local Vagrant version on each new VirtualBox VM as it is created.

vagrant plugin install vagrant-vbguest

This allows the pre-built vagrant box image to work on multiple (and future) versions of VirtualBox.

Test Local Box

To test a new local box (e.g. after ci/build_release.sh), add the box to vagrant and set the DCOS_BOX_VERSION environment variable:

cd <dcos-vagrant-box>
vagrant box add mesosphere/dcos-centos-virtualbox dcos-centos-virtualbox.box
export DCOS_BOX_VERSION=0
vagrant up

Or with dcos-vagrant:

cd <dcos-vagrant>
vagrant box add mesosphere/dcos-centos-virtualbox dcos-centos-virtualbox.box
export DCOS_BOX_VERSION=0
vagrant up [vms...]

To revert back to the remote Vagrant Box Catalog:

unset DCOS_BOX_VERSION
vagrant box remove mesosphere/dcos-centos-virtualbox --box-version=0

Test Local Catalog

To test a local Vagrant Box Catalog (e.g. after ci/update_catalog.sh), set the DCOS_BOX_URL environment variable:

cd <dcos-vagrant-box>
export DCOS_BOX_URL=file://~/workspace/dcos-vagrant-box/metadata.json
vagrant up

Or with dcos-vagrant:

cd <dcos-vagrant>
export DCOS_BOX_URL=file://~/workspace/dcos-vagrant-box/metadata.json
vagrant up [vms...]

To revert back to the remote Vagrant Box Catalog:

unset DCOS_BOX_URL
echo -n "https://downloads.dcos.io/dcos-vagrant/metadata.json" > ~/.vagrant.d/boxes/mesosphere-VAGRANTSLASH-dcos-centos-virtualbox/metadata_url

License

Copyright 2016 Mesosphere, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this repository except in compliance with the License.

The contents of this repository are solely licensed under the terms described in the LICENSE file included in this repository.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

dcos-vagrant-box's People

Contributors

sargun avatar karlkfi avatar

Watchers

James Cloos avatar  avatar

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.