Original README

This project provides a convenience CLI for creating, testing andworking with ACS clusters. It's a work in progress and we welcomecontributions via the project issue tracker.

Quickstart

Install Docker.

Start the CLI container

docker run -it -v ~/.ssh:/root/.ssh -v ~/.acs:/root/.acs rgardler/acs

View the available commands

acs --help

Demo application

The CLI provides quick commands to deploy clusters and demoapplications in those clusters. To see the available demo's run:

acs demo --help

Do deploy a demo run:

acs demo microscaling

The above command will:

ask the user to interactively login to their Azure subscription

create an ACS cluster to the specifications defined by the user

customize the ACS instance to open an addiitonal public port

create a storage account for our application

deploy a multi-container demo application

To remove a demo from a cluster run (this does not remove the cluster,only the demo application):

acs demo microscaling --remove

Ways to run the ACS CLI

Assuming you have Docker installed the application will run "out of thebox" with the following command:

docker run -it rgardler/acs

You may also choose to use the latest developer version (which is the defaultbranch in github). This versoin will likely have features and fixes that arestill being tested. Simply use the ':dev' tag:

docker run -it rgardler/acs:dev

Although not required, it is preferable to mount your ssh and acsconfiguration files into the running container. This way you can usethe same files across multiple versions of the cli container. To dothis use the following mounts:

Create a Cluster

Since the first thing most users will want to do is create a clusterwe are documenting this command here. Please see acs --help for alist of all available commands.

acs service create

Unless otherwise specified the cluster configuration is defined in~/.acs/default.ini within the container. If you mapped a localdirectory to this location then it will be persisted on yourclient. If this file does not exists you will be asked to answer somequestions about your desired configuration and the file will becreated for you.

You can override the location of the configuration file with theoption --config-file=PATH_TO_FILE, if the file exists it will beused, if not you will be asked the same questions and the file will becreated.

Connecting to your cluster

It is necessary to open an SSH tunnel to you cluster. By default theacs cli will use the keys in ~/.ssh/id_rsa (this can be configuredin the ini file in ~/.acs/. If the identified keys don't existwhen you run the acs service create command they will be created foryou.

To easily create a tunnel to your cluster run:

acs service connect

Take a note of the pid file this command outputs as you may want to kill this tunnel at a later time with:

kill $PID

Working with DCOS

If your cluster is using DC/OS as the orchestrator and you created itusing this set of tools then the DC/OS CLI will have been installedfor you when you created the cluster. If, however, you deployed thecluster using a different method you can install the DC/OS cli withthe following commands.

acs service install_dcos_cli
. /src/bin/env-setup

Once installed you can run DCOS command directly with dcos COMMAND(you must first have connected to the cluster with acs service
connect).

Development

The easiest way to get started is to develop using the Dockercontainer, however, the application is a Python3 application can canbe run anywhere you can find Python 3. First you need to clone the devbranch of the code:

git clone https://github.com/rgardler/acs-cli/tree/dev acs-cli

Once you have the source code, you can build a development containerwith:

./scripts/build-docker.sh

To run your container with local files mapped into it:

./scripts/dev-docker.sh

Now you can edit the files using your favorite editor and test theapplication from within the container. Note that when you have madechanges to your source files you should run the following in yourcontainer:

python setup.py install

Development without Docker

If you would prefer to work outside of a container then consult theDockerfile in the project root for details of how to set up yourdevelopment environment.