Skip to content

Commit

Permalink
Add wopiserver integration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuAlfageme committed Aug 27, 2020
1 parent 1ca1e62 commit 8fd71d1
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/content/en/docs/IOP/Deployment/Kubernetes/_index.md
@@ -1,7 +1,7 @@
---
title: "Kubernetes Deployment"
linkTitle: "kubernetes"
weight: 15
linkTitle: "Kubernetes"
weight: 16
description: >
Deploy and configure the IOP on your cluster.
---
Expand Down Expand Up @@ -163,3 +163,7 @@ pvc-fddca20b-69a4-43ec-ad12-6d4e2bd4a433 1Gi RWO Delete
```

If the PVC was auto-provisioned by a previous release, you'll need to pass its name (i.e. `<release-name>-gateway`) as `persistentVolume.existingClaim`, as part of the `helm upgrade` command.

## Next Steps

Once you have your deployment up and running, consider one of these tutorials:
131 changes: 131 additions & 0 deletions docs/content/en/docs/IOP/Deployment/Kubernetes/wopiserver.md
@@ -0,0 +1,131 @@
---
title: "Deploying and configuring the WOPI Server with Collabora Code"
linkTitle: "WOPI Server"
weight: 17
description: >
Enable the deployment of the WOPI Server as part of the IOP.
---

## Prerequisites

- This tutorial focuses on enabling the [`WOPI Server`](https://github.com/cs3org/wopiserver) as part of an **existing IOP deployment**. For detailed instructions on how to achieve the latter, [refer to the Kubernetes section of this documentation](https://developer.sciencemesh.io/docs/iop/deployment/kubernetes).

> **Note:** Verify you have the `sciencemesh/iop` chart sources on version `0.0.3` or greater:
```bash
helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "sciencemesh" chart repository
Update Complete. ⎈ Happy Helming!

helm search repo sciencemesh/iop
NAME CHART VERSION APP VERSION DESCRIPTION
sciencemesh/iop 0.0.3 0.0.1 ScienceMesh IOP is the reference Federated Scie...
```
## (Optional) Deploying a Collabora Code instance on your cluster
To demonstrate how an office-online application provider can integrate with the IOP through the WOPI protocol, we need an actual provider we can connect to. If you don't have such application at hand, don't worry. You can use a self-contained [Collabora Code](https://www.collaboraoffice.com/code/) installation on Kubernetes instead.
The official Helm chart for [`stable/collabora-code`](https://hub.helm.sh/charts/stable/collabora-code) can be used to deploy everything on our cluster in a very simple way.
First, we need to add the Chart's repo to our helm sources:
```bash
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
"stable" has been added to your repositories
helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "sciencemesh" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈
helm search repo stable/collabora-code
NAME CHART VERSION APP VERSION DESCRIPTION
stable/collabora-code 1.0.6 4.0.3.1 A Helm chart for Collabora Office - CODE-Edition
```
Next, we need to create a minimal YAML file holding the custom deployment values:
- `collabora.domain` which points to the `wopiserver` url. Since we're running it all on the same cluster, we can use the service [DNS record](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#services) for this.
- `collabora.server_name` will be used to generate the public URLs to be passed to the users.
> **Note:** notice we need to slash-escape periods for this value: `<hostname\.domain\.tld>`.
- The `ingress.paths` needs to be configured according to the [Collabora Code reverse-proxy documentation](https://www.collaboraoffice.com/code/apache-reverse-proxy/).
Putting it all together, we will end up with something similar to:
```bash
cat << EOF > collabora.yaml
collabora:
domain: iop-wopiserver
server_name: <hostname\.domain\.tld>
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hosts:
- <hostname.domain.tld>
paths:
- /loleaflet
- /hosting/discovery
- /hosting/capabilities
- /lool
- /lool/adminws
- /lool/(.*)/ws$
EOF
```
And now, to deploy it on the cluster, we just need to install the chart as follows:
```bash
helm upgrade -i collabora stable/collabora-code -f collabora.yaml
```
## Enabling wopiserver on the IOP deployment
For convenience, wopiserver ships as a separate chart from Reva but it comes bundled on the IOP. It can be explicitly enabled via feature flag.
> **Note:** the wopiserver chart has been developed with a simplified ingress configuration (i.e. single `host` and `path`) to ease the deployment. If you need to expose multiple hosts/paths, please open a [feature request on cs3org/charts](https://github.com/cs3org/charts/issues/new) to support this feature.
The most important settings you'll need to provide are the `wopiserver.config.appProviders.codeurl` and `wopiserver.config.cs3.revahost`: the endpoints for Collabora Code and Reva, respectively. [Additional values](https://github.com/cs3org/wopiserver/blob/master/wopiserver.conf) can also be configured.
If Code was deployed inside the cluster following the steps on the previous section, this configuration will connect all the required services together:
```bash
cat << EOF > wopiserver.yaml
wopiserver:
config:
appProviders:
codeurl: http://collabora-collabora-code:9980
cs3:
revahost: iop-revad:19000
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hostname: <hostname>
path: /wopi
EOF
```
Last, we just need to install/upgrade the IOP stack by passing this custom configuration as well as the `wopiserver.enable` flag.
> **Note:** If it is the first time deploying the IOP, you should also provide [the custom configuration for Reva](https://developer.sciencemesh.io/docs/iop/deployment/kubernetes/#configuring-an-iop-deployment). Otherwise helm will pick the values from the last deployment unless `--reset-values` is specified.
```bash
helm upgrade -i iop sciencemesh/iop \
--set wopiserver.enable=true \
-f wopiserver.yaml
```
## Testing the deployment
To test wopiserver's `open` workflow with Reva, refer to the detailed [how-to on wopiserver's README](https://github.com/cs3org/wopiserver#test-the-open-workflow-with-reva).
> **Note:** for the `x-access-token` on step 3 after a successful login, you can use the contents of the `.reva-token` file created by reva on your (client's) home directory.
7 changes: 4 additions & 3 deletions docs/content/en/docs/IOP/Deployment/_index.md
Expand Up @@ -6,12 +6,13 @@ description: >
How to deploy the IOP?
---

## Deployment
The ScienceMesh IOP consists of various components, being the core one [Reva](https://reva.link). Reva is an inter-operability platform that bridge the gap between cloud storages and application providers.

## Local deployment
Deploy invidual components one by one in your local computer. This approach is the best to learn how the different services connect to each other.

## Minikube deployment
The official mode of deployment for the platform will be to use Kubernetes and Helm charts.
Having a fully fledged Kubernetes cluster is a task on its own, so for the time being we provide a local Minikube deployment using the same specifications that will be consumed by a production Kubernetes cluster, so you can hack in your own computer.
Having a fully fledged Kubernetes cluster is a task on its own. This section provides a Minikube setup using the same specifications that will be consumed by a production cluster, so you can start hacking in your own computer.

## Kubernetes deployment
The official way of deploying the IOP platform are its [Helm charts](https://sciencemesh.github.io/charts/). They provide an abstraction over the different Kubernetes entities required to configure and run the IOP on your cluster.

0 comments on commit 8fd71d1

Please sign in to comment.