Skip to content

Commit

Permalink
Merge branch 'main' of github.com:20tab/talos into spike/gh-actions-t…
Browse files Browse the repository at this point in the history
…f-checks
  • Loading branch information
trottomv committed Jan 12, 2024
2 parents 1b16121 + 823332e commit 9efebfa
Show file tree
Hide file tree
Showing 20 changed files with 1,403 additions and 1,243 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: 20tab/talos
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: true
target: "base"
tags: ${{ steps.meta.outputs.tags }},20tab/talos-nextjs:latest
tags: ${{ steps.meta.outputs.tags }},20tab/talos:latest
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install -r requirements/test.txt
Expand Down
30 changes: 18 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.11
python: python3.12
exclude: ^(\{\{cookiecutter\.project_dirname\}\}.*)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v4.5.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
Expand All @@ -27,40 +27,46 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
rev: "v3.15.0"
hooks:
- id: pyupgrade
args: [--py311-plus]
args: [--py312-plus]
- repo: https://github.com/psf/black
rev: "23.1.0"
rev: "23.12.1"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
rev: "v3.1.0"
hooks:
- id: prettier
files: ^(?!.*\b(tfvars|tf|yaml|yml)\b)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.246
rev: v0.1.11
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.9.1"
rev: "1.5.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.0.0"
rev: "v1.8.0"
hooks:
- id: mypy
args: ["--no-site-packages"]
- repo: https://github.com/trailofbits/pip-audit
rev: v2.4.14
rev: v2.6.3
hooks:
- id: pip-audit
args: ["--require-hashes", "--requirement", "requirements/local.txt"]
args:
[
"--require-hashes",
"--disable-pip",
"--requirement",
"requirements/local.txt",
]
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: "v1.77.0"
rev: "v1.86.0"
hooks:
- id: terraform_fmt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-bullseye AS base
FROM python:3.12-slim-bookworm AS base

ARG DEBIAN_FRONTEND=noninteractive
ARG OUTPUT_BASE_DIR=/data
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pip: pip_update ## Compile requirements

.PHONY: pip_update
pip_update: ## Update requirements and dependencies
python3 -m pip install -q -U pip~=23.0.0 pip-tools~=6.12.0 setuptools~=67.3.0 wheel~=0.38.0
python3 -m pip install --quiet --upgrade pip~=23.3.0 pip-tools~=7.3.0 setuptools~=69.0.0 wheel~=0.42.0

.PHONY: precommit
precommit: ## Fix code formatting, linting and sorting imports
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ cd ~/projects
### 🐋 Docker

```console
docker run --interactive --tty --rm --volume $PWD:/data 20tab/talos:latest
docker run --interactive --tty --rm --volume $PWD/.dumps:/app/.dumps --volume $PWD/.logs:/app/.logs --volume $PWD:/data 20tab/talos:latest
```

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

### 👨‍💻 Shell command

```console
Expand Down Expand Up @@ -215,7 +217,7 @@ The following arguments can be appended to the Docker and shell commands

| Value | Description | Argument |
| ---------------- | ------------------------------------------- | ------------------------------------ |
| digitalocean-k8s | [DigitalOcean](#🌊-digitalocean-kubernates) | `--deployment-type=digitalocean-k8s` |
| digitalocean-k8s | [DigitalOcean](#🌊-digitalocean-kubernetes) | `--deployment-type=digitalocean-k8s` |
| other-k8s | [Other Kubernetes](#☸️-other-kubernetes) | `--deployment-type=other-k8s` |

#### Terraform backend
Expand Down Expand Up @@ -265,7 +267,7 @@ If you don't want DigitalOcean DNS configuration the following args are required
| local | Docker Volume are used to store media | `--media-storage=local` |
| none | Project have no media | `--media-storage=none` |

### 🌊 DigitalOcean Kubernates
### 🌊 DigitalOcean Kubernetes

[DigitalOcean API Slugs](https://slugs.do-api.dev/)
[DigitalOcean Database Slugs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Databases)
Expand Down Expand Up @@ -329,7 +331,7 @@ Disabled args

#### Kubernetes cluster CA certificate

`--kubernetes-cluster-ca-certificate={{absolute-path-to-certificarte}}`
`--kubernetes-cluster-ca-certificate={{absolute-path-to-certificate}}`

#### Kubernetes host

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def set_domain_and_urls(self):
):
self.subdomain_monitoring = slugify(
self.subdomain_monitoring
or click.prompt("Monitorng domain prefix", default="logs")
or click.prompt("Monitoring domain prefix", default="logs")
)

def set_letsencrypt(self):
Expand Down
13 changes: 8 additions & 5 deletions bootstrap/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,20 @@ def register_environment_tfvars(self, *vars, env_slug=None):
def collect_tfvars(self):
"""Collect the base, cluster and environment Terraform variables."""
self.register_environment_tfvars(("registry_server", "registry.gitlab.com"))
backend_service_paths = ["/"]
frontend_service_paths = ["/"]
backend_service_paths = ["/", f"/{self.backend_service_slug}"]
frontend_service_paths = ["/", f"/{self.frontend_service_slug}"]
if self.frontend_service_slug:
self.register_environment_tfvars(
("frontend_service_paths", frontend_service_paths, "list"),
("frontend_service_port", None, "num"),
"frontend_service_slug",
)
backend_service_paths = ["/admin", "/api", "/static"] + (
["/media"] if self.media_storage == "local" else []
)
backend_service_paths = [
"/admin",
"/api",
"/static",
f"/{self.backend_service_slug}",
] + (["/media"] if self.media_storage == "local" else [])
if self.backend_service_slug:
self.register_environment_tfvars(
("backend_service_paths", backend_service_paths, "list"),
Expand Down
20 changes: 16 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
target-version = ["py311"]
target-version = ["py312"]

[tool.coverage.html]
title = "Talos - Coverage"
Expand All @@ -18,8 +18,11 @@ omit = [
source = ["."]

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

[tool.ruff]
extend-exclude = [
Expand All @@ -46,8 +49,17 @@ python_version = "3.11"
"D417",
"E501",
]
select = ["B", "C", "D", "E", "F", "I", "W", "B9"]
target-version = "py311"
select = [
"B",
"C",
"D",
"E",
"F",
"I",
"W",
"B9"
]
target-version = "py312"

[tool.ruff.isort]
combine-as-imports = true
Expand Down
2 changes: 1 addition & 1 deletion requirements/common.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
click~=8.1.0
cookiecutter~=2.1.0
cookiecutter~=2.5.0
pydantic~=1.10.0
python-slugify~=8.0.0
validators~=0.20.0
Loading

0 comments on commit 9efebfa

Please sign in to comment.