Skip to content

Commit

Permalink
Merge pull request #1729 from dcos/fix-aws-install
Browse files Browse the repository at this point in the history
Fix AWS provision tools
  • Loading branch information
adamtheturtle authored Apr 18, 2019
2 parents e0e17a9 + 726984e commit 02cd7a7
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/dcos_e2e_cli/dcos_aws/commands/install_dcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@
)
from dcos_e2e_cli.common.options import (
cluster_id_option,
copy_to_master_option,
extra_config_option,
genconf_dir_option,
license_key_option,
security_mode_option,
verbosity_option,
)
from dcos_e2e_cli.common.utils import command_path
from dcos_e2e_cli.common.utils import check_cluster_id_exists, command_path
from dcos_e2e_cli.common.variants import get_install_variant
from dcos_e2e_cli.common.workspaces import workspace_dir_option

from ._common import ClusterInstances
from ._common import ClusterInstances, existing_cluster_ids
from ._options import aws_region_option
from ._variant import variant_option
from ._wait_for_dcos import wait_for_dcos_option
from .doctor import doctor
from .wait import wait


@click.command('create')
@click.command('install')
@click.argument(
'installer_url',
type=str,
Expand All @@ -48,7 +47,6 @@
@license_key_option
@genconf_dir_option
@security_mode_option
@copy_to_master_option
@verbosity_option
@cluster_id_option
@click.pass_context
Expand All @@ -68,6 +66,11 @@ def install_dcos(
"""
Install DC/OS on a provisioned AWS cluster.
"""
check_cluster_id_exists(
new_cluster_id=cluster_id,
existing_cluster_ids=existing_cluster_ids(aws_region=aws_region),
)

cluster_instances = ClusterInstances(
cluster_id=cluster_id,
aws_region=aws_region,
Expand Down
38 changes: 37 additions & 1 deletion tests/test_cli/test_dcos_aws/help_outputs/dcos-aws-create.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
Usage: minidcos aws create [OPTIONS] INSTALLER_URL

Install DC/OS on a provisioned AWS cluster.
Create a DC/OS cluster.

DC/OS Enterprise

DC/OS Enterprise clusters require different configuration variables to DC/OS OSS.
For example, enterprise clusters require the following configuration parameters:

``superuser_username``, ``superuser_password_hash``,
``fault_domain_enabled``, ``license_key_contents``

These can all be set in ``--extra-config``.
However, some defaults are provided for all but the license key.

The default superuser username is ``admin``.
The default superuser password is ``admin``.
The default ``fault_domain_enabled`` is ``false``.

``license_key_contents`` must be set for DC/OS Enterprise 1.11 and above.
This is set to one of the following, in order:

* The ``license_key_contents`` set in ``--extra-config``.
* The contents of the path given with ``--license-key``.
* The contents of the path set in the ``DCOS_LICENSE_KEY_PATH`` environment variable.

If none of these are set, ``license_key_contents`` is not given.

Options:
--custom-tag TEXT Add tags to EC2 instances in the format
"<TAG_KEY>:<TAG_VALUE>".
--variant [oss|enterprise] Choose the DC/OS variant. If the variant does
not match the variant of the given installer
URL, an error will occur. [required]
Expand All @@ -11,11 +37,18 @@ Options:
wait" after this command. "minidcos aws wait"
has various options available and so may be
more appropriate for your use case.
--masters INTEGER The number of master nodes. [default: 1]
--agents INTEGER The number of agent nodes. [default: 1]
--extra-config PATH The path to a file including DC/OS
configuration YAML. The contents of this file
will be added to add to a default
configuration.
--public-agents INTEGER The number of public agent nodes. [default:
1]
--aws-region TEXT The AWS region to use. [default: us-west-2]
--linux-distribution [centos-7|coreos|rhel-7]
The Linux distribution to use on the nodes.
[default: centos-7]
--workspace-dir DIRECTORY Creating a cluster can use approximately 2 GB
of temporary storage. Set this option to use a
custom "workspace" for this temporary storage.
Expand Down Expand Up @@ -44,4 +77,7 @@ Options:
-c, --cluster-id TEXT A unique identifier for the cluster. Use the
value "default" to use this cluster for other
commands without specifying --cluster-id.
--enable-selinux-enforcing With this flag set, SELinux is set to
enforcing before DC/OS is installed on the
cluster.
-h, --help Show this message and exit.
43 changes: 43 additions & 0 deletions tests/test_cli/test_dcos_aws/help_outputs/dcos-aws-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Usage: minidcos aws install [OPTIONS] INSTALLER_URL

Install DC/OS on a provisioned AWS cluster.

Options:
--variant [oss|enterprise] Choose the DC/OS variant. If the variant does
not match the variant of the given installer
URL, an error will occur. [required]
--wait-for-dcos Wait for DC/OS after creating the cluster.
This is equivalent to using "minidcos aws
wait" after this command. "minidcos aws wait"
has various options available and so may be
more appropriate for your use case.
--extra-config PATH The path to a file including DC/OS
configuration YAML. The contents of this file
will be added to add to a default
configuration.
--aws-region TEXT The AWS region to use. [default: us-west-2]
--workspace-dir DIRECTORY Creating a cluster can use approximately 2 GB
of temporary storage. Set this option to use a
custom "workspace" for this temporary storage.
See https://docs.python.org/3/library/tempfile
.html#tempfile.gettempdir for details on the
temporary directory location if this option is
not set.
--license-key FILE This is ignored if using open source DC/OS. If
using DC/OS Enterprise, this defaults to the
value of the `DCOS_LICENSE_KEY_PATH`
environment variable.
--genconf-dir DIRECTORY Path to a directory that contains additional
files for the DC/OS installer. All files from
this directory will be copied to the "genconf"
directory before running the DC/OS installer.
--security-mode [disabled|permissive|strict]
The security mode to use for a DC/OS
Enterprise cluster. This overrides any
security mode set in ``--extra-config``.
-v, --verbose Use verbose output. Use this option multiple
times for more verbose output.
-c, --cluster-id TEXT A unique identifier for the cluster. Use the
value "default" to use this cluster for other
commands without specifying --cluster-id.
-h, --help Show this message and exit.
3 changes: 2 additions & 1 deletion tests/test_cli/test_dcos_aws/help_outputs/dcos-aws.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Options:
-h, --help Show this message and exit.

Commands:
create Install DC/OS on a provisioned AWS cluster.
create Create a DC/OS cluster.
doctor Diagnose common issues which stop this CLI from working...
inspect Show cluster details.
install Install DC/OS on a provisioned AWS cluster.
list List all clusters.
provision Provision an AWS cluster to install DC/OS.
run Run an arbitrary command on a node or multiple nodes.
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli/test_minidcos/help_outputs/minidcos-aws.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Options:
-h, --help Show this message and exit.

Commands:
create Install DC/OS on a provisioned AWS cluster.
create Create a DC/OS cluster.
doctor Diagnose common issues which stop this CLI from working...
inspect Show cluster details.
install Install DC/OS on a provisioned AWS cluster.
list List all clusters.
provision Provision an AWS cluster to install DC/OS.
run Run an arbitrary command on a node or multiple nodes.
Expand Down

0 comments on commit 02cd7a7

Please # to comment.