Skip to main content

Amazon Web Services Operator Interface

Project description

Aegea is a command line interface (CLI) that provides a set of essential commands and terminal dashboards for operators of Amazon Web Services (AWS) accounts. Aegea lets you build AMIs and Docker images using the cloud-init config management package, launch and monitor instances and services, and manage AWS resources in over 20 core AWS services. It is intended to be used in conjunction with the existing functionality of the AWS CLI and boto3.

Installation

pip install aegea

Before you do this, you will also need to install some system library dependencies:

OS

Python

Command

OS X

sudo easy_install-2.7 pip; sudo pip install --ignore-installed six python-dateutil; sudo pip install aegea (if prompted to install XCode Command Line Tools, do it and try again)

Ubuntu

Python 2

sudo apt-get update; sudo apt-get install build-essential python-pip python-dev python-cffi libffi-dev libssl-dev moreutils

Ubuntu

Python 3

sudo apt-get update; sudo apt-get install build-essential python3-{pip,dev,cffi} libffi-dev libssl-dev moreutils

Red Hat

Python 2

sudo yum install python-devel python-cffi openssl-devel moreutils

Red Hat

Python 3

sudo yum install python3-devel python3-cffi openssl-devel moreutils

Run aws configure to configure IAM access credentials that will be used by the aws and aegea commands. You can create a new IAM key at https://console.aws.amazon.com/iam/home#/users.

Local install: run make install in this directory.

No root access; user-local install: Use make install_venv to install aegea in its own virtualenv. The last line of the output shows how to activate the virtualenv.

Aegea Batch

The AWS Batch API lets you run non-interactive command line workflows in Docker containers, managing AWS ECS, Spot Fleet, and EC2 in your account on your behalf. Use the aegea batch family of commands to interact with AWS Batch. The key command is aegea batch submit to submit jobs.

Running aegea batch submit for the first time will create a default Batch managed compute environment and a queue for it. The managed compute environment which automatically scales to accommodate jobs that you submit (although this may happen too slowly for your liking; you can run aegea batch update-compute-environment aegea_batch --desired-vcpus N to force Batch to scale up to N vCPUs to start your job; find the appropriate N by running aegea batch compute-environments and adding a small number to the computeResources.desiredvCpus column).

By default, aegea batch submit --command COMMAND will ask Batch to run your command in an ubuntu container, which will cause the Ubuntu image tagged with the “latest” tag to be fetched from DockerHub. You can specify a Docker image of your liking with the aegea batch submit --image IMAGE option.

aegea/missions/docker-example/ is a root directory of an aegea mission - a configuration management role. It has a rootfs.skel and a config.yml, which has directives to install packages, etc. The example just installs the bwa APT package.

Run aegea-build-image-for-mission docker-example dex to build an ECR image called dex from the “docker-example” mission. You can list ECR images with aegea ecr ls, and delete them with e.g. aws ecr delete-repository dex.

Run aegea batch submit --ecs-image dex --command "bwa aln || true" "bwa mem || true" --memory 2048 --vcpus 4 --watch to run a Batch job that requires 2 GB RAM and 4 cores to be allocated to the Docker container, using the “dex” image, and executes two commands as listed after –command, using “bash -euo pipefail -c”.

You can also use aegea batch submit --execute FILE. This will slurp up FILE (any type of shell script or ELF executable) and execute it in the job’s Docker container.

The concurrency and cost of your Batch jobs is governed by the “Max vCPUs” setting in your compute environment. To change the capacity or other settings of your compute environment, go to https://console.aws.amazon.com/batch/home?region=us-east-1#/compute-environments, select “aegea_batch”, and click “Edit”.

AWS Batch launches and manages ECS host instances to execute your jobs. You can see the host instances by running aegea ls.

Aegea ECS Run

The ECS Fargate API is an interface to the AWS container-based virtualization platform, Firecracker. ECS Fargate allows you to run workloads in fully managed containers: no instances run in your account; you are billed by the second of container use, and containers usually start up within 20 seconds. Use the aegea ecs run command to interact with ECS Fargate. Most aegea batch semantics are applicable to aegea ecs, which interacts with ECS via the “one shot” ECS RunTask API.

Configuration management

Aegea supports ingesting configuration from a configurable array of sources. Each source is a JSON or YAML file. Configuration sources that follow the first source update the configuration using recursive dictionary merging. Sources are enumerated in the following order (i.e., in order of increasing priority):

  • Site-wide configuration source, /etc/aegea/config.yml

  • User configuration source, ~/.config/aegea/config.yml

  • Any sources listed in the colon-delimited variable AEGEA_CONFIG_FILE

  • Command line options

Array merge operators: When loading a chain of configuration sources, Aegea uses recursive dictionary merging to combine the sources. Additionally, when the original config value is a list, Aegea supports array manipulation operators, which let you extend and modify arrays defined in underlying configurations. See https://github.com/kislyuk/tweak#array-merge-operators for a list of these operators.

Building AMIs and Docker images

Aegea includes a lightweight configuration management system for building machine images based on cloud-init (both Docker images and AMIs are supported).

TODO: build_image build_ami build_docker_image rootfs.skel

https://img.shields.io/travis/com/kislyuk/aegea.svg https://img.shields.io/pypi/v/aegea.svg https://img.shields.io/pypi/l/aegea.svg https://codecov.io/gh/kislyuk/aegea/branch/master/graph/badge.svg

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aegea-2.7.2.tar.gz (193.6 kB view details)

Uploaded Source

Built Distribution

aegea-2.7.2-py2.py3-none-any.whl (265.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file aegea-2.7.2.tar.gz.

File metadata

  • Download URL: aegea-2.7.2.tar.gz
  • Upload date:
  • Size: 193.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for aegea-2.7.2.tar.gz
Algorithm Hash digest
SHA256 2b4cd3deeee1079de4c4640b51084bea68a046b6c1372e94fc64643fa86afcf2
MD5 2f935a3b8c37ad0fade38ca37a2b6ffc
BLAKE2b-256 9c60076c705674c22536d254212f4fc60d2dab1ae1fe8dda7d655e8fd529058e

See more details on using hashes here.

Provenance

File details

Details for the file aegea-2.7.2-py2.py3-none-any.whl.

File metadata

  • Download URL: aegea-2.7.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 265.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for aegea-2.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 500b426b12a0bedca9d8079def2cceceb671a60690e519e19f71a0b59349ff4e
MD5 a89e3a9a3a47cedc48e57c081fcc9d94
BLAKE2b-256 8a6cd9b691edc2259be5d593b684bff834c223014ba21392bf0711bb3054990d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page