Skip to content

Commit

Permalink
renamed docker dir to deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Nov 8, 2024
1 parent 898a772 commit b8d847b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
## 0.4.3 (Jul 9, 2024)

- Fixed `utils.trigger_script()` to only trigger the script 1x no matter how many times the file is open.
- There is now an official Docker image available: https://hub.docker.com/repository/docker/xlwings/xlwings-server
- There is now an official Docker image available: https://hub.docker.com/repository/deployment/xlwings/xlwings-server
- Open Office.js alerts are now closed before showing a new alert, which would otherwise cause an error.
- Custom functions now show errors that happen outside the app, such as timeouts.
- Upgraded dependencies incl. xlwings to 0.31.9.
Expand Down
8 changes: 4 additions & 4 deletions docs/docker_compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ This setup includes the following containers:
- Whenever there are changes to your source code, in the root directory, run:

```
docker compose -f docker/docker-compose.prod.yaml build
docker compose -f deployment/docker-compose.prod.yaml build
```

- To run the app:

```
docker compose -f docker/docker-compose.prod.yaml up -d
docker compose -f deployment/docker-compose.prod.yaml up -d
```

- To tail the logs (exit via `Ctrl-C`):

```
docker compose -f docker/docker-compose.prod.yaml logs -f
docker compose -f deployment/docker-compose.prod.yaml logs -f
```

## Minimalistic Setup

If you prefer a much more minimalistic setup with only the xlwings Server app container, you can also run the following instead:

```bash
docker compose -f docker/docker-compose.prod-min.yaml up -d
docker compose -f deployment/docker-compose.prod-min.yaml up -d
```

Limitations:
Expand Down
6 changes: 3 additions & 3 deletions docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ With `XLWINGS_ENVIRONMENT="dev"`, you're running a single worker, i.e., process.

Each worker runs an own instance of the xlwings Server app, and so with each additional worker, your memory requirements will increase. The exact number of workers depends on the amount of your traffic and the nature of your functions. [Gunicorn](https://gunicorn.org/), which is the HTTP server recommended for production, suggests a maximum of 2-4 workers per CPU-core. A pragmatic way of finding the right amount of workers is to start with a low number, say 2-4, then increase the number of workers up to a maximum of 4 workers per core if your users encounter performance issues.

You can have a look at [`docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/docker/docker-compose.prod.yaml) to see the gunicorn command with the `workers` argument:
You can have a look at [`docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/deployment/docker-compose.prod.yaml) to see the gunicorn command with the `workers` argument:

```text
gunicorn app.main:main_app
Expand All @@ -157,7 +157,7 @@ If you are using one of the following features, you need to use a [Redis](https:
- [Streaming functions](custom_functions.md#streaming-functions-rtd-functions): Redis connects the [app workers](#workers) with the [Socket.io](#socketio) service via its pub-sub functionality.
- [Object handles](custom_functions.md#object-handles): Redis acts as an object cache that is shared across all [app workers](#workers).

You can install Redis, make it part of your Docker compose stack, or use a hosted service. For reference, see [`docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/docker/docker-compose.prod.yaml).
You can install Redis, make it part of your Docker compose stack, or use a hosted service. For reference, see [`docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/deployment/docker-compose.prod.yaml).

## Socket.io

Expand All @@ -175,5 +175,5 @@ Even if you don't use Socket.io in production, you should leave `XLWINGS_ENABLE_

Under normal circumstances, HTTP requests time out if they do not receive a response within a certain time frame. When deploying xlwings Server, you usually have to deal with a timeout on two levels:

- **gunicorn**: gunicorn serves the Python app and has a default timeout of 30 seconds. If you want to increase it to e.g., 60 seconds, provide the option `--timeout 60` in the gunicorn command, see e.g., [docker/docker-compose.prod.yaml](https://github.com/xlwings/xlwings-server/blob/main/docker/docker-compose.prod.yaml).
- **gunicorn**: gunicorn serves the Python app and has a default timeout of 30 seconds. If you want to increase it to e.g., 60 seconds, provide the option `--timeout 60` in the gunicorn command, see e.g., [deployment/docker-compose.prod.yaml](https://github.com/xlwings/xlwings-server/blob/main/deployment/docker-compose.prod.yaml).
- **Reverse proxy/load balancer**: in front of gunicorn, you usually have a reverse proxy, such as nginx. For Kubernetes or fully managed solutions like Azure functions, you usually deal with a load balancer. They all have their own timeouts, so you might need to adjust it for it to be at least as long as the gunicorn timeout. For example, for nginx, the default timeout is 60 seconds and can be adjusted using the `proxy_read_timeout 60s;` directive.
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You get websocket/socket.io connection errors in the browser dev tools along wit
Invalid session nms2Du11Yi15GwE2AAAA (further occurrences of this error will be logged with level INFO)
```

You're most likely running your Socket.io service with multiple workers. This can happen if you set the `XLWINGS_ENVIRONMENT=dev` but are running multiple gunicorn or uvicorn workers. You have to run the Socket.io service with exactly 1 worker, see [`docker/docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/docker/docker-compose.prod.yaml) for an example production setup.
You're most likely running your Socket.io service with multiple workers. This can happen if you set the `XLWINGS_ENVIRONMENT=dev` but are running multiple gunicorn or uvicorn workers. You have to run the Socket.io service with exactly 1 worker, see [`deployment/docker-compose.prod.yaml`](https://github.com/xlwings/xlwings-server/blob/main/deployment/docker-compose.prod.yaml) for an example production setup.

## Error installing add-ins

Expand Down

0 comments on commit b8d847b

Please sign in to comment.