Skip to content

Commit

Permalink
Updated README.md markdown (#3)
Browse files Browse the repository at this point in the history
Updated README.md markdown
  • Loading branch information
solovyovk authored Jun 20, 2024
1 parent c97d083 commit 38191a4
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ There are three ways the service can be activated:
```
provided that `LICENSE_TICKET_ID` is set in your environment.

IMPORTANT! If you are attempting to build a production environment, it's recommended to use the custom Docker image with WProofreader Server instead of the public one published on Docker Hub. With the custom image, you won't need to activate the license on the container start. Thus, you just skip this step. Otherwise, you may face the issue with reaching the maximum allowed number of license activation attempts (by default, 25). In this case, you need to [contact support](https://webspellchecker.com/contact-us/) to extend/reset the license activation limit. Nevertheless, using the public image is acceptable for evaluation, testing and development purposes.
> [!IMPORTANT]
> If you are attempting to build a production environment, it's recommended to use the custom Docker image with WProofreader Server instead of the public one published on Docker Hub. With the custom image, you won't need to activate the license on the container start. Thus, you just skip this step. Otherwise, you may face the issue with reaching the maximum allowed number of license activation attempts (by default, 25). In this case, you need to [contact support](https://webspellchecker.com/contact-us/) to extend/reset the license activation limit. Nevertheless, using the public image is acceptable for evaluation, testing and development purposes.
## HTTPS

Expand All @@ -65,10 +66,11 @@ files within the chart directory. Keep in mind that Helm can't reach outside the
3. `certMountPath` to whatever path was used in the `Dockerfile`.
For the DockerHub image, one should stick to the default value, which is `/certificate`.

Note: `certFile` and `keyFile` filenames, as well as `certMountPath` have to match to values set in the
`Dockerfile` used for building the image. Otherwise, `nginx` config (`/etc/nginx/conf.d/wscservice.conf`)
has to be updated with new filenames and locations.
The defaults for the DockerHub image are `cert.pem`, `key.pem`, and `/certificate`, respectively.
> [!NOTE]
> `certFile` and `keyFile` filenames, as well as `certMountPath` have to match to values set in the
> `Dockerfile` used for building the image. Otherwise, `nginx` config (`/etc/nginx/conf.d/wscservice.conf`)
> has to be updated with new filenames and locations.
> The defaults for the DockerHub image are `cert.pem`, `key.pem`, and `/certificate`, respectively.
## Custom dictionaries

Expand Down Expand Up @@ -107,19 +109,20 @@ Once uploaded, the files will automatically appear on all pods and persist
even if the pods are restarted. Follow these steps:
1. Get the name of one of the pods. For the Helm release named `wproofreader-app` in the `wsc` namespace, use
```shell
POD=$(kubectl get pods -n wsc -l app.kubernetes.io/instance=wproofreader-app -o jsonpath="{.items[0].metadata.name}")
POD=$(kubectl get pods -n wsc -l app.kubernetes.io/instance=wproofreader-app -o jsonpath="{.items[0].metadata.name}")
```
2. Upload the files to the pod
```shell
kubectl cp -n wsc <local path to files> $POD:/dictionaries
kubectl cp -n wsc <local path to files> $POD:/dictionaries
```
Replace `/dictionaries` with your custom `dictionaries.mountPath` value if applicable.

There is also a way in the Chart to specify an already existing Persistent Volume Claim (PVC) with dictionaries that can be configured to operate on multiple nodes (e.g., NFS). To do this, enable the custom dictionary feature by setting the `dictionaries.enabled` parameter to `true` and specifying the name of the existing PVC in the `dictionaries.existingClaim` parameter.

**Recommended approach:** Using an existing PVC is the recommended way because it ensures that your data will persist even if the Chart is uninstalled. This approach offers a reliable method to maintain data integrity and availability across deployments.

However, please note that provisioning the Persistent Volume (PV) and PVC for storage backends like NFS is outside the scope of this Chart. You will need to provision the PV and PVC separately according to your storage backend's documentation before using the `dictionaries.existingClaim` parameter.
> [!TIP]
> Using an existing PVC is the recommended way because it ensures that your data will persist even if the Chart is uninstalled. This approach offers a reliable method to maintain data integrity and availability across deployments.
>
> However, please note that provisioning the Persistent Volume (PV) and PVC for storage backends like NFS is outside the scope of this Chart. You will need to provision the PV and PVC separately according to your storage backend's documentation before using the `dictionaries.existingClaim` parameter.
## Use in production

Expand All @@ -130,8 +133,6 @@ This can be configured in the `values.yaml` file under the `resources` section.

Below are the recommended resource requests and limits for deploying WProofreader Server v5.34.x with enabled English dialects (en_US, en_GB, en_CA, and en_AU) for spelling & grammar check using the English AI language model for enhanced and more accurate proofreading. It also includes such features as a style guide, spelling autocorrect, named-entity recognition (NER), and text autocomplete suggestions (text prediction). These values represent the minimum requirements for running WProofreader Server in a production environment.

**Note:** Depending on your specific needs and usage patterns, especially when deploying AI language models for enhanced proofreading in other languages, you may need to adjust these values to ensure optimal performance and resource utilization. Alternatively, you can choose the bare-minimum configuration without AI language models. In this case, only algorithmic engines will be used to provide basic spelling and grammar checks.

```yaml
resources:
requests:
Expand All @@ -142,6 +143,9 @@ resources:
cpu: "4"
```
> [!NOTE]
> Depending on your specific needs and usage patterns, especially when deploying AI language models for enhanced proofreading in other languages, you may need to adjust these values to ensure optimal performance and resource utilization. Alternatively, you can choose the bare-minimum configuration without AI language models. In this case, only algorithmic engines will be used to provide basic spelling and grammar checks.
### Readiness and liveness probes
The Helm chart includes readiness and liveness probes to help Kubernetes manage the lifecycle of the WProofreader Server pods. These probes are used to determine when the pod is ready to accept traffic and when it should be restarted if it becomes unresponsive.
Expand All @@ -166,15 +170,16 @@ For dynamic scaling based on resource utilization, you can use Kubernetes Horizo
To use the HPA, you need to turn on the metrics server in your Kubernetes cluster. The HPA will then automatically change the number of pods in a deployment based on how much CPU is being used.
The HPA is not enabled by default in the Helm chart. To enable it, set the `autoscaling.enabled` parameter to `true` in the `values.yaml` file.

**Important Note:** WProofreader Server can be scaled only based on CPU usage metric. The `targetMemoryUtilizationPercentage` is not supported.
> [!IMPORTANT]
> WProofreader Server can be scaled only based on CPU usage metric. The `targetMemoryUtilizationPercentage` is not supported.

## Common issues
### Readiness probe failed

Check the pod logs to see if the license ID has not been provided:
```shell
POD=$(kubectl get pods -n <namespace> -l app.kubernetes.io/instance=<release-name> -o jsonpath="{.items[0].metadata.name}")
kubectl logs -n <namespace> $POD
POD=$(kubectl get pods -n <namespace> -l app.kubernetes.io/instance=<release-name> -o jsonpath="{.items[0].metadata.name}")
kubectl logs -n <namespace> $POD
```

If so, refer to [license section](#license-activation).
Expand All @@ -183,10 +188,10 @@ Existing release can be patched with
helm upgrade -n <namespace> <release-name> wproofreader --set licenseTicketID=<license ID>
```

Keep in mind, that upcoming `helm upgrade`'s have to carry on the `licenseTicketID` flag,
Keep in mind, that upcoming `helm upgrade` have to carry on the `licenseTicketID` flag,
so that it's not overwritten with the (empty) value from `values.yaml`.

### Something got broken following `helm upgrade`
### Something got broken following helm upgrade

Please make sure that all values arguments passed as `--set` CLI arguments
were duplicated with your latest `helm upgrade` call, or simply use `--reuse-values` flag.
Expand Down

0 comments on commit 38191a4

Please sign in to comment.