-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add init template for flask-framework #1428
Changes from 5 commits
594045e
1b585f0
ee05744
edde0a7
fc4d777
aeaec96
a636dae
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
venv/ | ||
build/ | ||
*.charm | ||
.tox/ | ||
.coverage | ||
__pycache__/ | ||
*.py[cod] | ||
.idea | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file configures Charmcraft. | ||
# See https://juju.is/docs/sdk/charmcraft-config for guidance. | ||
|
||
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. While the extension does fill in the 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. Gotcha, added, thanks! |
||
name: {{ name }} | ||
|
||
bases: | ||
- build-on: | ||
- name: ubuntu | ||
channel: "22.04" | ||
run-on: | ||
- name: ubuntu | ||
channel: "22.04" | ||
|
||
# (Required) | ||
summary: A very short one-line summary of the flask application. | ||
|
||
# (Required) | ||
description: | | ||
A comprehensive overview of your Flask application. | ||
|
||
extensions: | ||
- flask-framework | ||
|
||
# Uncomment the integrations used by your application | ||
# requires: | ||
# mysql: | ||
# interface: mysql_client | ||
# limit: 1 | ||
# postgresql: | ||
# interface: postgresql_client | ||
# limit: 1 | ||
Comment on lines
+26
to
+33
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. Should this include all of the integrations we support? E.g., ingress seems to be missing? 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. Ingress and other relations are default and static for now, so user can't change them. 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. Ah I see |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/canonical/xiilib/archive/v0.1.0.tar.gz | ||
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. Out of interest, what's the name? 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. Yes, it was originally going to be 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. Any great ideas for better names are more than welcome 🙂 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. how about 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. I'll throw my hat in the ring with
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. How about |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright {{ year }} {{ author }} | ||
# See LICENSE file for licensing details. | ||
|
||
"""Flask Charm entrypoint.""" | ||
|
||
import logging | ||
import typing | ||
|
||
import ops | ||
|
||
import xiilib.flask | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class FlaskCharm(xiilib.flask.Charm): | ||
"""Flask Charm service.""" | ||
|
||
def __init__(self, *args: typing.Any) -> None: | ||
"""Initialize the instance. | ||
|
||
Args: | ||
args: passthrough to CharmBase. | ||
""" | ||
super().__init__(*args) | ||
|
||
|
||
if __name__ == "__main__": # pragma: nocover | ||
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. Should we remove the 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. Updated, thanks! |
||
ops.main.main(FlaskCharm) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
summary: test charmcraft init with flask-framework profile | ||
|
||
execute: | | ||
mkdir -p test-init | ||
cd test-init | ||
charmcraft init --profile flask-framework | ||
export CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true | ||
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. This can be set in an 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. Updated, thanks! |
||
charmcraft fetch-lib charms.traefik_k8s.v2.ingress | ||
charmcraft fetch-lib charms.observability_libs.v0.juju_topology | ||
charmcraft fetch-lib charms.grafana_k8s.v0.grafana_dashboard | ||
charmcraft fetch-lib charms.loki_k8s.v0.loki_push_api | ||
charmcraft fetch-lib charms.data_platform_libs.v0.data_interfaces | ||
charmcraft fetch-lib charms.prometheus_k8s.v0.prometheus_scrape | ||
charmcraft pack --verbose | ||
test -f *.charm | ||
|
||
restore: | | ||
export CHARMCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=true | ||
pushd test-init | ||
charmcraft clean | ||
popd | ||
|
||
rm -rf test-init |
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.
Please update
_overview
below to include a description of this template.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.
I have added an one sentence summary for now, but I will add a link to the document once we have published the document for the 12-factor project.