Skip to content
/ dcos-e2e Public
forked from dcos/dcos-e2e

Spin up and manage DC/OS clusters in test environments

License

Notifications You must be signed in to change notification settings

Fabs/dcos-e2e

 
 

Repository files navigation

Build Status

codecov

Documentation Status

DC/OS E2E

DC/OS E2E is a tool for spinning up and managing DC/OS clusters in test environments.

See the full documentation on Read the Docs.

DC/OS E2E consists of a library and various CLI tools.

The tools CLI can be installed with Homebrew on macOS, and the library and CLI can be installed together with pip on any Linux and macOS.

Windows is not currently supported, but we provide instructions on using DC/OS E2E on Windows with Vagrant on particular backends' documentation.

To install the CLI on macOS, install Homebrew. To install the CLI on Linux, install Linuxbrew. Or, if you prefer, see "Library and CLI with Python" below for an alternative.

Then install the latest stable version:

brew install https://raw.githubusercontent.com/dcos/dcos-e2e/master/dcose2e.rb

To upgrade from an older version, run the following command:

brew upgrade https://raw.githubusercontent.com/dcos/dcos-e2e/master/dcose2e.rb

Run dcos-docker doctor to make sure that your system is ready to go for the dcos-docker CLI:

$ dcos-docker doctor

If the CLI has been installed with Homebrew or Linuxbrew, you do not need to install the library to use the CLI.

Requires Python 3.5.2+. To avoid interfering with your system's Python, we recommend using a virtualenv.

Check the Python version:

python3 --version

On Fedora, install Python development requirements:

sudo dnf install -y git python3-devel

On Ubuntu, install Python development requirements:

apt install -y gcc python3-dev

Optionally replace master with a particular version of DC/OS E2E. See available versions.

If you are not in a virtualenv, you may have to use sudo before the following command, or --user after install.

pip3 install --upgrade git+https://github.com/dcos/dcos-e2e.git@master

Run dcos-docker doctor to make sure that your system is ready to go for the Docker backend:

$ dcos-docker doctor

Below is a small example of using DC/OS E2E as a Python library with a Docker backend. See the full documentation for more details on these and other features.

from pathlib import Path

from dcos_e2e.backends import Docker
from dcos_e2e.cluster import Cluster

oss_artifact = Path('/tmp/dcos_generate_config.sh')

with Cluster(cluster_backend=Docker()) as cluster:
    cluster.install_dcos_from_path(
        build_artifact=oss_artifact,
        dcos_config={
            **cluster.base_config,
            **{
                'check_time': True,
            },
        },
    )
    (master, ) = cluster.masters
    result = master.run(args=['echo', '1'])
    print(result.stdout)
    cluster.wait_for_dcos_oss()
    cluster.run_integration_tests(pytest_command=['pytest', '-x', 'test_tls.py'])

DC/OS E2E also provides multiple command line interface tools. These allow you to create, manage and destroy DC/OS clusters on various backends.

A typical CLI workflow with the dcos-docker CLI may look like this:

# Fix issues shown by dcos-docker doctor
$ dcos-docker doctor
$ dcos-docker create /tmp/dcos_generate_config.sh --agents 0
default
$ dcos-docker wait
$ dcos-docker run --sync-dir /path/to/dcos/checkout pytest -k test_tls
...
$ dcos-docker destroy

Each of these commands and more are described in detail in the full dcos-docker CLI documentation.

See the full CLI documentation for information on other CLI tools provided by DC/OS E2E.

About

Spin up and manage DC/OS clusters in test environments

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.9%
  • Ruby 3.9%
  • Other 1.2%