-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial redis cache support for reference datasets (#33)
* First pass at redis cache in reference reads * Turn off cache * Fix requirements, get cache working * Add lots more documentation, do settings correctly * Update kubernetes and circleci build arguments * Remove rps specific kubernetes yaml * Add redis cache to vdatum extension * vdatum safety enhancements * Make timeout configurable * Cleanup reading settings config * Add schema to readme * Add back the memory dataset cache * Fix cache timeout * Bump redis fsspec cache req
- Loading branch information
1 parent
779cc65
commit 5e06f9f
Showing
19 changed files
with
341 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3' | ||
|
||
services: | ||
redis: | ||
container_name: redis | ||
image: redis:7-alpine | ||
volumes: | ||
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf | ||
restart: on-failure | ||
ports: | ||
- "6380:6380" | ||
command: redis-server /usr/local/etc/redis/redis.conf | ||
xreds: | ||
container_name: xreds | ||
build: . | ||
volumes: | ||
- "./datasets:/opt/xreds/datasets" | ||
platform: linux/amd64 | ||
ports: | ||
- "8090:8090" | ||
depends_on: | ||
- redis | ||
environment: | ||
- PORT=8090 | ||
- DATASETS_MAPPING_FILE=/opt/xreds/datasets/datasets.json | ||
- EXPORT_THRESHOLD=600 | ||
- USE_REDIS_CACHE=true | ||
- REDIS_HOST=redis | ||
- REDIS_PORT=6380 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
port 6380 | ||
protected-mode no | ||
|
||
# Save to disk every 60 seconds if at least 1 key has changed | ||
save 60 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
from pydantic_settings import BaseSettings | ||
|
||
|
||
class Settings(BaseSettings): | ||
datasets_mapping_file: str | ||
class Settings(BaseSettings): | ||
'''Settings for running xreds''' | ||
# fsspec compatible url path to the dataset mapping file | ||
# in either json or yml format | ||
datasets_mapping_file: str = '' | ||
|
||
# Root path for the service to mount at | ||
root_path: str = '' | ||
|
||
settings = Settings() | ||
# Timeout for caching datasets in seconds | ||
dataset_cache_timeout: int = 10 * 60 | ||
|
||
# Size threshold exporting datasets to local files | ||
# in MB | ||
export_threshold: int = 500 | ||
|
||
# Whether to use redis to cache datasets when possible | ||
use_redis_cache: bool = False | ||
|
||
# Optional redis host name | ||
# If not provided, will default to localhost | ||
redis_host: str = "localhost" | ||
|
||
# Optional redis port number | ||
# If not provided, will default to 6379 | ||
redis_port: int = 6379 | ||
|
||
|
||
settings = Settings() |
Oops, something went wrong.