-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Drop remaining references to Docker and containers #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,11 +7,9 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Leverage CLI is the tool used to manage and interact with any Leverage project. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| It transparently handles the most complex and error prone tasks that arise from working with a state-of-the-art | ||||||||||||||||||||||||||
| infrastructure definition like our Leverage Reference Architecture. Leverage CLI uses a dockerized approach to | ||||||||||||||||||||||||||
| encapsulate the tools needed to perform such tasks and to free the user from having to deal with the configuration and | ||||||||||||||||||||||||||
| management of said tools. | ||||||||||||||||||||||||||
| Provides the means to interact with your Leverage project and allows you to define custom tasks to run. | ||||||||||||||||||||||||||
| It transparently handles the most complex and error-prone tasks that arise from working with a state-of-the-art infrastructure definition like our Leverage Reference Architecture. It understands the structure of the Leverage Reference Architecture and assists the user in their day-to-day operation. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Leverage CLI orchestrates a set of tools used to operate in a Leverage project. Usually this means OpenTofu/Terraform, but also aws-cli, kubectl and more. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Reviewing and implementing the [Binbash Leverage Landing Zone for AWS](https://leverage.binbash.co/try-leverage/) would | ||||||||||||||||||||||||||
| be a very good place to start! | ||||||||||||||||||||||||||
|
|
@@ -23,10 +21,13 @@ to [this page](https://leverage.binbash.co/user-guide/leverage-cli/installation/ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### Note for migration from previous versions | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| If you come from Leverage CLI version <1.8.0 and want to install Leverage CLI version >= 1.8.0 keep into account the | ||||||||||||||||||||||||||
| If you come from Leverage CLI version <3.0.0 and want to use Leverage CLI version >= 3.0.0 keep into account the | ||||||||||||||||||||||||||
| following. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The `build.env` file format has changed. As an example, this is the old format: | ||||||||||||||||||||||||||
| Leverage CLI no longer runs tools inside a Docker container; it executes the OpenTofu/Terraform binaries installed on | ||||||||||||||||||||||||||
| your host. Because of this, the `TERRAFORM_IMAGE_NAME`/`TF_IMAGE_NAME` and `TERRAFORM_IMAGE_TAG`/`TF_IMAGE_TAG` | ||||||||||||||||||||||||||
| parameters in the `build.env` file no longer exist. In their place, the optional `TF_BINARY` parameter specifies the path | ||||||||||||||||||||||||||
| to the OpenTofu/Terraform binary to use. As an example, this is the old format: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
| # Project settings | ||||||||||||||||||||||||||
|
|
@@ -36,8 +37,7 @@ PROJECT=bb | |||||||||||||||||||||||||
| MFA_ENABLED=false | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Terraform | ||||||||||||||||||||||||||
| TERRAFORM_IMAGE_NAME=binbash/terraform-awscli-slim | ||||||||||||||||||||||||||
| TERRAFORM_IMAGE_TAG=1.1.9 | ||||||||||||||||||||||||||
| TF_IMAGE_TAG=1.5.0-0.2.0 | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| New version example: | ||||||||||||||||||||||||||
|
|
@@ -49,16 +49,19 @@ PROJECT=bb | |||||||||||||||||||||||||
| # General | ||||||||||||||||||||||||||
| MFA_ENABLED=false | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Terraform | ||||||||||||||||||||||||||
| TF_IMAGE_TAG=1.5.0-0.2.0 | ||||||||||||||||||||||||||
| # OpenTofu/Terraform binary | ||||||||||||||||||||||||||
| TF_BINARY=/usr/local/bin/tofu | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| So, if you have created a project with version <1.8.0 and want to use it with version >=1.8.0 you should: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - remove TERRAFORM_IMAGE_NAME line | ||||||||||||||||||||||||||
| - update TF_IMAGE_TAG from this form '9.9.9' to this one '9.9.9-9.9.9'. | ||||||||||||||||||||||||||
| So, if you have created a project with version <3.0.0 and want to use it with version >=3.0.0 you should: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| For the second item you can check the version [here](https://hub.docker.com/r/binbash/leverage-toolbox/tags). | ||||||||||||||||||||||||||
| - remove the `TERRAFORM_IMAGE_NAME`/`TF_IMAGE_NAME` and `TERRAFORM_IMAGE_TAG`/`TF_IMAGE_TAG` lines | ||||||||||||||||||||||||||
| - install [OpenTofu](https://opentofu.org/docs/intro/install/) or [Terraform](https://developer.hashicorp.com/terraform/install) | ||||||||||||||||||||||||||
| on your host | ||||||||||||||||||||||||||
|
Comment on lines
+56
to
+60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Preserve the previously used tool release during migration. The migration removes the image tag and selects whichever Suggested fix - install [OpenTofu](https://opentofu.org/docs/intro/install/) or [Terraform](https://developer.hashicorp.com/terraform/install)
on your host
+- use the same OpenTofu or Terraform release that the project used before migration📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| - optionally, set `TF_BINARY` to the path of the binary. This is useful when you have multiple versions of | ||||||||||||||||||||||||||
| OpenTofu/Terraform installed, or when the binary lives in an unconventional location. It can be an absolute path, a path starting with `~`, or a path | ||||||||||||||||||||||||||
| relative to the project root. If not set, the `tofu` or `terraform` binary is looked up in your `PATH`. Keep in mind | ||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 5 'tf_binary|TF_BINARY' leverageRepository: binbashar/leverage Length of output: 4885 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- TFRunner definitions and uses ---'
rg -n -C 8 'class TFRunner|def __init__|binary=|working_dir|subprocess|shutil\.which|run\(' leverage --glob '*.py'
printf '%s\n' '--- README context ---'
cat -n README.md | sed -n '52,68p'Repository: binbashar/leverage Length of output: 41889 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- leverage/modules/runner.py ---'
cat -n leverage/modules/runner.py | sed -n '10,52p'
printf '%s\n' '--- leverage/modules/tfrunner.py ---'
cat -n leverage/modules/tfrunner.py | sed -n '17,50p'
printf '%s\n' '--- leverage/path.py ---'
cat -n leverage/path.py | sed -n '174,183p'Repository: binbashar/leverage Length of output: 4470 Resolve one-component
🐛 Suggested fix- elif not binary_path.is_absolute() and len(binary_path.parts) > 1:
+ elif tf_binary and not binary_path.is_absolute():
self.tf_binary = str((self.root_dir / tf_binary).resolve())🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| the binary must match the command you use: `leverage tofu` expects OpenTofu and `leverage terraform` expects Terraform. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## System requirements | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Restore the custom-task mention in the README introduction.
The current introduction no longer tells users that they can define tasks in
build.pyand run them withleverage run. This can prevent README readers from discovering a supported workflow.Suggested fix
Leverage CLI orchestrates a set of tools used to operate in a Leverage project. Usually this means OpenTofu/Terraform, but also aws-cli, kubectl and more. +You can define custom tasks in `build.py` and run them with `leverage run`.📝 Committable suggestion
🤖 Prompt for AI Agents