-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split services to enable easier hot reloading in development
- Loading branch information
1 parent
7702fc4
commit 9a34d3d
Showing
5 changed files
with
149 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,7 @@ yarn-error.log* | |
# conda-store | ||
conda-store.sqlite | ||
|
||
# Development workspace | ||
conda-store-workspace/ | ||
|
||
*.lockb |
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,42 @@ | ||
name: conda-store-services | ||
services: | ||
minio: | ||
image: minio/minio:RELEASE.2020-11-10T21-02-24Z | ||
ports: | ||
- "9000:9000" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
entrypoint: sh | ||
command: -c 'mkdir -p /data/conda-store && /usr/bin/minio server /data' | ||
environment: | ||
MINIO_ACCESS_KEY: admin | ||
MINIO_SECRET_KEY: password | ||
|
||
postgres: | ||
image: postgres:13 | ||
user: postgres | ||
ports: | ||
- 5432:5432 | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
environment: | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: conda-store | ||
|
||
redis: | ||
image: bitnami/redis | ||
ports: | ||
- 6379:6379 | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
environment: | ||
REDIS_PASSWORD: password |
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,86 @@ | ||
# Copyright (c) conda-store development team. All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
import logging | ||
|
||
from conda_store_server.server.auth import DummyAuthentication | ||
from conda_store_server.storage import S3Storage | ||
|
||
# ================================== | ||
# conda-store settings | ||
# ================================== | ||
# The default storage_threshold limit was reached on CI, which caused test | ||
# failures | ||
c.CondaStore.storage_threshold = 1024**3 | ||
c.CondaStore.storage_class = S3Storage | ||
c.CondaStore.store_directory = "./conda-store-workspace/" | ||
c.CondaStore.environment_directory = "./conda-store-workspace/envs/{namespace}-{name}" | ||
# c.CondaStore.database_url = "mysql+pymysql://admin:password@mysql/conda-store" | ||
c.CondaStore.database_url = ( | ||
"postgresql+psycopg2://postgres:password@localhost/conda-store" | ||
) | ||
c.CondaStore.redis_url = "redis://:password@localhost:6379/0" | ||
c.CondaStore.default_uid = 1000 | ||
c.CondaStore.default_gid = 1000 | ||
c.CondaStore.default_permissions = "775" | ||
c.CondaStore.conda_included_packages = ["ipykernel"] | ||
|
||
c.CondaStore.pypi_included_packages = ["nothing"] | ||
|
||
|
||
c.S3Storage.internal_endpoint = "minio:9000" | ||
c.S3Storage.external_endpoint = "localhost:9000" | ||
c.S3Storage.access_key = "admin" | ||
c.S3Storage.secret_key = "password" | ||
c.S3Storage.region = "us-east-1" # minio region default | ||
c.S3Storage.bucket_name = "conda-store" | ||
c.S3Storage.internal_secure = False | ||
c.S3Storage.external_secure = False | ||
|
||
# ================================== | ||
# server settings | ||
# ================================== | ||
c.CondaStoreServer.log_level = logging.INFO | ||
c.CondaStoreServer.enable_ui = True | ||
c.CondaStoreServer.enable_api = True | ||
c.CondaStoreServer.enable_registry = True | ||
c.CondaStoreServer.reload = True | ||
c.CondaStoreServer.enable_metrics = True | ||
c.CondaStoreServer.address = "0.0.0.0" | ||
c.CondaStoreServer.port = 8080 | ||
# This MUST start with `/` | ||
c.CondaStoreServer.url_prefix = "/conda-store" | ||
|
||
|
||
# ================================== | ||
# auth settings | ||
# ================================== | ||
c.CondaStoreServer.authentication_class = DummyAuthentication | ||
c.CondaStoreServer.template_vars = { | ||
"banner": '<div class="alert alert-danger" role="alert">This is a localhost server</div>', | ||
"logo": "https://raw.githubusercontent.com/conda-incubator/conda-store/main/docusaurus-docs/community/assets/logos/conda-store-logo-horizontal-lockup.svg", | ||
} | ||
|
||
# ================================== | ||
# worker settings | ||
# ================================== | ||
c.CondaStoreWorker.log_level = logging.INFO | ||
c.CondaStoreWorker.watch_paths = ["./conda-store-workspace/environments"] | ||
c.CondaStoreWorker.concurrency = 4 | ||
|
||
# ================================== | ||
# registry settings | ||
# ================================== | ||
# from python_docker.registry import Registry | ||
# import os | ||
|
||
# def _configure_docker_registry(registry_url: str): | ||
# return Registry( | ||
# "https://registry-1.docker.io", | ||
# username=os.environ.get('DOCKER_USERNAME'), | ||
# password=os.environ.get('DOCKER_PASSWORD')) | ||
|
||
# c.ContainerRegistry.container_registries = { | ||
# 'https://registry-1.docker.io': _configure_docker_registry | ||
# } |