RETIRED, further work has moved to Debian project infrastructure
Go to file
Tarun Gupta Akirala c6edbed7ef Add package install appid planned deprecation warning (#1013)
* Added warning message about the planned deprecation for appid
* Fixed broken test cases
* Updated tests adhering to contributing guidelines
2017-07-17 10:50:54 -07:00
bin Updated typo in lowercasing 'exe' variables instead of 'EXE'. 2017-07-11 17:26:02 -07:00
cli Add package install appid planned deprecation warning (#1013) 2017-07-17 10:50:54 -07:00
dcos When describing a package print the full response (#1005) 2017-07-14 14:35:54 -07:00
pydoc DC slash OS (#637) 2016-06-07 11:16:04 -07:00
tests Tests should use v3 instead of v2 2017-06-14 14:19:25 -07:00
.gitignore Updated .gitignore to include patterns for env*/ and dist*/. 2017-07-06 23:23:45 -07:00
CONTRIBUTING.md DC slash OS (#637) 2016-06-07 11:16:04 -07:00
DESCRIPTION.rst DESCRIPTION.RST: Extend underline (#991) 2017-05-09 07:30:53 -07:00
Dockerfile.test python35: update as supported version (bump from 3.4) (#822) 2017-01-06 11:13:05 -08:00
EXTERNAL_LICENSES.md Updated Alabaster license. 2017-07-06 23:31:05 -07:00
ISSUE_TEMPLATE.md DC slash OS (#637) 2016-06-07 11:16:04 -07:00
Jenkinsfile Added a maximum retry to create test clusters in the Jenkinsfile. 2017-07-07 19:31:45 -07:00
LICENSE Amend license information 2015-08-20 17:54:38 -07:00
MANIFEST.in Update description and classifier, add version specification and long desc. Publish to PyPI script. 2015-05-06 10:09:16 -07:00
Makefile Rewrote the build system to be more flexible / cross platform. 2017-07-06 23:23:45 -07:00
NOTICE Amend license information 2015-08-20 17:54:38 -07:00
README.rst Removed env-setup* scripts in favor of directly activating environment. 2017-07-06 23:23:45 -07:00
requirements.txt up tox to 2.2, change envlist order 2015-11-16 16:06:39 +01:00
setup.py setup: move PyJWT dep from cli/setup.py to setup.py (#937) 2017-03-17 10:15:45 -07:00
tox.ini Updated consolidated tox.ini files and made them workable on windows. 2017-07-06 23:23:45 -07:00

README.rst

DC/OS Command Line Interface

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

Installation and Usage

If you're a user of DC/OS, 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 DC/OS in general is available in the DCOS 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 DC/OS repository:

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

Note: The CLI output supports support UTF-8 encoding for stdout and stderr. Please follow your platform's instructions on how to do that.

Development Dependencies

  1. git must be installed to download the source code for the DC/OS CLI.
  2. python version 3.5.x must be installed.
  3. If make env fails you may be missing required dependencies for cryptography. See here for more information or use our dockerfile that builds with all necessary dependencies.
  4. virtualenv must be installed and on the system path in order to install legacy subcommands. New subcommands are packaged as platform specific executable or platform specific Zip archives.
  5. win_bash must be installed if you are running this in Windows in order to run setup scripts from the Makefiles.

Setup

  1. Make sure you meet requirements for installing packages

  2. Clone git repo for the dcos cli:

    git clone git@github.com:dcos/dcos-cli.git
  3. Change directory to the repo directory:

    cd dcos-cli
  4. Create a python virtual env for the dcos project:

    make env
  5. Create a virtualenv for the dcoscli project:

    cd cli
    make env

Configure Environment and Run

  1. From the cli directory, source the virtualenv activation script to add the dcos command line interface to your PATH:

    source env/bin/activate
  2. Configure the CLI, changing the values below as appropriate for your local installation of DC/OS:

    dcos cluster setup http://dcos-ea-1234.us-west-2.elb.amazonaws.com
  3. Get started by calling the DC/OS CLI help:

    dcos help

Running Tests

Setup

Tox, our test runner, tests against Python 3.5. We have a set of tests in the dcos package (root directory) and in the dcoscli package (cli directory). When running the tests described below, change directory to one of those two and follow the instructions.

Initialization

The config integration tests use static config files. To run these tests make sure you set owner only permissions on these files:

chmod 600 cli/tests/data/dcos.toml

The node integration tests use CLI_TEST_SSH_KEY_PATH for ssh credentials to your cluster.

The ssl integration tests resolve dcos.snakeoil.mesosphere.com to test SSL certs. To run this test suite be sure to add this resolution to your /etc/hosts file:

echo "your/dcos/cluster/url dcos.snakeoil.mesosphere.com" >> /etc/hosts

Running

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

Note that in order for all the integration tests to pass, your DC/OS cluster must have the experimental packaging features enabled. In order to enable these features the staged_package_storage_uri and package_storage_uri confiuguration paramenters must be set at cluster setup. See dcos configuration parameters for more information.

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 py35-integration /test_config.py

Releasing

Releasing a new version of the DC/OS 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.

The automated build starts up three jobs to build the platform dependent executables (in Windows, OS X, and Linux).

The executables are pushed to s3 and available at https://downloads.dcos.io/binaries/cli/<platform>/x86-64/<tag>/dcos. The links to each of the platform executables and the release notes are published at: https://github.com/dcos/dcos-cli/releases/tag/<tag>

The automated build also publishes two packages to PyPI using the publish_to_pypi.sh script:

  1. dcos
  2. dcoscli

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