From b8d847bf1d609f87246155566b0aa68e0db7fc75 Mon Sep 17 00:00:00 2001 From: Felix Zumstein Date: Fri, 8 Nov 2024 14:50:07 -0300 Subject: [PATCH] renamed docker dir to deployment --- {docker => deployment}/docker-compose.prod-min.yaml | 0 {docker => deployment}/docker-compose.prod.yaml | 0 docs/changelog.md | 2 +- docs/docker_compose.md | 8 ++++---- docs/production.md | 6 +++--- docs/troubleshooting.md | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename {docker => deployment}/docker-compose.prod-min.yaml (100%) rename {docker => deployment}/docker-compose.prod.yaml (100%) diff --git a/docker/docker-compose.prod-min.yaml b/deployment/docker-compose.prod-min.yaml similarity index 100% rename from docker/docker-compose.prod-min.yaml rename to deployment/docker-compose.prod-min.yaml diff --git a/docker/docker-compose.prod.yaml b/deployment/docker-compose.prod.yaml similarity index 100% rename from docker/docker-compose.prod.yaml rename to deployment/docker-compose.prod.yaml diff --git a/docs/changelog.md b/docs/changelog.md index c665e98..fee0a4c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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. diff --git a/docs/docker_compose.md b/docs/docker_compose.md index 7a1cad9..e555cdc 100644 --- a/docs/docker_compose.md +++ b/docs/docker_compose.md @@ -51,19 +51,19 @@ 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 @@ -71,7 +71,7 @@ This setup includes the following containers: 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: diff --git a/docs/production.md b/docs/production.md index d09bc5b..ba461ae 100644 --- a/docs/production.md +++ b/docs/production.md @@ -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 @@ -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 @@ -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. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 15c07aa..1465350 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -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