diff --git a/README.md b/README.md index 347cfc5..1531b6c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![CharmHub Badge](https://charmhub.io/content-cache-k8s/badge.svg)](https://charmhub.io/content-cache-k8s) -[![Release to Edge](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/test_and_publish_charm.yaml/badge.svg)](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/test_and_publish_charm.yaml) +[![Publish to edge](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/publish_charm.yaml/badge.svg)](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/publish_charm.yaml) [![Promote charm](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/promote_charm.yaml/badge.svg)](https://github.com/canonical/content-cache-k8s-operator/actions/workflows/promote_charm.yaml) [![Discourse Status](https://img.shields.io/discourse/status?server=https%3A%2F%2Fdiscourse.charmhub.io&style=flat&label=CharmHub%20Discourse)](https://discourse.charmhub.io) @@ -37,4 +37,4 @@ Thinking about using the Content-cache-k8s for your next project? [Get in touch] --- -For further details, [see the charm's detailed documentation](https://charmhub.io/content-cache-k8s/docs) \ No newline at end of file +For further details, [see the charm's detailed documentation](https://charmhub.io/content-cache-k8s/docs) diff --git a/docs/how-to/contribute.md b/docs/how-to/contribute.md index ae9c250..c745a67 100644 --- a/docs/how-to/contribute.md +++ b/docs/how-to/contribute.md @@ -4,17 +4,20 @@ This document explains the processes and practices recommended for contributing enhancements to the Content-cache-k8s operator. -- Generally, before developing enhancements to this charm, you should consider [opening an issue - ](https://github.com/canonical/content-cache-k8s-operator/issues) explaining your use case. -- If you would like to chat with us about your use-cases or proposed implementation, you can reach - us at [Canonical Mattermost public channel](https://chat.charmhub.io/charmhub/channels/charm-dev) - or [Discourse](https://discourse.charmhub.io/). -- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk) library - will help you a lot when working on new features or bug fixes. +- Generally, before developing enhancements to this charm, you should consider [opening an issue](https://github.com/canonical/content-cache-k8s-operator/issues) explaining your use case. + +- If you would like to chat with us about your use-cases or proposed implementation, you can reach us at [Canonical Mattermost public channel](https://chat.charmhub.io/charmhub/channels/charm-dev) or [Discourse](https://discourse.charmhub.io/). + +- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk) library will help you a lot when working on new features or bug fixes. + - All enhancements require review before being merged. Code review typically examines + - code quality + - test coverage - - user experience for Juju operators of this charm. + + - user experience for Juju operators of this charm + - Please help us out in ensuring easy to review branches by rebasing your pull request branch onto the `main` branch. This also avoids merge commits and creates a linear Git commit history. ## Developing @@ -22,14 +25,19 @@ This document explains the processes and practices recommended for contributing The code for this charm can be downloaded as follows: ``` + git clone https://github.com/canonical/content-cache-k8s-operator + ``` You can use the environments created by `tox` for development: ```shell + tox --notest -e unit + source .tox/unit/bin/activate + ``` ### Testing @@ -37,10 +45,15 @@ source .tox/unit/bin/activate Note that the [content-cache-image](content-cache.Dockerfile) image needs to be built and pushed to microk8s for the tests to run. It should be named `localhost:32000/content-cache:latest` so that Kubernetes knows to pull them from the microk8s repository. Note that the microk8s registry needs to be enabled using `microk8s enable registry`. More details regarding the Docker images below. The following commands can then be used to run the tests: * `tox`: Runs all of the basic checks (`lint`, `unit`, `static`, and `coverage-report`). + * `tox -e fmt`: Runs formatting using `black` and `isort`. + * `tox -e lint`: Runs a range of static code analysis to check the code. + * `tox -e static`: Runs other checks such as `bandit` for security issues. + * `tox -e unit`: Runs the unit tests. + * `tox -e integration`: Runs the integration tests. ## Build charm @@ -48,16 +61,24 @@ Note that the [content-cache-image](content-cache.Dockerfile) image needs to be Build the charm in this git repository using: ```shell + charmcraft pack + ``` + For the integration tests (and also to deploy the charm locally), the content-cache image is required in the microk8s registry. To enable it: - microk8s enable registry +``` +microk8s enable registry +``` The following commands push the required image into the registry: - docker build . -f content-cache.Dockerfile -t localhost:32000/content-cache:latest - docker push localhost:32000/content-cache:latest +``` +docker build . -f content-cache.Dockerfile -t localhost:32000/content-cache:latest + +docker push localhost:32000/content-cache:latest +``` ### Deploy @@ -68,7 +89,7 @@ juju add-model content-cache-k8s-dev juju model-config logging-config="=INFO;unit=DEBUG" # Deploy the charm (Assuming you're on amd64) juju deploy ./content-cache-k8s_ubuntu-20.04-amd64.charm \ - --resource content-cache-image=localhost:32000/content-cache:latest \ +--resource content-cache-image=localhost:32000/content-cache:latest ``` ## Canonical contributor agreement diff --git a/docs/index.md b/docs/index.md index 8214eca..a4560a4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,16 @@ -This service is based on [Nginx](https://nginx.com) and can be used either as a front-end caching service providing high bandwidth access to sites (as a kind of CDN), or as a local cache of sites. +A [Juju](https://juju.is/) [charm](https://juju.is/docs/olm/charmed-operators) deploying and managing service for caching content, built on top of [Nginx](https://www.nginx.com/), configurable to cache any http or https web site and useful for building content delivery networks (CDN). + +This charm simplifies initial deployment and caching operations on Kubernetes, such as scaling the number of cache instances and cache configuration changes. It allows for deployment on many different Kubernetes platforms, from [MicroK8s](https://microk8s.io) to +[Charmed Kubernetes](https://ubuntu.com/kubernetes) and public cloud Kubernetes +offerings. + +This service was developed to provide front-end caching for web sites run by Canonical's IS team, and to reduce the need for third-party CDNs by providing high-bandwidth access to web sites via this caching front-end. + +Currently used for a number of services including [the Snap Store](https://snapcraft.io/store), +the majority of Canonical's web properties including [ubuntu.com](https://ubuntu.com) and +[canonical.com](https://canonical.com), and [Ubuntu Extended Security Maintenance](https://ubuntu.com/security/esm). + +For DevOps or SRE teams this charm will make operating it simple and straightforward through Juju's clean interface. # Navigation @@ -14,4 +26,4 @@ This service is based on [Nginx](https://nginx.com) and can be used either as a | 2 | reference-configurations | [Configurations](/t/content-cache-k8s-docs-configurations/8714) | | 2 | reference-integrations | [Integrations](/t/content-cache-k8s-docs-integrations/8713) | | 1 | explanation | [Explanation]() | -| 2 | explanation-charm-architecture | [Charm architecture](/t/content-cache-k8s-docs-charm-architecture/8712) | \ No newline at end of file +| 2 | explanation-charm-architecture | [Charm architecture](/t/content-cache-k8s-docs-charm-architecture/8712) | diff --git a/docs/reference/integrations.md b/docs/reference/integrations.md index 4e41b47..6e2e2e2 100644 --- a/docs/reference/integrations.md +++ b/docs/reference/integrations.md @@ -3,8 +3,11 @@ This charm integrates with: - [Grafana](https://grafana.com/) + - [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress) + - [Loki](https://grafana.com/oss/loki/) + - [Prometheus](https://prometheus.io/) See more information in [Charm Architecture](https://charmhub.io/content-cache-k8s/docs/charm-architecture).