Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jan 31, 2023
1 parent e0be283 commit 1b4b347
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3.2" # higher config versions may also work; lower will not
services:
web:
tiled:
image: tiled
volumes:
- type: bind
Expand Down
7 changes: 2 additions & 5 deletions docs/source/how-to/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ and serve it using the docker container
```
docker run --rm -p 8000:8000 \
--mount type=bind,source="$(pwd)",target=/deploy \
--env TILED_CONFIG=/deploy/config.yml ghcr.io/bluesky/tiled:main
--env TILED_CONFIG=/deploy/config.yml \
ghcr.io/bluesky/tiled:main
```
Note that we make the data and the configuration file available to the
container via bind mounds and point tiled to the configuration file using the
Expand Down Expand Up @@ -62,7 +63,3 @@ services:
```
With this file the tiled server can be brought up by simply running `docker-compose up`.

To change the gunicorn configuration, to for example change the number of
workers or the port, set the environment variable `GUNICORN_CONF` to point to
a configuration file accessible in the container.
3 changes: 2 additions & 1 deletion tiled/_tests/test_scaled_config_option.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
This tests the feature that is exercised by the --scalable CLI option.
"""
import pytest
from pathlib import Path

import pytest

from ..config import construct_build_app_kwargs, parse_configs
from ..server.app import UnscalableConfig, build_app

Expand Down
8 changes: 6 additions & 2 deletions tiled/commandline/_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def serve_directory(
"available_bytes"
] = object_cache_available_bytes
tree = DirectoryAdapter.from_directory(directory, **tree_kwargs)
web_app = build_app(tree, {"allow_anonymous_access": public}, server_settings, scalable=scalable)
web_app = build_app(
tree, {"allow_anonymous_access": public}, server_settings, scalable=scalable
)
print_admin_api_key_if_generated(web_app, host=host, port=port)

import uvicorn
Expand Down Expand Up @@ -142,7 +144,9 @@ def serve_pyobject(
server_settings["object_cache"][
"available_bytes"
] = object_cache_available_bytes
web_app = build_app(tree, {"allow_anonymous_access": public}, server_settings, scalable=scalable)
web_app = build_app(
tree, {"allow_anonymous_access": public}, server_settings, scalable=scalable
)
print_admin_api_key_if_generated(web_app, host=host, port=port)

import uvicorn
Expand Down
1 change: 0 additions & 1 deletion tiled/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,4 +748,3 @@ def print_admin_api_key_if_generated(web_app, host, port):

class UnscalableConfig(Exception):
pass

2 changes: 1 addition & 1 deletion tiled/server/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def prometheus_registry():
if os.environ.get("PROMETHEUS_MULTIPROC_DIR"):
# The multiprocess configuration makes it compatible with gunicorn.
# https://github.com/prometheus/client_python/#multiprocess-mode-eg-gunicorn
from prometheus_client.multiprocess import MultiProcessCollector
from prometheus_client import CollectorRegistry
from prometheus_client.multiprocess import MultiProcessCollector

registry = CollectorRegistry()
MultiProcessCollector(registry) # This has a side effect.
Expand Down

0 comments on commit 1b4b347

Please sign in to comment.