Compare commits

..

5 Commits

Author SHA1 Message Date
KatKatKateryna 2f7113f0c5 linter 2024-08-04 23:25:43 +01:00
KatKatKateryna 7f38b24421 isort 2024-08-04 22:52:56 +01:00
KatKatKateryna cac4551fdf extension 2024-08-04 21:50:22 +01:00
KatKatKateryna 813bc8be4d gisfeature class 2024-08-04 21:44:29 +01:00
KatKatKateryna a45ae03235 return deprecated command 2024-08-04 21:42:28 +01:00
9 changed files with 551 additions and 851 deletions
+52 -10
View File
@@ -52,26 +52,28 @@ services:
####
# Speckle Server
#######
speckle-frontend:
image: speckle/speckle-frontend-2:latest
image: speckle/speckle-frontend:latest
restart: always
ports:
- "0.0.0.0:8080:8080"
environment:
FILE_SIZE_LIMIT_MB: 100
speckle-server:
image: speckle/speckle-server:latest
restart: always
healthcheck:
test:
- CMD
- /nodejs/bin/node
- -e
- "try { require('node:http').request({headers: {'Content-Type': 'application/json'}, port:3000, hostname:'127.0.0.1', path:'/readiness', method: 'GET', timeout: 2000 }, (res) => { body = ''; res.on('data', (chunk) => {body += chunk;}); res.on('end', () => {process.exit(res.statusCode != 200 || body.toLowerCase().includes('error'));}); }).end(); } catch { process.exit(1); }"
[
"CMD",
"node",
"-e",
"require('node:http').request({headers: {'Content-Type': 'application/json'}, port:3000, hostname:'127.0.0.1', path:'/graphql?query={serverInfo{version}}', method: 'GET' }, (res) => { body = ''; res.on('data', (chunk) => {body += chunk;}); res.on('end', () => {process.exit(res.statusCode != 200 || body.toLowerCase().includes('error'));}); }).end();",
]
interval: 10s
timeout: 10s
retries: 3
start_period: 90s
timeout: 3s
retries: 30
ports:
- "0.0.0.0:3000:3000"
depends_on:
@@ -96,7 +98,6 @@ services:
S3_CREATE_BUCKET: "true"
FILE_SIZE_LIMIT_MB: 100
MAX_PROJECT_MODELS_PER_PAGE: 500
# TODO: Change this to a unique secret for this server
SESSION_SECRET: "TODO:ReplaceWithLongString"
@@ -110,6 +111,47 @@ services:
POSTGRES_DB: "speckle"
ENABLE_MP: "false"
preview-service:
image: speckle/speckle-preview-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
mem_limit: "1000m"
memswap_limit: "1000m"
environment:
DEBUG: "preview-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
webhook-service:
image: speckle/speckle-webhook-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
environment:
DEBUG: "webhook-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
WAIT_HOSTS: postgres:5432
fileimport-service:
image: speckle/speckle-fileimport-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
environment:
DEBUG: "fileimport-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
WAIT_HOSTS: postgres:5432
S3_ENDPOINT: "http://minio:9000"
S3_ACCESS_KEY: "minioadmin"
S3_SECRET_KEY: "minioadmin"
S3_BUCKET: "speckle-server"
SPECKLE_SERVER_URL: "http://speckle-server:3000"
networks:
default:
name: speckle-server
Generated
+473 -637
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -264,7 +264,7 @@ class AutomationContext:
files = {path_obj.name: open(str(path_obj), "rb")}
url = (
f"{self.automation_run_data.speckle_server_url}api/stream/"
f"{self.automation_run_data.speckle_server_url}/api/stream/"
f"{self.automation_run_data.project_id}/blob"
)
data = (
+2 -2
View File
@@ -58,7 +58,7 @@ def get_local_accounts(base_path: Optional[str] = None) -> List[Account]:
res = account_storage.get_all_objects()
account_storage.close()
if res:
accounts.extend(Account.model_validate_json(r[1]) for r in res)
accounts.extend(Account.parse_raw(r[1]) for r in res)
except SpeckleException:
# cannot open SQLiteTransport, probably because of the lack
# of disk write permissions
@@ -79,7 +79,7 @@ def get_local_accounts(base_path: Optional[str] = None) -> List[Account]:
if json_acct_files:
try:
accounts.extend(
Account.model_validate_json(Path(json_path, json_file).read_text())
Account.parse_raw(Path(json_path, json_file).read_text())
# Account.parse_file(os.path.join(json_path, json_file))
for json_file in json_acct_files
)
+13
View File
@@ -0,0 +1,13 @@
from typing import List, Optional
from specklepy.objects.base import Base
class GisFeature(
Base, speckle_type="Objects.GIS.GisFeature", detachable={"displayValue"}
):
"""GIS Feature"""
geometry: Optional[List[Base]] = None
attributes: Base
displayValue: Optional[List[Base]] = None
-18
View File
@@ -1,22 +1,12 @@
"""Builtin Speckle object kit."""
from specklepy.objects.GIS.CRS import CRS
from specklepy.objects.GIS.features import (
GisMultipatchFeature,
GisNonGeometricFeature,
GisPointFeature,
GisPolygonFeature,
GisPolylineFeature,
)
from specklepy.objects.GIS.geometry import (
GisLineElement,
GisPointElement,
GisPolygonElement,
GisPolygonGeometry,
GisRasterElement,
PolygonGeometry,
PolygonGeometry3d,
GisMultipatchGeometry,
)
from specklepy.objects.GIS.layers import RasterLayer, VectorLayer
@@ -24,17 +14,9 @@ __all__ = [
"VectorLayer",
"RasterLayer",
"GisPolygonGeometry",
"PolygonGeometry",
"PolygonGeometry3d",
"GisMultipatchGeometry",
"GisPolygonElement",
"GisLineElement",
"GisPointElement",
"GisRasterElement",
"CRS",
"GisPointFeature",
"GisPolylineFeature",
"GisPolygonFeature",
"GisMultipatchFeature",
"GisNonGeometricFeature",
]
-107
View File
@@ -1,107 +0,0 @@
from typing import List, Optional
from specklepy.objects.base import Base
from specklepy.objects.geometry import Mesh, Point, Polyline
from specklepy.objects.GIS.geometry import PolygonGeometry
class GisNonGeometricFeature(Base, speckle_type="Objects.GIS.GisNonGeometricFeature"):
"""GIS Table feature"""
attributes: Base
def __init__(
self,
attributes: Optional[Base] = None,
) -> None:
self.attributes = attributes or Base()
class GisPointFeature(
Base,
detachable={"displayValue"},
speckle_type="Objects.GIS.GisPointFeature",
):
"""Gis Point Feature"""
attributes: Base
displayValue: List[Point]
@property
def geometry(self) -> List[Point]:
return self.displayValue
def __init__(
self,
attributes: Optional[Base] = None,
displayValue: Optional[List[Point]] = None,
) -> None:
self.attributes = attributes or Base()
displayValue = displayValue or []
class GisPolylineFeature(
Base,
detachable={"displayValue"},
speckle_type="Objects.GIS.GisPolylineFeature",
):
"""Gis Polyline Feature"""
attributes: Base
displayValue: List[Polyline]
@property
def geometry(self) -> List[Polyline]:
return self.displayValue
def __init__(
self,
attributes: Optional[Base] = None,
displayValue: Optional[List[Point]] = None,
) -> None:
self.attributes = attributes or Base()
displayValue = displayValue or []
class GisPolygonFeature(
Base,
detachable={"displayValue", "geometry"},
speckle_type="Objects.GIS.GisPolygonFeature",
):
"""Gis Polygon Feature"""
attributes: Base
displayValue: List[Mesh]
geometry: List[PolygonGeometry]
def __init__(
self,
geometry: List[PolygonGeometry],
attributes: Optional[Base] = None,
displayValue: Optional[List[Point]] = None,
) -> None:
self.geometry = geometry
self.attributes = attributes or Base()
displayValue = displayValue or []
class GisMultipatchFeature(
Base,
detachable={"displayValue", "geometry"},
speckle_type="Objects.GIS.GisMultipatchFeature",
):
"""Gis Multipatch Feature"""
attributes: Base
displayValue: List[Mesh]
geometry: List[Base] # GisMultipatchGeometry or PolygonGeometry3d
def __init__(
self,
geometry: List[Base],
attributes: Optional[Base] = None,
displayValue: Optional[List[Point]] = None,
) -> None:
self.geometry = geometry
self.attributes = attributes or Base()
displayValue = displayValue or []
+7 -57
View File
@@ -1,7 +1,5 @@
from typing import List, Optional, Union
from deprecated import deprecated
from specklepy.objects.base import Base
from specklepy.objects.geometry import (
Arc,
@@ -14,69 +12,23 @@ from specklepy.objects.geometry import (
)
class PolygonGeometry(Base, speckle_type="Objects.GIS.PolygonGeometry"):
class GisPolygonGeometry(
Base, speckle_type="Objects.GIS.PolygonGeometry", detachable={"displayValue"}
):
"""GIS Polygon Geometry"""
boundary: Polyline
voids: List[Polyline]
def __init__(
self,
units: str,
boundary: Polyline,
voids: Optional[List[Polyline]] = None,
) -> None:
super().__init__(units=units)
self.boundary = boundary
self.voids = voids or []
boundary: Optional[Union[Polyline, Arc, Line, Circle, Polycurve]] = None
voids: Optional[List[Union[Polyline, Arc, Line, Circle, Polycurve]]] = None
displayValue: Optional[List[Mesh]] = None
GisPolygonGeometry = PolygonGeometry
class PolygonGeometry3d(
PolygonGeometry,
speckle_type="Objects.GIS.PolygonGeometry3d",
):
"""GIS Polygon3d Geometry"""
def __init__(
self,
units: str,
boundary: Polyline,
voids: Optional[List[Polyline]] = None,
) -> None:
super().__init__(units=units, boundary=boundary, voids=voids)
class GisMultipatchGeometry(
Base,
speckle_type="Objects.GIS.GisMultipatchGeometry",
):
"""GIS Polygon3d Geometry"""
def __init__(
self,
units: str,
faces: List[int],
vertices: List[float],
colors: Optional[List[int]],
) -> None:
super().__init__(units=units)
self.faces = faces
self.vertices = vertices
self.colors = colors or []
@deprecated(version="2.20", reason="Replaced with GisPolygonFeature")
class GisPolygonElement(Base, speckle_type="Objects.GIS.PolygonElement"):
"""GIS Polygon element"""
geometry: Optional[List[PolygonGeometry]] = None
geometry: Optional[List[GisPolygonGeometry]] = None
attributes: Optional[Base] = None
@deprecated(version="2.20", reason="Replaced with GisPolyineFeature")
class GisLineElement(Base, speckle_type="Objects.GIS.LineElement"):
"""GIS Polyline element"""
@@ -84,7 +36,6 @@ class GisLineElement(Base, speckle_type="Objects.GIS.LineElement"):
attributes: Optional[Base] = None
@deprecated(version="2.20", reason="Replaced with GisPointFeature")
class GisPointElement(Base, speckle_type="Objects.GIS.PointElement"):
"""GIS Point element"""
@@ -117,7 +68,6 @@ class GisTopography(
"""GIS Raster element with 3d Topography representation"""
@deprecated(version="2.20", reason="Replaced with GisNonGeometricFeature")
class GisNonGeometryElement(Base, speckle_type="Objects.GIS.NonGeometryElement"):
"""GIS Table feature"""
+3 -19
View File
@@ -295,33 +295,17 @@ class RevitParameter(Base, speckle_type="Objects.BuiltElements.Revit.Parameter")
value: Any = None
applicationUnitType: Optional[str] = None # eg UnitType UT_Length
applicationUnit: Optional[str] = None # DisplayUnitType eg DUT_MILLIMITERS
applicationInternalName: Optional[str] = (
None # BuiltInParameterName or GUID for shared parameter
)
applicationInternalName: Optional[
str
] = None # BuiltInParameterName or GUID for shared parameter
isShared: bool = False
isReadOnly: bool = False
isTypeParameter: bool = False
@deprecated(
version="2.20", reason="Collections namespace changed, collectionType deprecated"
)
class Collection(
Base, speckle_type="Speckle.Core.Models.Collection", detachable={"elements"}
):
name: Optional[str] = None
collectionType: Optional[str] = None
elements: Optional[List[Base]] = None
class Collection( # noqa: F811
Base,
speckle_type="Speckle.Core.Models.Collections.Collection",
detachable={"elements"},
):
name: str
elements: List[Base]
def init(self, name: str, elements: Optional[List[Base]] = None):
self.name = name
self.elements = elements or []