Skip to content

Commit

Permalink
Merge branch 'main' into renovate/jsonschema-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente authored Nov 28, 2024
2 parents ecb8770 + a64e5ed commit 34984ee
Show file tree
Hide file tree
Showing 71 changed files with 372 additions and 128 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ Applicable spec: <link>
- [ ] The documentation is generated using `src-docs`
- [ ] The documentation for charmhub is updated
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`)
- [ ] The [changelog](../CHANGELOG.md) has been updated

<!-- Explanation for any unchecked items above -->
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/paas-app-charmer
url: https://pypi.org/p/paas-charm
permissions:
id-token: write
if: github.event_name == 'workflow_dispatch'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PaaS App Charmer
# PaaS Charm

Easily deploy and operate your Flask or Django applications and associated
infrastructure, such as databases and ingress, using open source tooling. This
Expand All @@ -8,7 +8,7 @@ developed by Canonical, the creators of Ubuntu.

Have you ever created an application and then wanted to deploy it for your users
only to either be forced to use a proprietary public cloud platform or manage
the deployment and operations yourself? PaaS App Charmer will take your
the deployment and operations yourself? PaaS Charm will take your
application and create an OCI image using Rockcraft and operations code using
Charmcraft for you. The full suite of tools is open source so you can see
exactly how it works and even contribute! After creating the app charm and
Expand Down Expand Up @@ -64,7 +64,7 @@ Additional resources:

## Contributing

Is there something missing from the PaaS App Charmer framework? PaaS App Charmer
Is there something missing from the PaaS Charm framework? PaaS Charm
welcomes contributions! This section covers how to add a new integration and a
new framework.

Expand All @@ -77,13 +77,13 @@ through below.
[charm topic on discourse](https://discourse.charmhub.io/c/charm/41). This
should cover things like:
* The integration you intend add
* For each of the frameworks that PaaS App Charmer supports:
* For each of the frameworks that PaaS Charm supports:
- The commonly used package(s) to make use of the integration
- The environment variables, configuration etc. that would be made available
to the app
- An example for how to use the integration within an app
* The proposed implementation in `paas-app-charmer`. Take a look at
[`charm.py`](paas_app_charmer/_gunicorn/charm.py) for `gunicorn` based
* The proposed implementation in `paas-app`. Take a look at
[`charm.py`](paas_charm/_gunicorn/charm.py) for `gunicorn` based
frameworks for integration examples.
1. Update the
[reference](https://juju.is/docs/sdk/charmcraft-extension-flask-framework)
Expand Down Expand Up @@ -113,7 +113,7 @@ below.
* How the configuration options of the charm map to environment variables,
configurations or another method of passing the information to the app
* The requirements and conventions for how users need to configure their app
to work with PaaS App Charmer
to work with PaaS Charm
* Which web server to use
1. Raise a pull request to [rockcraft](https://github.com/canonical/rockcraft)
adding a new extension and profile for the framework. This is the flask
Expand All @@ -124,7 +124,7 @@ below.
framework.
1. Raise a pull request to this repository adding a new parent class that can be
used by the app charms. The following is the
[example for flask](./paas_app_charmer/flask/charm.py).
[example for flask](./paas_charm/flask/charm.py).
1. Raise a pull request to
[charmcraft](https://github.com/canonical/charmcraft) adding a new extension
and profile for the framework. This is the flask
Expand Down
4 changes: 2 additions & 2 deletions examples/django/charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

import ops

import paas_app_charmer.django
import paas_charm.django

logger = logging.getLogger(__name__)


class DjangoCharm(paas_app_charmer.django.Charm):
class DjangoCharm(paas_charm.django.Charm):
"""Django Charm service."""

def __init__(self, *args: typing.Any) -> None:
Expand Down
4 changes: 2 additions & 2 deletions examples/fastapi/charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import ops

import paas_app_charmer.fastapi
import paas_charm.fastapi


class FastAPICharm(paas_app_charmer.fastapi.Charm):
class FastAPICharm(paas_charm.fastapi.Charm):
"""FastAPI Charm service."""

def __init__(self, *args: typing.Any) -> None:
Expand Down
4 changes: 2 additions & 2 deletions examples/flask/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import ops

import paas_app_charmer.flask
import paas_charm.flask

logger = logging.getLogger(__name__)


class FlaskCharm(paas_app_charmer.flask.Charm):
class FlaskCharm(paas_charm.flask.Charm):
"""Flask Charm service."""

def __init__(self, *args: typing.Any) -> None:
Expand Down
4 changes: 2 additions & 2 deletions examples/go/charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import ops

import paas_app_charmer.go
import paas_charm.go


class GoCharm(paas_app_charmer.go.Charm):
class GoCharm(paas_charm.go.Charm):
"""Go Charm service."""

def __init__(self, *args: typing.Any) -> None:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
[project]
name = "paas-app-charmer"
version = "1.3.1"
description = "Companion library for PaaS app charmer."
name = "paas-charm"
version = "1.0.0"
description = "Companion library for 12-factor app support in Charmcraft & Rockcraft."
readme = "README.md"
authors = [
{name = "Canonical IS DevOps team", email="[email protected]"},
Expand All @@ -20,13 +20,13 @@ classifiers = [


[project.urls]
Repository = "https://github.com/canonical/paas-app-charmer"
Repository = "https://github.com/canonical/paas-charm"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.package-data]
paas_app_charmer = ["**/cos/**", "**/cos/**/.**"]
paas_charm = ["**/cos/**", "**/cos/**/.**"]

# Testing tools configuration
[tool.coverage.run]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cosl
jsonschema >=4.23,<4.24

Check warning on line 2 in requirements.txt

View workflow job for this annotation

GitHub Actions / unit-tests / Style checker

[vale] reported by reviewdog 🐶 [Canonical.012-Date-format] Use the '1 January 1970' format instead of '23,<4.24' Raw Output: {"message": "[Canonical.012-Date-format] Use the '1 January 1970' format instead of '23,\u003c4.24'", "location": {"path": "requirements.txt", "range": {"start": {"line": 2, "column": 16}}}, "severity": "WARNING"}
ops >= 2.6
pydantic==2.6.4
pydantic==2.10.2
13 changes: 13 additions & 0 deletions src/paas_app_charmer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated entrypoints for charms.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

import warnings

warnings.warn("paas_app_charmer package is deprecated", DeprecationWarning, stacklevel=2)
13 changes: 13 additions & 0 deletions src/paas_app_charmer/django/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Django module entrypoint.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

from .charm import Charm

__all__ = ["Charm"]
15 changes: 15 additions & 0 deletions src/paas_app_charmer/django/charm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Django Charm service.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

import paas_charm.django.charm


class Charm(paas_charm.django.charm.Charm):
"""Deprecated Django charm."""
13 changes: 13 additions & 0 deletions src/paas_app_charmer/fastapi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated FastAPI module entrypoint.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

from .charm import Charm

__all__ = ["Charm"]
16 changes: 16 additions & 0 deletions src/paas_app_charmer/fastapi/charm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.


"""Deprecated FastAPI Charm service.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

import paas_charm.fastapi.charm


class Charm(paas_charm.fastapi.charm.Charm):
"""Deprecated FastAPI charm."""
13 changes: 13 additions & 0 deletions src/paas_app_charmer/flask/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Flask module entrypoint.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

from .charm import Charm

__all__ = ["Charm"]
15 changes: 15 additions & 0 deletions src/paas_app_charmer/flask/charm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Flask Charm service.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

import paas_charm.flask.charm


class Charm(paas_charm.flask.charm.Charm):
"""Deprecated Flask charm."""
13 changes: 13 additions & 0 deletions src/paas_app_charmer/go/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Go module entrypoint.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""

from .charm import Charm

__all__ = ["Charm"]
16 changes: 16 additions & 0 deletions src/paas_app_charmer/go/charm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

"""Deprecated Go Charm service.
This module can be removed when paas_charm>=2.0.
It has to be maintained for the life cycle of bases 22.04 and 24.04.
"""


import paas_charm.go.charm


class Charm(paas_charm.go.charm.Charm):
"""Deprecated Go charm."""
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""Module __init__."""

from paas_app_charmer import exceptions
from paas_charm import exceptions

# Try the charm library imports to check whether they are present
try:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"""The base charm class for all charms."""
import logging

from paas_app_charmer._gunicorn.webserver import GunicornWebserver, WebserverConfig
from paas_app_charmer._gunicorn.workload_config import create_workload_config
from paas_app_charmer._gunicorn.wsgi_app import WsgiApp
from paas_app_charmer.app import App, WorkloadConfig
from paas_app_charmer.charm import PaasCharm
from paas_charm._gunicorn.webserver import GunicornWebserver, WebserverConfig
from paas_charm._gunicorn.workload_config import create_workload_config
from paas_charm._gunicorn.wsgi_app import WsgiApp
from paas_charm.app import App, WorkloadConfig
from paas_charm.charm import PaasCharm

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import ops
from ops.pebble import ExecError, PathError

from paas_app_charmer._gunicorn.workload_config import (
from paas_charm._gunicorn.workload_config import (
APPLICATION_ERROR_LOG_FILE_FMT,
APPLICATION_LOG_FILE_FMT,
STATSD_HOST,
)
from paas_app_charmer.app import WorkloadConfig
from paas_app_charmer.exceptions import CharmConfigInvalidError
from paas_app_charmer.utils import enable_pebble_log_forwarding
from paas_charm.app import WorkloadConfig
from paas_charm.exceptions import CharmConfigInvalidError
from paas_charm.utils import enable_pebble_log_forwarding

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pathlib

from paas_app_charmer.app import WorkloadConfig
from paas_charm.app import WorkloadConfig

STATSD_HOST = "localhost:9125"
APPLICATION_LOG_FILE_FMT = "/var/log/{framework}/access.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import ops

from paas_app_charmer._gunicorn.webserver import GunicornWebserver
from paas_app_charmer.app import App, WorkloadConfig
from paas_app_charmer.charm_state import CharmState
from paas_app_charmer.database_migration import DatabaseMigration
from paas_charm._gunicorn.webserver import GunicornWebserver
from paas_charm.app import App, WorkloadConfig
from paas_charm.charm_state import CharmState
from paas_charm.database_migration import DatabaseMigration

logger = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit 34984ee

Please sign in to comment.