Skip to content
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

Update README #261

Merged
merged 11 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements/test.txt
- name: Run Test
run: |
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg \
libpq-dev \
software-properties-common \
&& curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - \
&& apt-add-repository "deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
&& apt-get update && apt-get install -y --no-install-recommends terraform \
&& curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \
&& gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint \
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list \
&& apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
terraform \
&& python3 -m pip install --no-cache-dir --upgrade pip setuptools \
&& python3 -m pip install --no-cache-dir -r requirements/common.txt
trottomv marked this conversation as resolved.
Show resolved Hide resolved
COPY . .
RUN mkdir ${OUTPUT_BASE_DIR}
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ outdated: ## Check outdated requirements and dependencies

.PHONY: pip
pip: pip_update ## Compile requirements
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/common.txt requirements/common.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/local.txt requirements/local.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/test.txt requirements/test.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/common.txt requirements/common.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/local.txt requirements/local.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/test.txt requirements/test.in

.PHONY: pip_update
pip_update: ## Update requirements and dependencies
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,34 @@

## 🧩 Requirements

The Talos script can be run either using Docker or as a local shell command.
The Talos script can be run either using Docker or a Python virtual environment.

### 🐋 Docker

In order to run Talos via Docker, a working [Docker installation](https://docs.docker.com/get-docker/) is the only requirement.

### 👨‍💻 Shell command
### 🐍 Virtual environment

In order to run Talos as a shell command, first clone the repository in a local projects directory
trottomv marked this conversation as resolved.
Show resolved Hide resolved

```console
cd ~/projects
git clone [email protected]:20tab/talos.git
cd talos
```

Then, install the following requirements:
Then, create and activate a virtual environment and install the requirements:

| Requirements | Instructions |
| ---------------------- | ---------------------------------------------------------------------------- |
| 🌎 Terraform | [Install Guide](https://learn.hashicorp.com/tutorials/terraform/install-cli) |
| 🐍 Python Dependencies | `pip install -r talos/requirements/common.txt` |
```console
python3.12 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip setuptools
python3 -m pip install -r requirements/common.txt
```

The `terraform` cli package is required, unless you want to generate a project only locally. To install it we suggest to use the official [install guide](https://learn.hashicorp.com/tutorials/terraform/install-cli).

## 🔑 Credentials
## 🔑 Credentials (optional)

### 🌊 DigitalOcean

Expand Down Expand Up @@ -57,7 +62,7 @@ If the Terraform Cloud integration is enabled, a User API token is required.<br/

## 🚀️ Quickstart

Change to the projects directory, for example
Change to the projects directory, for example:

```console
cd ~/projects
Expand All @@ -71,9 +76,10 @@ docker run --interactive --tty --rm --volume $PWD/.dumps:/app/.dumps --volume $P

**Note:** On a non-AMD64 architecture, `--platform linux/amd64` can be passed to force emulation.

### 👨‍💻 Shell command
### 🐍 Virtual environment

```console
source talos/.venv/bin/activate
./talos/start.py
```

Expand Down
46 changes: 23 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
[tool.black]
target-version = ["py312"]

[tool.coverage.html]
title = "Talos - Coverage"
show_contexts = true

[tool.coverage.report]
show_missing = true

[tool.coverage.run]
branch = true
dynamic_context = "test_function"
omit = [
".venv/*",
"venv/*",
]
source = ["."]

[tool.mypy]
enable_error_code = [
"truthy-bool",
]
ignore_missing_imports = true
python_version = "3.12"

[tool.ruff]
extend-exclude = [
"__pycache__",
Expand Down Expand Up @@ -66,3 +43,26 @@ combine-as-imports = true
known-first-party = [
"bootstrap",
]

[tool.coverage.html]
title = "Talos - Coverage"
show_contexts = true

[tool.coverage.report]
show_missing = true

[tool.coverage.run]
branch = true
dynamic_context = "test_function"
omit = [
".venv/*",
"venv/*",
]
source = ["."]

[tool.mypy]
enable_error_code = [
"truthy-bool",
]
ignore_missing_imports = true
python_version = "3.12"
2 changes: 2 additions & 0 deletions requirements/common.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
click~=8.1.0
cookiecutter~=2.5.0
pip-tools~=7.3.0
pydantic~=1.10.0
python-slugify~=8.0.0
ruff~=0.1.0
validators~=0.20.0
52 changes: 49 additions & 3 deletions requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ binaryornot==0.4.4 \
--hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
--hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
# via cookiecutter
build==1.0.3 \
--hash=sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b \
--hash=sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f
# via pip-tools
certifi==2023.11.17 \
--hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \
--hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474
Expand Down Expand Up @@ -112,6 +116,7 @@ click==8.1.7 \
# via
# -r requirements/common.in
# cookiecutter
# pip-tools
cookiecutter==2.5.0 \
--hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \
--hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec
Expand All @@ -124,9 +129,9 @@ idna==3.6 \
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
# via requests
jinja2==3.1.2 \
--hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \
--hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
jinja2==3.1.3 \
--hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \
--hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90
# via cookiecutter
markdown-it-py==3.0.0 \
--hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \
Expand Down Expand Up @@ -198,6 +203,14 @@ mdurl==0.1.2 \
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
# via markdown-it-py
packaging==23.2 \
--hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \
--hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7
# via build
pip-tools==7.3.0 \
--hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \
--hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d
# via -r requirements/common.in
pydantic==1.10.13 \
--hash=sha256:1740068fd8e2ef6eb27a20e5651df000978edce6da6803c2bef0bc74540f9548 \
--hash=sha256:210ce042e8f6f7c01168b2d84d4c9eb2b009fe7bf572c2266e235edf14bacd80 \
Expand Down Expand Up @@ -240,6 +253,10 @@ pygments==2.17.2 \
--hash=sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c \
--hash=sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367
# via rich
pyproject-hooks==1.0.0 \
--hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \
--hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5
# via build
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
Expand Down Expand Up @@ -310,6 +327,25 @@ rich==13.7.0 \
--hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \
--hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235
# via cookiecutter
ruff==0.1.12 \
--hash=sha256:1c49e826de55d81a6ef93808b760925e492bad7cc470aaa114a3be158b2c7f99 \
--hash=sha256:25be18abc1fc3f3d3fb55855c41ed5d52063316defde202f413493bb3888218c \
--hash=sha256:46685ef2f106b827705df876d38617741ed4f858bbdbc0817f94476c45ab6669 \
--hash=sha256:472a0548738d4711549c7874b43fab61aacafb1fede29c5232d4cfb8e2d13f69 \
--hash=sha256:47f6d939461e3273f10f4cd059fd0b83c249d73f1736032fffbac83a62939395 \
--hash=sha256:4bdf26e5a2efab4c3aaf6b61648ea47a525dc12775810a85c285dc9ca03e5ac0 \
--hash=sha256:544038693543c11edc56bb94a9875df2dc249e3616f90c15964c720dcccf0745 \
--hash=sha256:718523c3a0b787590511f212d30cc9b194228ef369c8bdd72acd1282cc27c468 \
--hash=sha256:7fe06ba77e5b7b78db1d058478c47176810f69bb5be7c1b0d06876af59198203 \
--hash=sha256:8a0e3ef6299c4eab75a7740730e4b4bd4a36e0bd8102ded01553403cad088fd4 \
--hash=sha256:97189f38c655e573f6bea0d12e9f18aad5539fd08ab50651449450999f45383a \
--hash=sha256:b631c6a95e4b6d5c4299e599067b5a89f5b18e2f2d9a6c22b879b3c4b077c96e \
--hash=sha256:bb29f8e3e6c95024902eaec5a9ce1fd5ac4e77f4594f4554e67fbb0f6d9a2f37 \
--hash=sha256:cf6073749c70b616d7929897b14824ec6713a6c3a8195dfd2ffdcc66594d880c \
--hash=sha256:d41e9f100b50526d80b076fc9c103c729387ff3f10f63606ed1038c30a372a40 \
--hash=sha256:f193f460e231e63af5fc7516897cf5ab257cbda72ae83cf9a654f1c80c3b758a \
--hash=sha256:fbb1c002eeacb60161e51d77b2274c968656599477a1c8c65066953276e8ee2b
# via -r requirements/common.in
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
Expand All @@ -333,3 +369,13 @@ urllib3==2.1.0 \
validators==0.20.0 \
--hash=sha256:24148ce4e64100a2d5e267233e23e7afeb55316b47d30faae7eb6e7292bc226a
# via -r requirements/common.in
wheel==0.42.0 \
--hash=sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d \
--hash=sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8
# via pip-tools

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# pip
# setuptools
1 change: 0 additions & 1 deletion requirements/local.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r test.in
black~=23.12.0
ipython~=8.20.0
pip-tools~=7.3.0
pre-commit~=3.6.0
types-python-slugify~=8.0.0
48 changes: 24 additions & 24 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ cookiecutter==2.5.0 \
--hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \
--hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec
# via -r requirements/common.in
coverage[toml]==7.4.0 \
coverage==7.4.0 \
--hash=sha256:04387a4a6ecb330c1878907ce0dc04078ea72a869263e53c72a1ba5bbdf380ca \
--hash=sha256:0676cd0ba581e514b7f726495ea75aba3eb20899d824636c6f59b0ed2f88c471 \
--hash=sha256:0e8d06778e8fbffccfe96331a3946237f87b1e1d359d7fbe8b06b96c95a5407a \
Expand Down Expand Up @@ -244,9 +244,9 @@ jedi==0.19.1 \
--hash=sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd \
--hash=sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0
# via ipython
jinja2==3.1.2 \
--hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \
--hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
jinja2==3.1.3 \
--hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \
--hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90
# via cookiecutter
markdown-it-py==3.0.0 \
--hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \
Expand Down Expand Up @@ -382,7 +382,7 @@ pexpect==4.9.0 \
pip-tools==7.3.0 \
--hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \
--hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d
# via -r requirements/local.in
# via -r requirements/common.in
platformdirs==4.1.0 \
--hash=sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380 \
--hash=sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420
Expand Down Expand Up @@ -527,25 +527,25 @@ rich==13.7.0 \
--hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \
--hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235
# via cookiecutter
ruff==0.1.11 \
--hash=sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b \
--hash=sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45 \
--hash=sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740 \
--hash=sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77 \
--hash=sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f \
--hash=sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1 \
--hash=sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95 \
--hash=sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955 \
--hash=sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9 \
--hash=sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c \
--hash=sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607 \
--hash=sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196 \
--hash=sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18 \
--hash=sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d \
--hash=sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9 \
--hash=sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a \
--hash=sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb
# via -r requirements/test.in
ruff==0.1.12 \
--hash=sha256:1c49e826de55d81a6ef93808b760925e492bad7cc470aaa114a3be158b2c7f99 \
--hash=sha256:25be18abc1fc3f3d3fb55855c41ed5d52063316defde202f413493bb3888218c \
--hash=sha256:46685ef2f106b827705df876d38617741ed4f858bbdbc0817f94476c45ab6669 \
--hash=sha256:472a0548738d4711549c7874b43fab61aacafb1fede29c5232d4cfb8e2d13f69 \
--hash=sha256:47f6d939461e3273f10f4cd059fd0b83c249d73f1736032fffbac83a62939395 \
--hash=sha256:4bdf26e5a2efab4c3aaf6b61648ea47a525dc12775810a85c285dc9ca03e5ac0 \
--hash=sha256:544038693543c11edc56bb94a9875df2dc249e3616f90c15964c720dcccf0745 \
--hash=sha256:718523c3a0b787590511f212d30cc9b194228ef369c8bdd72acd1282cc27c468 \
--hash=sha256:7fe06ba77e5b7b78db1d058478c47176810f69bb5be7c1b0d06876af59198203 \
--hash=sha256:8a0e3ef6299c4eab75a7740730e4b4bd4a36e0bd8102ded01553403cad088fd4 \
--hash=sha256:97189f38c655e573f6bea0d12e9f18aad5539fd08ab50651449450999f45383a \
--hash=sha256:b631c6a95e4b6d5c4299e599067b5a89f5b18e2f2d9a6c22b879b3c4b077c96e \
--hash=sha256:bb29f8e3e6c95024902eaec5a9ce1fd5ac4e77f4594f4554e67fbb0f6d9a2f37 \
--hash=sha256:cf6073749c70b616d7929897b14824ec6713a6c3a8195dfd2ffdcc66594d880c \
--hash=sha256:d41e9f100b50526d80b076fc9c103c729387ff3f10f63606ed1038c30a372a40 \
--hash=sha256:f193f460e231e63af5fc7516897cf5ab257cbda72ae83cf9a654f1c80c3b758a \
--hash=sha256:fbb1c002eeacb60161e51d77b2274c968656599477a1c8c65066953276e8ee2b
# via -r requirements/common.in
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
Expand Down
1 change: 0 additions & 1 deletion requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-r common.in
coverage[toml]~=7.4.0
mypy~=1.8.0
ruff~=0.1.0
time-machine~=2.13.0
Loading