Skip to content

Commit

Permalink
Fix workflow badge (#38)
Browse files Browse the repository at this point in the history
* fix workflow badge

* update index doc

* update index doc

* update docs

* update docs

* update docs
  • Loading branch information
gtrkiller authored Jul 14, 2023
1 parent c72dcc3 commit a7d4169
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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)
For further details, [see the charm's detailed documentation](https://charmhub.io/content-cache-k8s/docs)
45 changes: 33 additions & 12 deletions docs/how-to/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,81 @@

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

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

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

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

Expand All @@ -68,7 +89,7 @@ juju add-model content-cache-k8s-dev
juju model-config logging-config="<root>=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
Expand Down
16 changes: 14 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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) |
| 2 | explanation-charm-architecture | [Charm architecture](/t/content-cache-k8s-docs-charm-architecture/8712) |
3 changes: 3 additions & 0 deletions docs/reference/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit a7d4169

Please sign in to comment.