-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial integration tests * update ini path * add required env vars * fix unbound local
- Loading branch information
Showing
24 changed files
with
488 additions
and
213 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Addon Integration | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f mindctrl-addon/test-requirements.txt ]; then pip install -r mindctrl-addon/test-requirements.txt; fi | ||
- name: Lint with Ruff | ||
run: | | ||
ruff check . | ||
- name: Test with pytest | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
run: | | ||
pytest -v -s -c mindctrl-addon/tests/pytest.ini |
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,17 @@ | ||
name: k3s | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
some-job: | ||
steps: | ||
- uses: nolar/setup-k3d-k3s@v1 | ||
with: | ||
version: v1.21 # E.g.: v1.21, v1.21.2, v1.21.2+k3s1 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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 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 @@ | ||
from typing import Optional, Union, Literal | ||
from pydantic import BaseModel, Field, SecretStr | ||
from pydantic_settings import BaseSettings, SettingsConfigDict | ||
|
||
|
||
# this is just to make settings typing happy - I don't have another implementation yet | ||
class UnknownEventsSettings(BaseModel): | ||
events_type: Literal["unknown"] | ||
|
||
class MqttEventsSettings(BaseModel): | ||
events_type: Literal["mqtt"] | ||
|
||
broker: str = "localhost" | ||
port: int = 1883 | ||
username: Optional[str] = None | ||
password: Optional[SecretStr] = None | ||
|
||
class PostgresStoreSettings(BaseModel): | ||
store_type: Literal["psql"] | ||
|
||
user: str | ||
password: SecretStr | ||
address: str = "localhost" | ||
port: int = 5432 | ||
database: str = "mindctrl" | ||
|
||
# Just to make typing happy for now - add dapr, sqlite, etc | ||
class UnknownStoreSettings(BaseModel): | ||
store_type: Literal["unknown"] | ||
|
||
class AppSettings(BaseSettings): | ||
# double underscore, in case your font doesn't make it clear | ||
model_config = SettingsConfigDict(env_nested_delimiter='__') | ||
|
||
store: Union[PostgresStoreSettings, UnknownStoreSettings] = Field(discriminator="store_type") | ||
events: Union[MqttEventsSettings, UnknownEventsSettings] = Field(discriminator="events_type") | ||
# TODO: move this into the gateway or something | ||
openai_api_key: SecretStr | ||
force_publish_models: bool = False | ||
notify_fd: Optional[int] = None | ||
include_challenger_models: bool = True | ||
mlflow_tracking_uri: Optional[str] = None |
4 changes: 0 additions & 4 deletions
4
mindctrl-addon/rootfs/usr/bin/multiserver/db/models/summary_data.py
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
Oops, something went wrong.