Go to file
José Armando García Sancio 8543d8ef6b Merge pull request #161 from mesosphere/version
dcos-568 verify that Marathon 0.8.0 or later is installed
2015-05-12 08:41:17 -07:00
2015-04-29 22:32:54 -07:00
2015-05-06 11:11:15 -07:00
2015-01-21 00:12:04 +00:00
2015-03-30 23:41:28 -07:00
2015-01-18 10:13:28 +00:00
2015-05-06 10:43:28 -07:00
2015-05-06 22:23:40 -07:00

DCOS Command Line Interface

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

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 git@github.com: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 Marathon, changing the values below as appropriate for your local installation:

    dcos config set marathon.host localhost
    dcos config set marathon.port 8080
    dcos config append package.sources https://github.com/mesosphere/universe/archive/master.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.

To support subcommand integration tests, you'll need to clone, package and configure your environment to point to the packaged dcos-helloworld account.

  1. Check out the dcos-helloworld project
  2. cd dcos-helloworld
  3. make packages
  4. Set the DCOS_TEST_WHEEL environment variable to the path of the created wheel package: export DCOS_TEST_WHEEL=$(pwd)/dist/dcos_helloworld-0.1.0-py2.py3-none-any.whl

Running https://github.com/mesosphere/dcos-cli/blob/master/bin/publish_to_pypi.sh#######

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

You should ensure DCOS_CONFIG is set and that the config file points to the Marathon instance you want to use for integration tests. If you're happy to use the default test configuration which assumes there is a Marathon instance running on localhost, set DCOS_CONFIG as follows:

export DCOS_CONFIG=$(pwd)/tests/data/dcos.toml

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.

Using the CLI

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

Full documentation is available for the DCOS CLI on the Mesosphere docs website.

Description
RETIRED, further work has moved to Debian project infrastructure
Readme 9.4 MiB
Languages
Python 89.4%
Mustache 4%
HTML 4%
Shell 2.1%
reStructuredText 0.4%
Other 0.1%