Skip to content

Commit 4fcaf61

Browse files
fix deployment issues
1 parent f97fcab commit 4fcaf61

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

projects/sbos-minimal/sbos/minimal/config/settings/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ class BackendMinimalSettings(BaseSettings):
160160
class BackendBrickSettings(BaseSettings):
161161
BRICK_VERSION: str = Field(default="1.3", description="Brick version used.")
162162
DEFAULT_BRICK_URL: AnyUrl = Field(
163-
default="https://brickschema.org/schema/Brick", description="Brick schema URL."
163+
default="https://github.com/BrickSchema/Brick/releases/download/v1.4.0/Brick.ttl",
164+
description="Brick schema URL."
164165
)
165166
DEFAULT_REF_SCHEMA_URL: AnyUrl = Field(
166167
default="https://gist.githubusercontent.com/tc-imba/714c2043e893b1538406a9113140a4fe/"

projects/sbos-minimal/sbos/minimal/services/domain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ async def initialize_domain_background(self, domain: models.Domain):
4242
]
4343
await asyncio.gather(*tasks)
4444
graphs = await self.graphdb.list_graphs(domain.name)
45-
await self.initialize_rdf_schema(graphs, domain, settings.DEFAULT_BRICK_URL)
45+
await self.initialize_rdf_schema(graphs, domain, str(settings.DEFAULT_BRICK_URL))
4646
await self.initialize_rdf_schema(
47-
graphs, domain, settings.DEFAULT_REF_SCHEMA_URL
47+
graphs, domain, str(settings.DEFAULT_REF_SCHEMA_URL)
4848
)
4949
domain.initialized = True
5050
await domain.save()

projects/sbos-playground/docker-compose-dev.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ services:
1515
- core-minimal
1616
environment:
1717
DEBUG: true
18+
CACHE: false
1819
SERVER_WORKERS: 1
1920
# FRONTEND_URL: http://localhost:8000
2021
volumes:
21-
- ./static:/root/sbos-playground/static
22+
- ./app_static:/root/sbos-playground/app_static
2223
- ./sbos/playground:/root/sbos-playground/sbos/playground
2324
- ../sbos-minimal/sbos/minimal:/root/sbos-minimal/sbos/minimal
2425
- ./tests:/root/sbos-playground/tests

projects/sbos-playground/sbos/playground/config/settings/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pathlib
22

3-
from pydantic import Field
3+
from pydantic import Field, field_validator
44
from pydantic_settings import BaseSettings
55
from sbos.minimal.config.settings.base import BackendBaseSettings as MinimalSettings
66

@@ -13,7 +13,7 @@ class BackendPlaygroundSettings(BaseSettings):
1313
DEFAULT_ADMIN: str = Field(
1414
default="[email protected]",
1515
description="The email of default admin user. "
16-
"(deprecated, we should remove it in future version)",
16+
"(deprecated, we should remove it in future version)",
1717
)
1818
ISOLATED_NETWORK_NAME: str = Field(
1919
default="isolated_nw", description="The name of the isolated network in docker."
@@ -26,6 +26,11 @@ class BackendPlaygroundSettings(BaseSettings):
2626
default="app_static", description="The directory to save app static files."
2727
)
2828

29+
@field_validator('APP_STATIC_DIR')
30+
@classmethod
31+
def validate_app_static_dir(cls, v: pathlib.Path):
32+
return v.absolute()
33+
2934

3035
class BackendBaseSettings(BackendPlaygroundSettings, MinimalSettings):
3136
TITLE: str = "SBOS Playground"

projects/sbos-playground/sbos/playground/interfaces/actuation_guard/ml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self):
9494
import __main__
9595

9696
setattr(__main__, "VAE", VAE)
97-
self.model = torch.load(model_file, map_location=device)
97+
self.model = torch.load(model_file, map_location=device, weights_only=False)
9898

9999
# def inference(self, input):
100100
# prediction = self.model.decode(torch.FloatTensor(input).reshape(1, -1).to(device))

projects/sbos-playground/sbos/playground/interfaces/app_management.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from docker.models.images import Image
88

99
import docker
10+
import docker.errors
1011
from sbos.playground.config.manager import settings
1112
from sbos.playground.schemas import DockerStatus
1213

@@ -238,7 +239,11 @@ def start_container(container_name: str) -> Container:
238239
raise TypeError("container name is expected to be str")
239240
# subprocess.run(["docker", "start", container_id])
240241
container = docker_client.containers.get(container_name)
241-
container.start()
242+
try:
243+
container.start()
244+
except docker.errors.DockerException as e:
245+
rm_container(container_name)
246+
raise e
242247
return container
243248

244249

0 commit comments

Comments
 (0)