Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions charmcraft/extensions/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ def get_container_name(self) -> str:
"""Return name of the container for the app image."""
return "app"

@staticmethod
@override
def is_experimental(base: tuple[str, ...] | None) -> bool: # noqa: ARG004
"""Check if the extension is in an experimental state."""
return False


class FastAPIFramework(_AppBase):
"""Extension for 12-factor FastAPI applications."""
Expand Down Expand Up @@ -481,6 +487,12 @@ def get_container_name(self) -> str:
"""Return name of the container for the app image."""
return "app"

@staticmethod
@override
def is_experimental(base: tuple[str, ...] | None) -> bool: # noqa: ARG004
"""Check if the extension is in an experimental state."""
return False


class ExpressJSFramework(_AppBase):
"""Extension for 12-factor ExpressJS applications."""
Expand Down Expand Up @@ -508,6 +520,12 @@ def get_container_name(self) -> str:
"""Return name of the container for the app image."""
return "app"

@staticmethod
@override
def is_experimental(base: tuple[str, ...] | None) -> bool: # noqa: ARG004
"""Check if the extension is in an experimental state."""
return False


class SpringBootFramework(_AppBase):
"""Extension for 12-factor Spring Boot applications."""
Expand Down
1 change: 0 additions & 1 deletion docs/tutorial/code/expressjs/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ execute: |

# [docs:export-experimental-env-vars]
export ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true
export CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true
# [docs:export-experimental-env-vars-end]

cd $HOME/tmp
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/code/fastapi/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ execute: |
sed -i "s/amd64/$(dpkg --print-architecture)/g" charmcraft.yaml

# [docs:charm-pack]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
# [docs:charm-pack-end]

# [docs:add-juju-model]
Expand Down Expand Up @@ -133,7 +133,7 @@ execute: |
cd charm

# [docs:refresh-deployment]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
juju refresh fastapi-hello-world \
--path=./fastapi-hello-world_$(dpkg --print-architecture).charm \
--resource app-image=localhost:32000/fastapi-hello-world:0.2
Expand Down Expand Up @@ -171,7 +171,7 @@ execute: |
cd charm

# [docs:refresh-2nd-deployment]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
juju refresh fastapi-hello-world \
--path=./fastapi-hello-world_$(dpkg --print-architecture).charm \
--resource app-image=localhost:32000/fastapi-hello-world:0.3
Expand Down Expand Up @@ -201,7 +201,7 @@ execute: |
curl http://fastapi-hello-world/visitors --resolve fastapi-hello-world:80:127.0.0.1 | grep 2

# [docs:clean-environment]
CHARMCRAFTCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft clean
charmcraft clean
# Back out to main directory for cleanup
cd ..
ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true rockcraft clean
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/code/go/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ execute: |
sed -i "s/amd64/$(dpkg --print-architecture)/g" charmcraft.yaml

# [docs:charm-pack]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
# [docs:charm-pack-end]

# [docs:add-juju-model]
Expand Down Expand Up @@ -141,7 +141,7 @@ execute: |
cd charm

# [docs:refresh-deployment]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
juju refresh go-hello-world \
--path=./go-hello-world_$(dpkg --print-architecture).charm \
--resource app-image=localhost:32000/go-hello-world:0.2
Expand Down Expand Up @@ -190,7 +190,7 @@ execute: |
cd charm

# [docs:refresh-2nd-deployment]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft pack
charmcraft pack
juju refresh go-hello-world \
--path=./go-hello-world_$(dpkg --print-architecture).charm \
--resource app-image=localhost:32000/go-hello-world:0.3
Expand Down Expand Up @@ -220,7 +220,7 @@ execute: |
curl http://go-hello-world/visitors --resolve go-hello-world:80:127.0.0.1 | grep 2

# [docs:clean-environment]
CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true charmcraft clean
charmcraft clean
# Back out to main directory for cleanup
cd ..
ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true rockcraft clean
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/kubernetes-charm-express.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Create a directory for the app:
:end-before: [docs:create-working-dir-end]
:dedent: 2

As the ``expressjs-framework`` extensions for Rockcraft and Charmcraft are
still in development, we must enable experimental extensions for each:
As the ``expressjs-framework`` extension for Rockcraft is
still in development, we must enable experimental extensions:

.. literalinclude:: code/expressjs/task.yaml
:language: bash
Expand Down
5 changes: 0 additions & 5 deletions docs/tutorial/kubernetes-charm-fastapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,6 @@ Let's :literalref:`pack<ref_commands_pack>` the charm:
:end-before: [docs:charm-pack-end]
:dedent: 2

.. note::

``CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS`` is required while the FastAPI
extension is experimental.

Depending on your system and network, this step may take several
minutes to finish.

Expand Down
5 changes: 0 additions & 5 deletions docs/tutorial/kubernetes-charm-go.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,6 @@ Let's :literalref:`pack<ref_commands_pack>` the charm:
:end-before: [docs:charm-pack-end]
:dedent: 2

.. note::

``CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS`` is required while the Go
extension is experimental.

Depending on your system and network, this step can take several
minutes to finish.

Expand Down
6 changes: 3 additions & 3 deletions tests/extensions/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def make_spring_boot_input_yaml():
"extensions": ["go-framework"],
"config": NON_OPTIONAL_OPTIONS,
},
True,
False,
{
"actions": GoFramework.actions,
"assumes": ["k8s-api"],
Expand Down Expand Up @@ -306,7 +306,7 @@ def make_spring_boot_input_yaml():
"extensions": ["fastapi-framework"],
"config": NON_OPTIONAL_OPTIONS,
},
True,
False,
{
"actions": FastAPIFramework.actions,
"assumes": ["k8s-api"],
Expand Down Expand Up @@ -381,7 +381,7 @@ def make_spring_boot_input_yaml():
"extensions": ["expressjs-framework"],
"config": NON_OPTIONAL_OPTIONS,
},
True,
False,
{
"actions": ExpressJSFramework.actions,
"assumes": ["k8s-api"],
Expand Down
Loading