Git Product home page Git Product logo

dcos-cli's Introduction

DC/OS - The Datacenter Operating System

The easiest way to run microservices, big data, and containers in production.

DC/OS End of Life

Support for DC/OS ends on October 31, 2021. We will continue to provide support for our current DC/OS customers per their contracts, of course. However, we will no longer be investing in new features or capabilities or maintaining the related repositories. If a customer wishes to continue use of the DC/OS Enterprise platform or other non-free DC/OS components, the customer can purchase an End-of-Life License or Perpetual Use License, however support is not included in these licenses and continued use of DC/OS will be at your own discretion and risk.

We want to thank all of our loyal customers, particularly those DC/OS users who were fellow pioneers in the growth of the cloud native landscape from the beginning.

What is DC/OS?

Like traditional operating systems, DC/OS is system software that manages computer hardware and software resources and provides common services for computer programs.

Unlike traditional operating systems, DC/OS spans multiple machines within a network, aggregating their resources to maximize utilization by distributed applications.

To learn more, see the DC/OS Overview.

How Do I...?

Releases

DC/OS releases are publicly available on http://dcos.io/releases/

Release artifacts are managed by Mesosphere on Amazon S3, using a CloudFront cache.

To find the git SHA of any given release, check the latest commit in the versioned branches on GitHub: https://github.com/dcos/dcos/branches/

Release Type URL Pattern
Latest Stable https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh
Latest Master https://downloads.dcos.io/dcos/testing/master/dcos_generate_config.sh
Latest Build of Specific PR https://downloads.dcos.io/dcos/testing/pull/<github-pr-number>/dcos_generate_config.sh

Development Environment

Linux is required for building and testing DC/OS.

  1. Linux distribution:
    • Docker doesn't have all the features needed on OS X or Windows
    • tar needs to be GNU tar for the set of flags used
    • unzip needs to be installed
  2. pre-commit
  3. tox
  4. git 1.8.5+
  5. Docker 1.11+
    • Install Instructions for various distributions. Docker needs to be configured so your user can run docker containers. The command docker run alpine /bin/echo 'Hello, World!' when run at a new terminal as your user should just print "Hello, World!". If it says something like "Unable to find image 'alpine:latest' locally" then re-run and the message should go away.
  6. Python 3.6
    • Arch Linux: sudo pacman -S python
    • Fedora 23 Workstation: Already installed by default / no steps
    • Ubuntu 16.04 LTS:
      • pyenv-installer
      • Python dependencies: sudo apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils liblzma-dev python3-venv
      • Install Python 3.6.3: pyenv install 3.6.3
      • Create DC/OS virtualenv: pyenv virtualenv 3.6.3 dcos
      • Activate environment: pyenv activate dcos
  7. Over 10GB of free disk space and 8GB of RAM
    • The build makes use of hard links, so if you're using VirtualBox the disk space cannot be a synced folder.
  8. Optional pxz (speeds up package and bootstrap compression)
    • ArchLinux: pxz-git in the AUR. The pxz package corrupts tarballs fairly frequently.
    • Fedora 23: sudo dnf install pxz

Unit Tests

Unit tests can be run locally but require the development environment specified above.

tox

Tox is used to run the codebase unit tests, as well as coding standard checks. The config is in tox.ini.

Integration Tests

Integration tests can be run on any deployed DC/OS cluster. For installation instructions, see https://dcos.io/install/.

Integration tests are installed via the dcos-integration-test Pkgpanda package.

Integration test files are stored on the DC/OS master node at /opt/mesosphere/active/dcos-integration-test. Therefore, in order to test changes to test files, move files from packages/dcos-integration-test/extra/ in your checkout to /opt/mesosphere/active/dcos-integration-test on the master node.

The canonical source of the test suite's results is the continuous integration system. There may be differences between the results of running the integration tests as described in this document and the results given by the continuous integration system. In particular, some tests may pass on the continuous integration system and fail locally or vice versa.

Minimum Requirements

  • 1 master node
  • 2 private agent nodes
  • 1 public agent node
  • Task resource allocation is currently insignificantly small
  • DC/OS itself requires at least 2 (virtual) cpu cores on each node

Instructions

  1. SSH into a master node The tests can be run via Pytest while SSH'd as root into a master node of the cluster to be tested.

  2. Switch to root

    sudo su -
    
  3. Add the test user

    dcos-shell python /opt/mesosphere/bin/dcos_add_user.py [email protected]
    

    Running the above mentioned command will result in an output

    User [email protected] successfully added
    

    This test user has a known login token with far future expiration. DO NOT USE IN PRODUCTION. After the test, remember to delete the test user.

    For more information, see User Management.

  4. Run the tests using pytest in the cluster.

    cd /opt/mesosphere/active/dcos-integration-test
    dcos-shell pytest
    

Using a Docker Cluster with miniDC/OS

One way to run the integration tests is to use the miniDC/OS CLI.

This lets you create, run and manage clusters in test environments. Each DC/OS node is represented by a Docker container.

  1. Setup DC/OS in containers using the miniDC/OS CLI.

For example, after installing the miniDC/OS CLI, create a cluster:

minidcos docker download-installer
minidcos docker create /tmp/dcos_generate_config.sh \
    --masters 1 \
    --agents 2 \
    --public-agents 1 \
    --cluster-id default
  1. Run minidcos docker wait

Wait for DC/OS to start. Running wait command allows to make sure that the cluster is set up properly before any other actions that could otherwise cause errors in pytest command in the next step.

  1. Run pytest on a master node.

For example:

minidcos docker run --test-env pytest
  1. Destroy the cluster.
minidcos docker destroy

End-to-end Tests

E2E tests start a cluster as part of the test. These are useful for testing specific configurations or performing more disruptive tests.

To run the e2e tests, download a DC/OS installer, create a Python virtualenv, and run:

cd test-e2e
pip install -r requirements.txt
export DCOS_E2E_GENCONF_PATH=${PWD}/dcos_generate_config.sh
export DCOS_E2E_TMP_DIR_PATH=/tmp
export DCOS_E2E_LOG_DIR=/tmp/logs
pytest

Tests are annotated to be skipped if specific files are unchanged. This only applies to non-train Pull Requests run by D2iQ CI. In other cases, including running locally, all tests will run. You can use pytest arguments to restrict tests to a specific subset.

Build

DC/OS can be built locally but requires the development environment specified above.

DC/OS builds are packaged as a self-extracting Docker image wrapped in a bash script called dcos_generate_config.sh.

WARNING: Building a release from scratch the first time on a modern dev machine (4 cores / 8 hyper threads, SSD, reasonable internet bandwidth) takes about 1 hour.

Instructions

./build_local.sh

That will run a simple local build, and output the resulting DC/OS installers to ./packages/cache/dcos_generate_config.sh:

$ ./packages/cache/dcos_generate_config.sh

See the section on running in Docker to test the installer.

Build Details

If you look inside of the bash script build_local.sh there are the commands with descriptions of each.

The general flow is to:

  1. Check the environment is reasonable
  2. Write a release tool configuration if one doesn't exist
  3. Setup a python virtualenv where we can install the DC/OS python tools to in order to run them
  4. Install the DC/OS python tools to the virtualenv
  5. Build the release using the release tool

These steps can all be done by hand and customized / tweaked like standard python projects. You can hand create a virtualenvironment, and then do an editable pip install (pip install -e) to have a "live" working environment (as you change code you can run the tool and see the results).

Release Tool Configuration

This release tool always loads the config in dcos-release.config.yaml in the current directory.

The config is YAML. Inside it has two main sections. storage which contains a dictionary of different storage providers which the built artifacts should be sent to, and options which sets general DC/OS build configuration options.

Config values can either be specified directly, or you may use $ prefixed environment variables (the env variable must set the whole value).

Storage Providers

All the available storage providers are in release/storage. The configuration is a dictionary of a reference name for the storage provider (local, aws, my_azure), to the configuration.

Each storage provider (ex: aws.py) is an available kind prefix. The dictionary factories defines the suffix for a particular kind. For instance kind: aws_s3 would map to the S3StorageProvider.

The configuration options for a storage provider are the storage provider's constructor parameters.

Sample config storage that will save to my home directory (/home/cmaloney):

storage:
  local:
    kind: local_path
    path: /home/cmaloney/dcos-artifacts

Sample config that will store to a local archive path as well as AWS S3. To authenticate with AWS S3, reference the boto3 docs to learn how to configure access.

storage:
  aws:
    kind: aws_s3
    bucket: downloads.dcos.io
    object_prefix: dcos
    download_url: https://downloads.dcos.io/dcos/
  local:
    kind: local_path
    path: /mnt/big_artifact_store/dcos/

Repo Structure

DC/OS itself is composed of many individual components precisely configured to work together in concert.

This repo contains the release and package building tools necessary to produce installers for various on-premises and cloud platforms.

Directory Contents
cloud_images Base OS image building tools
config Release configuration
docs Documentation
flake8_dcos_lint Flake8 plugin for testing code quality
dcos_installer Backend for Web, SSH, and some bits of the Advanced installer. Code is being cleaned up
gen Python library for rendering yaml config files for various platforms into packages, with utilities to do things like make "late binding" config set by CloudFormation
packages Packages which make up DC/OS (Mesos, Marathon, AdminRouter, etc). These packages are built by pkgpanda, and combined into a "bootstrap" tarball for deployment.
pkgpanda DC/OS baseline/host package management system. Tools for building, deploying, upgrading, and bundling packages together which live on the root filesystem of a machine / underneath Mesos.
release Release tools for DC/OS. (Building releases, building installers for releases, promoting between channels)
ssh AsyncIO based parallel ssh library used by the installer
test_util various scripts, utilities to help with integration testing

Pull Requests Statuses

Pull requests automatically trigger a new DC/OS build and run several tests. These are the details on the various status checks against a DC/OS Pull Request.

Status Check Purpose Source and Dependencies
continuous-integration/jenkins/pr-head Admin Router Endpoint tests dcos/dcos/packages/adminrouter/extra/src/test-harness Docker Dependency: dcos/dcos/packages/adminrouter
mergebot/enterprise/build-status/aggregate EE Test Enforcement Private mesosphere/dcos-enterprise repo is tested against the SHA.
mergebot/enterprise/has_ship-it Code Review Enforcement Private Mergebot service in prod cluster
mergebot/enterprise/review/approved/min_2 Code Review Enforcement Mergebot service in prod cluster
mergebot/has_ship-it Code Review Enforcement Mergebot service in prod cluster
mergebot/review/approved/min_2 Code Review Enforcement Mergebot service in prod cluster
teamcity/dcos/build/dcos Builds DCOS Image (dcos_generate_config.sh) gen/build_deploy/bash.py
teamcity/dcos/build/tox Runs check-style, unit-tests tox.ini
teamcity/dcos/test/aws/cloudformation/simple Deployment using single-master-cloudformation.json and runs integration tests gen/build_deploy/aws.py,
teamcity/dcos/test/terraform/aws/onprem/static/group{1..n} Installation via dcos_generation_config.sh and runs Integration Tests gen/build_deploy/bash.py,
teamcity/dcos/test/test-e2e/group{1..n} End to End Tests. Each Test launches a cluster, exercises a functionality. test-e2e

Required vs Non-Required Status checks

A PR status check may be marked as Required or Not-Required (Default). The required status checks are necessary for applying a ship-it label, which makes the PR eligible for merge. A non-required status check is completely informational, and the success or the failure of the status check does not, in any way, impact the merge of the PR.

The required status checks are encoded in the repo's megebot-config (For .e.g: https://github.com/dcos/dcos/blob/master/mergebot-config.json#L38) and are enforced by mergebot.

dcos-cli's People

Contributors

abhay-agarwal avatar armandgrillet avatar bamarni avatar br-lewis avatar cmaloney avatar connordoyle avatar cruhland avatar grampelberg avatar janisz avatar joel-hamill avatar jsancio avatar jsrodman avatar kensipe avatar klueska avatar lloesche avatar makkes avatar meichstedt avatar mgummelt avatar mnaboka avatar msabramo avatar nickbp avatar philipnrmn avatar pierrebeitz avatar rgo3 avatar sschneid avatar ssk2 avatar swartzrock avatar takirala avatar unterstein avatar yuratolochkevich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcos-cli's Issues

`dcos marathon app update` works only if one version exists

I get an error when I try to update an app if more than one version exists:

Steps to reproduce:
1.) Create an app with one instance
2.) Execute dcos marathon app update basic-1 instances=4
3.) Wait till scaling is done
4.) Execute dcos marathon app update basic-1 instances=5

Current result:
a.) First update works as expected and app is being scaled
b.) Second update causes an error:

Error: Additional properties are not allowed ('versionInfo' was unexpected)
Value: {"backoffFactor": 1.15, "backoffSeconds": 1, "labels": {}, "cpus": 0.1, "requirePorts": false, "instances": 5, "healthChecks": [], "disk": 0.0, "id": "/basic-1", "maxLaunchDelaySeconds": 3600, "version": "2015-10-13T08:48:27.884Z", "env": {}, "uris": [], "mem": 16.0, "dependencies": [], "storeUrls": [], "versionInfo": {"lastScalingAt": "2015-10-13T08:48:27.884Z", "lastConfigChangeAt": "2015-10-13T08:48:08.480Z"}, "upgradeStrategy": {"maximumOverCapacity": 1.0, "minimumHealthCapacity": 1.0}, "cmd": "sleep 5000", "executor": "", "ports": [10001], "constraints": []}

Expected result:
Latest version of the app is being updated when executing step 4.)

Issue detected when testing mesosphere/marathon#2409

dcos registry fails

ImportError: Entry point ('console_scripts', 'dcos-registry') not found

on: poc-dcos-cli branch

dcos list failure

dcos list
Traceback (most recent call last):
File "/usr/local/bin/dcos-list", line 9, in
load_entry_point('dcos==0.0.1', 'console_scripts', 'dcos-list')()
File "/opt/demo/dcos-cli/dcos/cli.py", line 65, in wrapper
return fn(_args, *_kwargs)
File "/opt/demo/dcos-cli/dcos/log.py", line 28, in timer
return fn(_args, *_kwargs)
File "/opt/demo/dcos-cli/dcos/cli.py", line 43, in wrapper
return fn(cmd_args, _args, *_kwargs)
File "/opt/demo/dcos-cli/dcos/cmds/list.py", line 27, in main
tb.add_row(fw["name"].split('-', 1))
File "/usr/lib/python2.7/dist-packages/prettytable.py", line 818, in add_row
raise Exception("Row has incorrect number of values, (actual) %d!=%d (expected)" %(len(row),len(self._field_names)))
Exception: Row has incorrect number of values, (actual) 1!=2 (expected)

on: poc-dcos-cli branch

dcos-cli does not install on debian jessie

$ docker run -it debian
$ apt-get update
$ apt-get install python curl python-pip python-virtualenv
$ mkdir -p dcos && cd dcos &&   curl -O https://downloads.mesosphere.io/dcos-cli/install.sh &&   bash ./install.sh . http://pool-5d44-elasticl-i3e25g6agoox-1339750650.us-west-2.elb.amazonaws.com &&   source ./bin/env-setup
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     100  3654  100  3654    0     0  25742      0 --:--:-- --:--:-- --:--:-- 25914
Virtualenv version must be 12 or greater. Aborting.

dcos cli is looking for marathon with incorrect endpoint

dcos cli is looking for marathon on port 80 instead of 8080 and path /marathon/v2/info instead of /v2/info

[ec2-user@ip-172-31-18-67 cli]$ dcos package install hdfs
In order for HDFS to start successfully, it requires a minimum of five nodes; each with at least 2 CPU shares and 8GB of RAM available for use by the HDFS Service.
Note that the service is alpha and there may be bugs, including possible data loss, incomplete features, incorrect documentation or other discrepancies.
Continue installing? [yes/no] yes
Installing Marathon app for package [hdfs] version [0.1.7]
URL [http://ip-172-31-23-64.ec2.internal/marathon/v2/info] is unreachable: HTTPConnectionPool(host='ip-172-31-23-64.ec2.internal', port=80): Max retries exceeded with url: /marathon/v2/info (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x32b6e10>: Failed to establish a new connection: [Errno 111] Connection refused',))

The package list command is not merging subcommand and app packages

During manual tests we noticed that installed package information is not getting merged.

dcos package list
NAME       VERSION  APP              COMMAND    DESCRIPTION
cassandra  0.2.0-1  ---              cassandra  Apache Cassandra running on Apache Mesos
cassandra  0.2.0-1  /cassandra/dcos  ---        Apache Cassandra running on Apache Mesos
marathon   0.11.1   /marathon-user   ---        A cluster-wide init and control system for services in cgroups or Docker containers.

dcos-cli does not install on arch

$ docker run -it base/archlinux /bin/bash
$ pacman -Syu
$ pacman -S python-virtualenv python-pip
$ mkdir -p dcos && cd dcos && \
curl -O https://downloads.mesosphere.io/dcos-cli/install.sh && \
bash ./install.sh . http://pool-5d44-elasticl-i3e25g6agoox-1339750650.us-west-2.elb.amazonaws.com && \
source ./bin/env-setup
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3654  100  3654    0     0  14963      0 --:--:-- --:--:-- --:--:-- 14975
Traceback (most recent call last):
  File "/usr/sbin/pip", line 9, in <module>
    load_entry_point('pip==7.1.2', 'console_scripts', 'pip')()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 568, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2720, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2380, in load
    return self.resolve()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2386, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.5/site-packages/pip/__init__.py", line 15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python3.5/site-packages/pip/vcs/subversion.py", line 9, in <module>
    from pip.index import Link
  File "/usr/lib/python3.5/site-packages/pip/index.py", line 30, in <module>
    from pip.wheel import Wheel, wheel_ext
  File "/usr/lib/python3.5/site-packages/pip/wheel.py", line 35, in <module>
    from pip._vendor.distlib.scripts import ScriptMaker
  File "/usr/lib/python3.5/site-packages/pip/_vendor/distlib/scripts.py", line 14, in <module>
    from .compat import sysconfig, detect_encoding, ZipFile
  File "/usr/lib/python3.5/site-packages/pip/_vendor/distlib/compat.py", line 66, in <module>
    from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler'

CLI doesn't like multiple /s in the app name

➜  whereisbot git:(master) ✗ dcos marathon app add marathon.json
Error: '/ssk2/whereisbot' does not match '^/?(([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9\\-]*[a-z0-9])$'
Path: id
Value: "/ssk2/whereisbot"

[Enhancement] dcos task ssh

I would like to have a way to ssh into the environment of a certain task rather than just a node itself. For example, to ssh in to the environment of any/every elasticsearch node to install plugins etc.

For docker, this would mean using 'docker exec', but for the mesos isolator, this would just be about dropping you in the right folder.

dcos kubernetes failed on OSX

I have next issue:

$ bin/dcos-kubectl kubectl --info
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: <HOME>/.dcos/subcommands/kubernetes/env/bin/python2.7
  Reason: image not found
[1]    40818 trace trap <HOME>/.dcos/subcommands/kubernetes/env/bin/dcos-kubectl kubectl --info
$ ./bin/dcos     
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/miry/.dcos/subcommands/kubernetes/env/bin/python2.7
  Reason: image not found
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/miry/.dcos/subcommands/kubernetes/env/bin/python2.7
  Reason: image not found
Traceback (most recent call last):
  File "/Users/miry/projects/oos/dcos/bin/dcos-help", line 11, in <module>
    sys.exit(main())
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcoscli/help/main.py", line 17, in main
    return _main()
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcoscli/main.py", line 112, in wrapper
    result = func(*args, **kwargs)
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcoscli/help/main.py", line 31, in _main
    return cmds.execute(_cmds(), args)
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcos/cmds.py", line 43, in execute
    return function(*params)
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcoscli/help/main.py", line 89, in _help
    .make_command_summary_string(sorted(results))
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/concurrent/futures/_base.py", line 581, in result_iterator
    yield future.result()
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcos/subcommand.py", line 132, in documentation
    return (path_noun, info(executable_path, path_noun))
  File "/Users/miry/projects/oos/dcos/lib/python2.7/site-packages/dcos/subcommand.py", line 147, in info
    [executable_path, path_noun, '--info'])
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/Users/miry/.dcos/subcommands/kubernetes/env/bin/dcos-kubectl', 'kubectl', '--info']' returned non-zero exit status -5
 $ ./bin/dcos --version
dcos version 0.3.0
$ uname -a
Darwin host.local 15.4.0 Darwin Kernel Version 15.4.0: Sun Jan  3 21:35:22 PST 2016; root:xnu-3248.40.155~11/RELEASE_X86_64 x86_64

`dcos marathon app add` should support adding an app from a URL to a marathon.json

Would be really handy when writing tutorials to make it so people don't have to copy / paste into a local document (or do a download) before they are able to follow a command in a tutorial.

These are things meant to serve as examples, rather than stuff which should / would be packaged through formal channels / the universe and multiverse.

Error installing 'spark' package

[ec2-user@ip-172-31-50-60 dcos]$ dcos --log-level=ERROR package install spark
Note that the Apache Spark DCOS Service is beta and there may be bugs, incomplete features, incorrect documentation or other discrepancies.
We recommend a minimum of two nodes with at least 2 CPU and 2GB of RAM available for the Spark Service and running a Spark job.
Note: The Spark CLI may take up to 5min to download depending on your connection.
Continue installing? [yes/no] yes
Installing Marathon app for package [spark] version [1.5.0-multi-roles-v2]
Installing CLI subcommand for package [spark] version [1.5.0-multi-roles-v2]
2016-01-01 04:51:13,440 /home/ec2-user/dcos/local/lib/python2.7/site-packages/dcos/subcommand.py:_execute_install:411 - Install script's stdout: Collecting dcos-spark==0.4.0-spark-1.5.0-multi-roles-v2-bin-2.4.0 from https://s3.amazonaws.com/downloads.mesosphere.io/dcos/spark/dcos_spark-0.4.0_spark_1.5.0_multi_roles_v2_bin_2.4.0-py2.py3-none-any.whl (from -r /tmp/tmpK6g6X2 (line 1))
Downloading https://s3.amazonaws.com/downloads.mesosphere.io/dcos/spark/dcos_spark-0.4.0_spark_1.5.0_multi_roles_v2_bin_2.4.0-py2.py3-none-any.whl (228.9MB)

2016-01-01 04:51:13,440 /home/ec2-user/dcos/local/lib/python2.7/site-packages/dcos/subcommand.py:_execute_install:412 - Install script's stderr: Exception:
Traceback (most recent call last):
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/commands/install.py", line 305, in run
wb.build(autobuilding=True)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/wheel.py", line 705, in build
self.requirement_set.prepare_files(self.finder)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/req/req_set.py", line 491, in _prepare_file
session=self.session)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/download.py", line 825, in unpack_url
session,
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/download.py", line 886, in _download_http_url
_download_url(resp, link, content_file)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/download.py", line 621, in _download_url
for chunk in progress_indicator(resp_read(4096), 4096):
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/utils/ui.py", line 133, in iter
for x in it:
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/download.py", line 586, in resp_read
decode_content=False):
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 307, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 243, in read
data = self._fp.read(amt)
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 224, in cache_response
self.serializer.dumps(request, response, body=body),
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 49, in dumps
"body": _b64_encode_bytes(body),
File "/home/ec2-user/.dcos/subcommands/spark/env/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 12, in _b64_encode_bytes
return base64.b64encode(b).decode("ascii")
File "/usr/lib64/python2.7/base64.py", line 53, in b64encode
encoded = binascii.b2a_base64(s)[:-1]
MemoryError

Error installing 'spark' package.

dcos package fails with new available pip version

My dcos setup worked fine. Today "dcos package install kubernetes" failed without any sensible error message:

Error installing 'kubernetes' package

With log-level set to debug I get this:

...
Creating directory: '/Users/sts/.dcos/subcommands/kubernetes'
Calling: ['/Users/sts/Quellen/mesos/dcos-cli/cli/env/bin/virtualenv', '/Users/sts/.dcos/subcommands/kubernetes/env']
Install script's stdout: Using real prefix '/System/Library/Frameworks/Python.framework/Versions/2.7'
New python executable in /Users/sts/.dcos/subcommands/kubernetes/env/bin/python
Installing setuptools, pip...done.

Install script's stderr: 
Calling: ['/Users/sts/.dcos/subcommands/kubernetes/env/bin/pip', 'install', '--requirement', '/var/folders/gg/zn9yfdld21j7xg5jnj5zz5d80000gn/T/tmp1W0OCQ']
Install script's stdout: 
Install script's stderr: You are using pip version 6.1.1, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Exception:
Traceback (most recent call last):
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/basecommand.py", line 246, in main
    status = self.run(options, args)
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
    finder=finder, options=options, session=session):
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/req/req_file.py", line 135, in parse_requirements
    isolated=options.isolated_mode if options else False,
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/req/req_install.py", line 220, in from_line
    isolated=isolated)
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/req/req_install.py", line 79, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2960, in parse
    reqs = list(parse_requirements(s))
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2904, in parse_requirements
    "version spec")
  File "/Users/sts/.dcos/subcommands/kubernetes/env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', '[email protected]:mesosphere/dcos-kubernetes-cli.git#egg=dcos-kubernetes', 'at', '@github.com:mesosphere/dcos-kubernetes-cli.git#egg=dcos-kubernetes')

config set core.mesos_master_url to a zookeeper URI

Hi all,
I'm using just the CLI without a full DCOS.
I want to set the core.mesos_master_url to a zk URI which is permitted. Is this setting only available with a full DCOS instance or am I missing something? A master failover is not really covered with the hardcoding of a mesos master URI.
Many greets
Michael

Rewrite SSH Tests

The tests in dcos-cli/cli/tests/integrations/test_node.py which claim to test the ability to SSH into DCOS Master and Slave nodes passed, but did not actually verify the desired functionality. Attempting to SSH to DCOS Mesos nodes does not work. The tests should be rewritten to verify actual functionality.

Update Tests to Run Against DCOS Cluster

I believe that current tests only run against Mesos clusters with Marathon running. I do not believe they actually run against DCOS clusters. The test infrastructure for the dcos-cli tests needs to provision a DCOS cluster.

User PATH variable being replaced on windows

I am installing dcos-cli on Windows 8.1 64-bit using the installer script available here: https://downloads.mesosphere.io/dcos-cli/install.ps1

When running the script, it replaces the user's PATH variable with the install path: C:\Users\user\Desktop\dcos-cli\Scripts\.

This means that the existing paths in the PATH variable is removed, which can break a few things.

It would be great if it's able to concatenate the dcos-cli path instead of replacing the path.

'dcos marathon groups add' error when dependencies defined

I'm testing marathon's application groups via dcos and created a sample json. When I'm posting it via curl to Marathons REST api, it is successfully started. However via dcos cli I get errors.

If I add a toplevel empty
"apps": [ ]
property into the json, then I get:
RefResolutionError: Unresolvable JSON pointer: u'definitions/pathType'

Without the apps property just a lengthy stacktrace.

This is the command I'm using:
dcos marathon group add multi.json

The json:

{
  "id": "/multi-test7",
  "groups": [ {
    "id": "/multi-test7/persistence",
    "apps": [ {
      "id": "/multi-test7/persistence/mongo",
      "cmd": "while [ true ] ; do echo 'Fake MongoDB server' ; sleep 5 ; done",
      "cpus": 0.1,
      "mem": 64.0,
      "instances": 1
    }]
  },{
    "id": "/multi-test7/persistence2",
    "apps": [ {
      "id": "/multi-test7/persistence2/mongo",
      "dependencies": ["/multi-test7/persistence/mongo"],
      "cmd": "while [ true ] ; do echo 'Fake MongoDB server' ; sleep 5 ; done",
      "cpus": 0.1,
      "mem": 64.0,
      "instances": 1
    }]
  } ]
}

After some testing it turned out that if I remove the dependencies property from the json, it will be posted successfully to Marathon via dcos cli.

Security at DCOS and dcos-cli

Now we revised dcos/dcos-cli code to discover security implemented into dcos and actually we didn’t find a lot. We see OAuth implementation hardcoded into dcos cli.

So I just wondering about your strategy about security.

  • What security elements will be implemented into DCOS?
  • What approaches will be used?
  • Are you planing to implement account management (Identity, Authorisation, Policy, Audit)?

dcos package install --cli <service> shouldn't print requirements for running the service

When I have an installed cassandra on a cluster, that it prints out the requirements makes me think it's about to launch a new cassandra cluster

dcos package install --cli cassandra
The Apache Cassandra DCOS Service implementation is alpha and there may be bugs, incomplete features, incorrect documentation or other discrepancies.
The default configuration requires 3 nodes each with 0.3 CPU shares, 1184MB of memory and 272MB of disk.
Continue installing? [yes/no] yes
Installing CLI subcommand for package [cassandra] version [0.2.0-1]
New command available: dcos cassandra
Thank you for installing the Apache Cassandra DCOS Service.

    Documentation: http://mesosphere.github.io/cassandra-mesos/
    Issues: https://github.com/mesosphere/cassandra-mesos/issues

`dcos marathon group update` does nothing

I am not sure if this is a case of marathon hasn't yet implemented group update or if the dcos CLI is doing it wrong but I get no error and yet nothing changes on marathon. Either way a change should be made to the CLI either informing that the feature is not yet supported or being fixed to work as expected.

If this should be working, let me know and I will try to make a simple marathon group to be able to reproduce.

Thanks in advance.

"dcos node ssh --master" resolves host to internal IP

Running

dcos node ssh --master --option IdentityFile=/Users/gabriel/.ssh/gabriel.pem --user=core

against a test/continuous cluster fails with

ssh: connect to host 10.0.4.191 port 22: Operation timed out

It appears the MesosDNSClient is resolving the internal IP of master. This is confirmed when looking at the Mesos UI which reports

Cluster:gabriel-test
Server:10.0.4.191:5050

This command should resolve the public IP.

dcos marathon app add doesn't return bad request message

When I add a app with "dcos marathon app add" and a json, if marathon returns a 400 with a message saying why the json definition is bad, all I see from the terminal is 400 Bad Request. So for a user to figure out what's wrong they still need to curl themselves to marathon to get the exact error message.

We should print out the response body so users can fix their json def.

SSH to Slave functionality/comment disagreement

SSH to slave nodes not work. The comments in the code describe how it should work and then fail to implement what they describe.

def _ssh(master, slave, option, config_file, user):
    """SSH into a DCOS node.  Since only the masters are definitely
    publicly available, we first ssh into an arbitrary master, then
    hop to the desired node.
    ...
    """

Either implement this feature or remove the comment. See the dicussion here. Probably the comment should be removed.

Allow for environment variables to overwrite default DCOS config

I feel it would be beneficial to have the flexibility to allow for environment variables (or argument variables) to be used to override the default configuration TOML file.

I have a need for this in the circumstance I'm in, where we have a default config that points to our production marathon URI and I would like to use the cli (wrapped in a propriatery docker container) to interface with a local marathon deploy on my machine. I realize that I could just download the vanilla CLI on my machine and have a config point to localhost, but it would be preferable to simply set environment variables and have those override the read config.

Provide printing task log to subcommands

Currently dcos-cli supports service log, but similiarly will be great to support task logs especially for subcommands.

A use case that this is great for is Spark, as the results of the Spark job is in the stdout/stderr and it's not easy to get the results from Mesos UI due to DCOS making slaves private.

Will be nice that we can just do "dcos spark log " which then call a library function from dcos package.

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.