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
# docker-compose config for local development | |
version: '3' | |
services: | |
superapp: | |
command: python3 -m superapp | |
restart: always | |
build: | |
context: ./ | |
dockerfile: Dockerfile | |
volumes: |
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
SUPERAPP_ENV=local | |
SUPERAPP_LOCAL_MODE_FILE_PATH=/config.json | |
SUPERAPP_APP_NAME=superapp |
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
FROM python:3.8.3-buster | |
ENV PYTHONUNBUFFERED=1 \ | |
POETRY_VIRTUALENVS_CREATE=false \ | |
POETRY_VIRTUALENVS_IN_PROJECT=false \ | |
POETRY_NO_INTERACTION=1 | |
RUN pip install poetry |
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
from typing import Any, Dict | |
from pydantic import Field | |
from sitri.settings.contrib.vault import VaultKVSettings | |
from superapp.config.provider_config import BaseConfig, configurator | |
class KafkaSettings(VaultKVSettings): | |
mechanism: str = Field(..., vault_secret_key="auth_mechanism") |
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
import hvac | |
from sitri.providers.contrib.system import SystemConfigProvider | |
from sitri.providers.contrib.vault import VaultKVConfigProvider | |
from sitri.settings.contrib.vault import VaultKVSettings | |
configurator = SystemConfigProvider(prefix="superapp") | |
ENV = configurator.get("env") | |
is_local_mode = ENV == "local" | |
local_mode_file_path = configurator.get("local_mode_file_path") |
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
from superapp.config import AppSettings | |
config = AppSettings() | |
print(config) | |
print(config.dict()) |
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
from pydantic import BaseModel, Field | |
from superapp.config.database_settings import DBSettings | |
from superapp.config.faust_settings import FaustSettings | |
from superapp.config.kafka_settings import KafkaSettings | |
class AppSettings(BaseModel): | |
db: DBSettings = Field(default_factory=DBSettings) | |
faust: FaustSettings = Field(default_factory=FaustSettings) |
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
from typing import Dict | |
from pydantic import Field, BaseModel | |
from sitri.settings.contrib.vault import VaultKVSettings | |
from superapp.config.provider_config import provider | |
class AgentConfig(BaseModel): |
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
from typing import Dict, Any | |
from pydantic import Field | |
from sitri.settings.contrib.vault import VaultKVSettings | |
from superapp.config.provider_config import provider, configurator | |
class KafkaSettings(VaultKVSettings): |
NewerOlder