Giter VIP home page Giter VIP logo

dcos-cli's Introduction

DCOS Command Line Interface

The DCOS Command Line Interface (CLI) is a cross-platform command line utility that provides a user-friendly yet powerful way to manage DCOS installations.

Installation and Usage

If you're a user of DCOS, please follow the installation instructions. Otherwise, follow the instructions below to set up your development environment.

Detailed help and usage information is available through the dcos help command and for specific subcommands through dcos <subcommand> --help.

Additional documentation for the CLI and for the DCOS in general is available in the Mesosphere docs.

Parsing CLI Output

The CLI outputs either whitespace delimited tables which can be processed by all of your favourite Unix/Linux tools like sed, awk and grep, or text formatted as JSON when using the --json flag.

If using JSON, you can combine it with the powerful jq utility. The example below installs every package available in the DCOS repository:

dcos package search --json | jq '.[0].packages[].name' | xargs -L 1 dcos package install --yes

Using the CLI without DCOS

You may optionally configure the DCOS CLI to work with open source Mesos and Marathon by setting the following properties:: dcos config set core.mesos_master_url http://<mesos-master-host>:5050 dcos config set marathon.url http://<marathon-host>:8080

Note that the DCOS CLI has tight integration with DCOS and certain functionality may not work as expected or at all when using it directly with Mesos and Marathon.

Controlling Analytics Reporting

The CLI reports usage and exception information to Segment.io for production usage.

If you wish to turn reporting of analytics off entirely, you can set the core.reporting property to false:: dcos config set core.reporting false

Dependencies

  1. git must be installed and on the system path in order to fetch packages from git sources.
  2. virtualenv must be installed and on the system path in order to install subcommands.

Setup

  1. Make sure you meet requirements for installing packages
  2. Clone git repo for the dcos cli:

    git clone [email protected]:mesosphere/dcos-cli.git
  3. Change directory to the repo directory:

    cd dcos-cli
  4. Make sure that you have virtualenv installed. If not type:

    sudo pip install virtualenv
  5. Create a virtualenv and packages for the dcos project:

    make env
    make packages
  6. Create a virtualenv for the dcoscli project:

    cd cli
    make env

Configure Environment and Run

  1. source the setup file to add the dcos command line interface to your PATH and create an empty configuration file:

    source bin/env-setup-dev
  2. Configure the CLI, changing the values below as appropriate for your local installation of DCOS:

    dcos config set core.dcos_url http://dcos-ea-1234.us-west-2.elb.amazonaws.com
    dcos config append package.sources https://github.com/mesosphere/universe/archive/version-1.x.zip
    dcos config set package.cache /tmp/dcos
    dcos package update
  3. Get started by calling the DCOS CLI help:

    dcos help

Running Tests

Setup

Tox, our test runner, tests against both Python 2.7 and Python 3.4 environments.

If you're using OS X, be sure to use the officially distributed Python 3.4 installer since the Homebrew version is missing a necessary library.

Running

Tox will run unit and integration tests in both Python environments using a temporarily created virtualenv.

You can set DCOS_CONFIG to a config file that points to a DCOS cluster you want to use for integration tests. This defaults to ~/.dcos/dcos.toml

If you are testing against the DCOS Image you can configure the URL to the Exhibitor:

export EXHIBITOR_URL=http://<hostname>:8181/

There are two ways to run tests, you can either use the virtualenv created by make env above:

make test

Or, assuming you have tox installed (via sudo pip install tox):

tox

Other Useful Commands

  1. List all of the supported test environments:

    tox --listenvs
  2. Run a specific set of tests:

    tox -e <testenv>
  3. Run a specific integration test module:

    tox -e py27-integration /cli/test_config.py

Releasing

Releasing a new version of the DCOS CLI is only possible through an automated TeamCity build which is triggered automatically when a new tag is added.

The tag is used as the version number and must adhere to the conventional PEP-440 version scheme.

Once all tests pass successfully, the automated build publishes two packages to PyPI using the publish_to_pypi.sh script:

  1. dcos
  2. dcoscli

These packages are now available to be installed by the DCOS CLI installation script in the mesosphere/install-scripts repository.

dcos-cli's People

Contributors

abhay-agarwal avatar benwhitehead avatar connordoyle avatar florianleibert avatar gismoranas avatar grampelberg avatar joel-hamill avatar jsancio avatar mgummelt avatar mlunoe avatar ssk2 avatar sttts avatar swartzrock avatar ytolochkevych avatar yuratolochkevich avatar

Watchers

 avatar  avatar  avatar  avatar  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.