nameless-deploy-tools


Namenameless-deploy-tools JSON
Version 1.328 PyPI version JSON
download
home_pageNone
SummaryTools for deploying to AWS via CloudFormation and Serverless framework that support a pull request based workflow
upload_time2024-12-11 14:54:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements argcomplete boto3 botocore certifi cffi charset-normalizer cloudformation-utils configparser cryptography decorator ec2-utils future idna ipaddr jmespath netifaces nitor-vault py pyaml pycparser pycryptodomex pygments pyopenssl pyotp pyqrcode python-dateutil pyyaml requests retry s3transfer scandir six termcolor threadlocal-aws urllib3
Travis-CI No Travis.
coveralls test coverage
            # Nameless Deploy Tools

[![Build Status](https://api.travis-ci.com/NitorCreations/nameless-deploy-tools.svg?branch=master)](https://app.travis-ci.com/github/NitorCreations/nameless-deploy-tools/)
[![Coverage Status](https://coveralls.io/repos/github/NitorCreations/nameless-deploy-tools/badge.svg?branch=master)](https://coveralls.io/github/NitorCreations/nameless-deploy-tools?branch=master)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

## Released version 1.328

Nameless deploy tools are a set of tools to implement a true Infrastructure As Code workflow
with various cloud infrastructure management tools.
Currently supported tools are:

- CloudFormation
- AWS CDK
- Serverless Framework
- Terraform
- Azure Resource Manager (with YAML syntax)
- Bicep

## Why Nameless?

A common analogy for cloud infrastructure has been to move from having pets with
names that need lots of looking after, to cattle that has at most id's.
It's time to move to the industrial age from the agrarian era.
The infrastructure our applications runs now comes and goes,
and we know at most some statistical information about the actual executions.
Run times, memory usage, used bandwidth and the like.
We no longer know even the id's of the things that actually run the code.
Hence - nameless.

## Rationale

We at Nitor are software engineers with mostly a developer or architect background,
but a lot of us have had to work closely with various Operations teams around the world.
DevOps has a natural appeal to us and immediately "infrastructure as code" meant for us
that we should apply the best development practices to infrastructure development.
It starts with version control and continues with testing new features in isolation and a workflow that supports this.
Our teams usually take into use a feature branch workflow if it is feasible,
and we expect all the tools and practices to support this.
For infrastructure this type of branching means that you should be able to spin up enough of the infrastructure
to be able to verify the changes you want to implement in production.
Also, the testing environment should be close enough to the target environment for the results to be valid.
So the differences between testing and production environments should be minimized and reviewable.

With the popular tools like Ansible, Terraform, Chef etc.
you need to come up with and implement the ways to achieve the goals above.
As far as I know, no tool besides ndt has at its core a thought-out way of a branching infrastructure development model.

## What it is

nameless-deploy-tools works by defining _Amazon Machine Images_,
_[Docker containers](https://www.docker.com)_,
_[Serverless services](https://serverless.com)_,
and deploying _[CloudFormation](https://aws.amazon.com/cloudformation/)
stacks_ of resources. CloudFormation stacks can also be defined with _[AWS CDK](https://awslabs.github.io/aws-cdk/)_
applications. All of the above can also be deployed using _[Terraform](https://www.terraform.io)_.

## Installation

Requires Python 3.9 or newer.

Use pipx or uv to install it globally in an isolated environment.
[pipx](https://github.com/pypa/pipx) is the older and stable tool,
[uv](https://github.com/astral-sh/uv) is a new, much faster version.

```shell
pipx install nameless-deploy-tools
# or
uv tool install nameless-deploy-tools
```

Directly installing with pip is no longer supported by most Python distributions.

## Getting started

To use nameless-deploy-tools you need to set up a _project repository_ that
describes the images you want to build, and the stacks you want to deploy them in.
See [ndt-project-template](https://github.com/NitorCreations/ndt-project-template) for an example.

Here are few commands you can use. All of these are run in your project repository root.
You need to have AWS credentials for command line access set up.

- To bake a new version of an image: `ndt bake-image <image-name>`
- To build a new Docker container image `ndt bake-docker <component> <docker-name>`
- To deploy a stack:
  - with a known AMI id: `ndt deploy-stack <image-name> <stack-name> <AMI-id>`
  - with the newest AMI id by a given bake job: `ndt deploy-stack <image-name> <stack-name> "" <bake-job-name>`
- To undeploy a stack: `ndt undeploy-stack <image-name> <stack-name>`

For full list of commands see [here](docs/commands.md)

### Faster shell complete

You can additionally use a faster register-complete by running `./faster_register_complete.sh`.
This compiles C++ programs from the files
[n_utils/nameless-dt-register-complete.cpp](n_utils/nameless-dt-register-complete.cpp)
and [n_utils/nameless-dt-print-aws-profiles.cpp](n_utils/nameless-dt-print-aws-profiles.cpp),
and replaces the Python versions of `nameless-dt-register-complete`
and `nameless-dt-print-aws-profiles` with these much faster compiled binaries.

## Documentation

- [Command Reference](docs/commands.md)
- [ndt workspace tooling](docs/workspace.md)
- [Template Pre-Processing](docs/template-processing.md)
- [Multifactor Authentication](docs/mfa.md)
- [Common parameters](docs/parameters.md)

## Versioning

This library uses a simplified semantic versioning scheme: major version change for changes
that are not backwards compatible (not expecting these) and the minor
version for all backwards compatible changes. We won't make the distinction between
new functionality and bugfixes, since we don't think it matters and is not a thing
worth wasting time on. We will release often and if we need changes that are not comptatible,
we will fork the next major version and release alphas versions of that until we are
happy to release the next major version and try and have a painless upgrade path.

## Development

uv is the recommended way to handle virtual environments for development.

Create a venv and install all dependencies:

```shell
uv sync --all-extras
```

You can then run commands directly with the venv using `uv run`,
or activate the venv manually first.
The uv default venv location is `.venv`.

```shell
source .venv/bin/activate
# or Windows
.venv\Scripts\activate
```

## Dependencies

Python dependencies are specified in [pyproject.toml](./pyproject.toml).
The `requirements.txt` file is generated by pip compile and should not be modified manually.

Use the provided shell script to update the requirements file.
First install [uv](https://github.com/astral-sh/uv) (recommended),
or alternatively `pip-tools` using [pipx](https://github.com/pypa/pipx).
Then run:

```shell
./compile-requirements.sh
# See help
./compile-requirements.sh -h
```

## Running tests

### Using uv

```shell
uv run python -m pytest -v .
```

## Inside active virtual env

Install test requirements:

```shell
pip install -r dev-requirements.txt
```

Run tests with Pytest:

```shell
python -m pytest -v .
```

## Code formatting and linting

Code formatting and linting with [ruff](https://github.com/charliermarsh/ruff).

These are configured with a custom line length limit of 120.
The configs can be found in [pyproject.toml](./pyproject.toml).

Usage:

```shell
ruff format
ruff check --fix
```

Using with [pre-commit](https://pre-commit.com/):

```shell
# setup to be run automatically on git commit
pre-commit install

# run manually
pre-commit run --all-files
```

## Release

Use the provided shell script.
Note that you need to have a venv with the extra dependencies installed active when running the script.

```shell
./release.sh
# See help
./release.sh -h
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nameless-deploy-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Pasi Niemi <pasi@nitor.com>",
    "download_url": "https://files.pythonhosted.org/packages/f7/26/8ddfab4e741277679654b138c8182988bd2b14c5d55f24bfd3064ab6cafa/nameless_deploy_tools-1.328.tar.gz",
    "platform": null,
    "description": "# Nameless Deploy Tools\n\n[![Build Status](https://api.travis-ci.com/NitorCreations/nameless-deploy-tools.svg?branch=master)](https://app.travis-ci.com/github/NitorCreations/nameless-deploy-tools/)\n[![Coverage Status](https://coveralls.io/repos/github/NitorCreations/nameless-deploy-tools/badge.svg?branch=master)](https://coveralls.io/github/NitorCreations/nameless-deploy-tools?branch=master)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n## Released version 1.328\n\nNameless deploy tools are a set of tools to implement a true Infrastructure As Code workflow\nwith various cloud infrastructure management tools.\nCurrently supported tools are:\n\n- CloudFormation\n- AWS CDK\n- Serverless Framework\n- Terraform\n- Azure Resource Manager (with YAML syntax)\n- Bicep\n\n## Why Nameless?\n\nA common analogy for cloud infrastructure has been to move from having pets with\nnames that need lots of looking after, to cattle that has at most id's.\nIt's time to move to the industrial age from the agrarian era.\nThe infrastructure our applications runs now comes and goes,\nand we know at most some statistical information about the actual executions.\nRun times, memory usage, used bandwidth and the like.\nWe no longer know even the id's of the things that actually run the code.\nHence - nameless.\n\n## Rationale\n\nWe at Nitor are software engineers with mostly a developer or architect background,\nbut a lot of us have had to work closely with various Operations teams around the world.\nDevOps has a natural appeal to us and immediately \"infrastructure as code\" meant for us\nthat we should apply the best development practices to infrastructure development.\nIt starts with version control and continues with testing new features in isolation and a workflow that supports this.\nOur teams usually take into use a feature branch workflow if it is feasible,\nand we expect all the tools and practices to support this.\nFor infrastructure this type of branching means that you should be able to spin up enough of the infrastructure\nto be able to verify the changes you want to implement in production.\nAlso, the testing environment should be close enough to the target environment for the results to be valid.\nSo the differences between testing and production environments should be minimized and reviewable.\n\nWith the popular tools like Ansible, Terraform, Chef etc.\nyou need to come up with and implement the ways to achieve the goals above.\nAs far as I know, no tool besides ndt has at its core a thought-out way of a branching infrastructure development model.\n\n## What it is\n\nnameless-deploy-tools works by defining _Amazon Machine Images_,\n_[Docker containers](https://www.docker.com)_,\n_[Serverless services](https://serverless.com)_,\nand deploying _[CloudFormation](https://aws.amazon.com/cloudformation/)\nstacks_ of resources. CloudFormation stacks can also be defined with _[AWS CDK](https://awslabs.github.io/aws-cdk/)_\napplications. All of the above can also be deployed using _[Terraform](https://www.terraform.io)_.\n\n## Installation\n\nRequires Python 3.9 or newer.\n\nUse pipx or uv to install it globally in an isolated environment.\n[pipx](https://github.com/pypa/pipx) is the older and stable tool,\n[uv](https://github.com/astral-sh/uv) is a new, much faster version.\n\n```shell\npipx install nameless-deploy-tools\n# or\nuv tool install nameless-deploy-tools\n```\n\nDirectly installing with pip is no longer supported by most Python distributions.\n\n## Getting started\n\nTo use nameless-deploy-tools you need to set up a _project repository_ that\ndescribes the images you want to build, and the stacks you want to deploy them in.\nSee [ndt-project-template](https://github.com/NitorCreations/ndt-project-template) for an example.\n\nHere are few commands you can use. All of these are run in your project repository root.\nYou need to have AWS credentials for command line access set up.\n\n- To bake a new version of an image: `ndt bake-image <image-name>`\n- To build a new Docker container image `ndt bake-docker <component> <docker-name>`\n- To deploy a stack:\n  - with a known AMI id: `ndt deploy-stack <image-name> <stack-name> <AMI-id>`\n  - with the newest AMI id by a given bake job: `ndt deploy-stack <image-name> <stack-name> \"\" <bake-job-name>`\n- To undeploy a stack: `ndt undeploy-stack <image-name> <stack-name>`\n\nFor full list of commands see [here](docs/commands.md)\n\n### Faster shell complete\n\nYou can additionally use a faster register-complete by running `./faster_register_complete.sh`.\nThis compiles C++ programs from the files\n[n_utils/nameless-dt-register-complete.cpp](n_utils/nameless-dt-register-complete.cpp)\nand [n_utils/nameless-dt-print-aws-profiles.cpp](n_utils/nameless-dt-print-aws-profiles.cpp),\nand replaces the Python versions of `nameless-dt-register-complete`\nand `nameless-dt-print-aws-profiles` with these much faster compiled binaries.\n\n## Documentation\n\n- [Command Reference](docs/commands.md)\n- [ndt workspace tooling](docs/workspace.md)\n- [Template Pre-Processing](docs/template-processing.md)\n- [Multifactor Authentication](docs/mfa.md)\n- [Common parameters](docs/parameters.md)\n\n## Versioning\n\nThis library uses a simplified semantic versioning scheme: major version change for changes\nthat are not backwards compatible (not expecting these) and the minor\nversion for all backwards compatible changes. We won't make the distinction between\nnew functionality and bugfixes, since we don't think it matters and is not a thing\nworth wasting time on. We will release often and if we need changes that are not comptatible,\nwe will fork the next major version and release alphas versions of that until we are\nhappy to release the next major version and try and have a painless upgrade path.\n\n## Development\n\nuv is the recommended way to handle virtual environments for development.\n\nCreate a venv and install all dependencies:\n\n```shell\nuv sync --all-extras\n```\n\nYou can then run commands directly with the venv using `uv run`,\nor activate the venv manually first.\nThe uv default venv location is `.venv`.\n\n```shell\nsource .venv/bin/activate\n# or Windows\n.venv\\Scripts\\activate\n```\n\n## Dependencies\n\nPython dependencies are specified in [pyproject.toml](./pyproject.toml).\nThe `requirements.txt` file is generated by pip compile and should not be modified manually.\n\nUse the provided shell script to update the requirements file.\nFirst install [uv](https://github.com/astral-sh/uv) (recommended),\nor alternatively `pip-tools` using [pipx](https://github.com/pypa/pipx).\nThen run:\n\n```shell\n./compile-requirements.sh\n# See help\n./compile-requirements.sh -h\n```\n\n## Running tests\n\n### Using uv\n\n```shell\nuv run python -m pytest -v .\n```\n\n## Inside active virtual env\n\nInstall test requirements:\n\n```shell\npip install -r dev-requirements.txt\n```\n\nRun tests with Pytest:\n\n```shell\npython -m pytest -v .\n```\n\n## Code formatting and linting\n\nCode formatting and linting with [ruff](https://github.com/charliermarsh/ruff).\n\nThese are configured with a custom line length limit of 120.\nThe configs can be found in [pyproject.toml](./pyproject.toml).\n\nUsage:\n\n```shell\nruff format\nruff check --fix\n```\n\nUsing with [pre-commit](https://pre-commit.com/):\n\n```shell\n# setup to be run automatically on git commit\npre-commit install\n\n# run manually\npre-commit run --all-files\n```\n\n## Release\n\nUse the provided shell script.\nNote that you need to have a venv with the extra dependencies installed active when running the script.\n\n```shell\n./release.sh\n# See help\n./release.sh -h\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Tools for deploying to AWS via CloudFormation and Serverless framework that support a pull request based workflow",
    "version": "1.328",
    "project_urls": {
        "Download": "https://github.com/NitorCreations/nameless-deploy-tools/tarball/1.328",
        "Homepage": "https://github.com/NitorCreations/nameless-deploy-tools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81b3ce30de9777020c28b6d4583b8fc4b99b08e6e6f4e9d0e2f5555634398eed",
                "md5": "4d15134d85e51c9403a9acee19d1d4e3",
                "sha256": "062f2dfacfe965ff76e552a886a4c92119051a21fb5a2cb5302286bf8f932538"
            },
            "downloads": -1,
            "filename": "nameless_deploy_tools-1.328-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d15134d85e51c9403a9acee19d1d4e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 248298,
            "upload_time": "2024-12-11T14:54:33",
            "upload_time_iso_8601": "2024-12-11T14:54:33.410238Z",
            "url": "https://files.pythonhosted.org/packages/81/b3/ce30de9777020c28b6d4583b8fc4b99b08e6e6f4e9d0e2f5555634398eed/nameless_deploy_tools-1.328-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7268ddfab4e741277679654b138c8182988bd2b14c5d55f24bfd3064ab6cafa",
                "md5": "a5bc43e400002f5e50d1bd38d6771064",
                "sha256": "532e948185b640c55e786a72bec4e3e738bd2fa118e767972d72012a2f313c7f"
            },
            "downloads": -1,
            "filename": "nameless_deploy_tools-1.328.tar.gz",
            "has_sig": false,
            "md5_digest": "a5bc43e400002f5e50d1bd38d6771064",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 182042,
            "upload_time": "2024-12-11T14:54:36",
            "upload_time_iso_8601": "2024-12-11T14:54:36.153719Z",
            "url": "https://files.pythonhosted.org/packages/f7/26/8ddfab4e741277679654b138c8182988bd2b14c5d55f24bfd3064ab6cafa/nameless_deploy_tools-1.328.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-11 14:54:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NitorCreations",
    "github_project": "nameless-deploy-tools",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "argcomplete",
            "specs": [
                [
                    "==",
                    "3.5.1"
                ]
            ]
        },
        {
            "name": "boto3",
            "specs": [
                [
                    "==",
                    "1.35.62"
                ]
            ]
        },
        {
            "name": "botocore",
            "specs": [
                [
                    "==",
                    "1.35.62"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2024.8.30"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.17.1"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "cloudformation-utils",
            "specs": [
                [
                    "==",
                    "0.0.2"
                ]
            ]
        },
        {
            "name": "configparser",
            "specs": [
                [
                    "==",
                    "7.1.0"
                ]
            ]
        },
        {
            "name": "cryptography",
            "specs": [
                [
                    "==",
                    "43.0.3"
                ]
            ]
        },
        {
            "name": "decorator",
            "specs": [
                [
                    "==",
                    "5.1.1"
                ]
            ]
        },
        {
            "name": "ec2-utils",
            "specs": [
                [
                    "==",
                    "0.38"
                ]
            ]
        },
        {
            "name": "future",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.10"
                ]
            ]
        },
        {
            "name": "ipaddr",
            "specs": [
                [
                    "==",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "jmespath",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "netifaces",
            "specs": [
                [
                    "==",
                    "0.11.0"
                ]
            ]
        },
        {
            "name": "nitor-vault",
            "specs": [
                [
                    "==",
                    "2.4.0"
                ]
            ]
        },
        {
            "name": "py",
            "specs": [
                [
                    "==",
                    "1.11.0"
                ]
            ]
        },
        {
            "name": "pyaml",
            "specs": [
                [
                    "==",
                    "24.9.0"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.22"
                ]
            ]
        },
        {
            "name": "pycryptodomex",
            "specs": [
                [
                    "==",
                    "3.21.0"
                ]
            ]
        },
        {
            "name": "pygments",
            "specs": [
                [
                    "==",
                    "2.18.0"
                ]
            ]
        },
        {
            "name": "pyopenssl",
            "specs": [
                [
                    "==",
                    "24.2.1"
                ]
            ]
        },
        {
            "name": "pyotp",
            "specs": [
                [
                    "==",
                    "2.9.0"
                ]
            ]
        },
        {
            "name": "pyqrcode",
            "specs": [
                [
                    "==",
                    "1.2.1"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "retry",
            "specs": [
                [
                    "==",
                    "0.9.2"
                ]
            ]
        },
        {
            "name": "s3transfer",
            "specs": [
                [
                    "==",
                    "0.10.3"
                ]
            ]
        },
        {
            "name": "scandir",
            "specs": [
                [
                    "==",
                    "1.10.0"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "termcolor",
            "specs": [
                [
                    "==",
                    "2.5.0"
                ]
            ]
        },
        {
            "name": "threadlocal-aws",
            "specs": [
                [
                    "==",
                    "0.11"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "2.2.3"
                ]
            ]
        }
    ],
    "lcname": "nameless-deploy-tools"
}
        
Elapsed time: 0.50614s