analogcloud-common 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. analogcloud_common-0.1.4/PKG-INFO +71 -0
  2. analogcloud_common-0.1.4/README.md +50 -0
  3. analogcloud_common-0.1.4/pyproject.toml +80 -0
  4. analogcloud_common-0.1.4/src/anabrid/cloud/deploy/__init__.py +0 -0
  5. analogcloud_common-0.1.4/src/anabrid/cloud/deploy/generate.py +503 -0
  6. analogcloud_common-0.1.4/src/anabrid/cloud/deploy/templates/docker-compose.workers-compile-remote.yaml.j2 +30 -0
  7. analogcloud_common-0.1.4/src/anabrid/cloud/deploy/templates/docker-compose.workers.yaml.j2 +66 -0
  8. analogcloud_common-0.1.4/src/anabrid/cloud/deploy/templates/docker-compose.yaml.j2 +111 -0
  9. analogcloud_common-0.1.4/src/anabrid/cloud/devices.py +570 -0
  10. analogcloud_common-0.1.4/src/anabrid/cloud/models/__init__.py +0 -0
  11. analogcloud_common-0.1.4/src/anabrid/cloud/models/api/__init__.py +0 -0
  12. analogcloud_common-0.1.4/src/anabrid/cloud/models/api/v1.py +199 -0
  13. analogcloud_common-0.1.4/src/anabrid/cloud/models/auth.py +35 -0
  14. analogcloud_common-0.1.4/src/anabrid/cloud/models/celery.py +14 -0
  15. analogcloud_common-0.1.4/src/anabrid/cloud/models/config.py +191 -0
  16. analogcloud_common-0.1.4/src/anabrid/cloud/models/db.py +555 -0
  17. analogcloud_common-0.1.4/src/anabrid/cloud/models/enums.py +21 -0
  18. analogcloud_common-0.1.4/src/anabrid/cloud/storage/__init__.py +27 -0
  19. analogcloud_common-0.1.4/src/anabrid/cloud/storage/backend.py +303 -0
  20. analogcloud_common-0.1.4/src/anabrid/cloud/storage/blob_handle.py +55 -0
  21. analogcloud_common-0.1.4/src/anabrid/cloud/storage/log_handle.py +73 -0
  22. analogcloud_common-0.1.4/src/anabrid/cloud/storage/session.py +43 -0
  23. analogcloud_common-0.1.4/src/anabrid/cloud/storage/types.py +65 -0
  24. analogcloud_common-0.1.4/src/anabrid/cloud/util/__init__.py +0 -0
  25. analogcloud_common-0.1.4/src/anabrid/cloud/util/config.py +72 -0
  26. analogcloud_common-0.1.4/tests/__init__.py +1 -0
  27. analogcloud_common-0.1.4/tests/conftest.py +277 -0
  28. analogcloud_common-0.1.4/tests/test_blob_storage.py +261 -0
  29. analogcloud_common-0.1.4/tests/test_deploy_generate.py +1472 -0
  30. analogcloud_common-0.1.4/tests/test_device_manager.py +864 -0
  31. analogcloud_common-0.1.4/tests/test_models.py +1040 -0
  32. analogcloud_common-0.1.4/tests/test_priority.py +91 -0
  33. analogcloud_common-0.1.4/tests/test_storage_backend.py +257 -0
  34. analogcloud_common-0.1.4/tests/test_storage_backend_integration.py +62 -0
  35. analogcloud_common-0.1.4/tests/test_task_create.py +339 -0
  36. analogcloud_common-0.1.4/tests/test_task_delete.py +219 -0
  37. analogcloud_common-0.1.4/tests/test_task_list.py +398 -0
  38. analogcloud_common-0.1.4/tests/test_task_mark_cancelled.py +139 -0
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.1
2
+ Name: analogcloud-common
3
+ Version: 0.1.4
4
+ Summary: Common data models and storage components for Analog Cloud
5
+ Author-Email: Anabrid <info@anabrid.com>
6
+ Requires-Python: <4.0,>=3.11
7
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
8
+ Requires-Dist: celery<6.0.0,>=5.3.0
9
+ Requires-Dist: numpy>=2.4
10
+ Requires-Dist: pybrid-computing>=0.12.6
11
+ Requires-Dist: pybrid-computing-native>=0.12.6
12
+ Requires-Dist: pyredacc>=0.11.7
13
+ Requires-Dist: sympy>=1.13.3
14
+ Requires-Dist: sqlalchemy[asyncio]>=2.0
15
+ Requires-Dist: asyncpg>=0.29
16
+ Requires-Dist: alembic>=1.13
17
+ Requires-Dist: pyyaml>=6.0
18
+ Requires-Dist: jinja2>=3.1
19
+ Requires-Dist: aioboto3>=15.5.0
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Models
23
+
24
+ This component contains data models that are used to communicate between
25
+ at least two different components of the project.
26
+
27
+ This includes the following models:
28
+ - `database`: models/classes for interfacing with hot and cold storage
29
+ - `hot`: use plain Python classes that abstract away the path variables and include static types
30
+ - `cold`: data models in SQL alchemy
31
+
32
+ Note that the `hot` storage essentially caches parts of the data structures
33
+ of the `cold` storage. This should be reflected in the SQL alchemy model:
34
+
35
+ ## Principles
36
+
37
+ - make sure to use object-oriented expressons and techniques, for example
38
+ abstract models and classes which have different implementations to account for versioning.
39
+ - consider the fact that the API itself is mostly consisting of CRUD-type of endpoints
40
+ - for hot storage, favor small field with primitive data types
41
+ - for cold storage, prefer large objects that enable fast data read without too many joins
42
+ when reading/writing through the API endpoints
43
+
44
+ ## Modelled data
45
+
46
+ This is a very rough first draft which does _not_ correspond to an 1:1 ORM:
47
+
48
+ **Cold storage**
49
+ - run
50
+ - id
51
+ - type of job (compile, run, verify...)
52
+ - state changes (array of timestamp/status)
53
+ - logs
54
+ - number of channels
55
+ - measurements (per channel) for run/verify jobs
56
+ - device id
57
+ - input type
58
+ - input (JSON data)
59
+ - output (JSON data)
60
+ - device
61
+ - id
62
+ - type
63
+ - input type
64
+ - parameter schema (as a data type that will simplify the model checking later)
65
+
66
+ **Hot storage**
67
+ - run (by UUID)
68
+ - state changes (array of pairs timestamp/status)
69
+ - logs (array of lines, lines are appended)
70
+ - measurements (on different channels, each channel is a time series of floating point values)
71
+ - list of active devices (device IDs), regularly updated from scanner
@@ -0,0 +1,50 @@
1
+ # Models
2
+
3
+ This component contains data models that are used to communicate between
4
+ at least two different components of the project.
5
+
6
+ This includes the following models:
7
+ - `database`: models/classes for interfacing with hot and cold storage
8
+ - `hot`: use plain Python classes that abstract away the path variables and include static types
9
+ - `cold`: data models in SQL alchemy
10
+
11
+ Note that the `hot` storage essentially caches parts of the data structures
12
+ of the `cold` storage. This should be reflected in the SQL alchemy model:
13
+
14
+ ## Principles
15
+
16
+ - make sure to use object-oriented expressons and techniques, for example
17
+ abstract models and classes which have different implementations to account for versioning.
18
+ - consider the fact that the API itself is mostly consisting of CRUD-type of endpoints
19
+ - for hot storage, favor small field with primitive data types
20
+ - for cold storage, prefer large objects that enable fast data read without too many joins
21
+ when reading/writing through the API endpoints
22
+
23
+ ## Modelled data
24
+
25
+ This is a very rough first draft which does _not_ correspond to an 1:1 ORM:
26
+
27
+ **Cold storage**
28
+ - run
29
+ - id
30
+ - type of job (compile, run, verify...)
31
+ - state changes (array of timestamp/status)
32
+ - logs
33
+ - number of channels
34
+ - measurements (per channel) for run/verify jobs
35
+ - device id
36
+ - input type
37
+ - input (JSON data)
38
+ - output (JSON data)
39
+ - device
40
+ - id
41
+ - type
42
+ - input type
43
+ - parameter schema (as a data type that will simplify the model checking later)
44
+
45
+ **Hot storage**
46
+ - run (by UUID)
47
+ - state changes (array of pairs timestamp/status)
48
+ - logs (array of lines, lines are appended)
49
+ - measurements (on different channels, each channel is a time series of floating point values)
50
+ - list of active devices (device IDs), regularly updated from scanner
@@ -0,0 +1,80 @@
1
+ [build-system]
2
+ requires = [
3
+ "pdm-backend",
4
+ ]
5
+ build-backend = "pdm.backend"
6
+
7
+ [tool.pytest.ini_options]
8
+ asyncio_mode = "auto"
9
+ testpaths = [
10
+ "tests",
11
+ ]
12
+ pythonpath = [
13
+ "src",
14
+ ]
15
+ python_classes = [
16
+ "Test*",
17
+ "!_*",
18
+ ]
19
+ python_functions = [
20
+ "test_*",
21
+ ]
22
+ markers = [
23
+ "integration: cross-process / live-infrastructure tests (require Docker)",
24
+ ]
25
+
26
+ [tool.black]
27
+ line-length = 88
28
+ target-version = [
29
+ "py313",
30
+ ]
31
+
32
+ [tool.ruff]
33
+ line-length = 88
34
+ target-version = "py313"
35
+
36
+ [tool.pdm.build]
37
+ includes = [
38
+ "src/anabrid",
39
+ ]
40
+
41
+ [tool.uv]
42
+ prerelease = "allow"
43
+
44
+ [project]
45
+ authors = [
46
+ { name = "Anabrid", email = "info@anabrid.com" },
47
+ ]
48
+ requires-python = "<4.0,>=3.11"
49
+ dependencies = [
50
+ "pydantic<3.0.0,>=2.0.0",
51
+ "celery<6.0.0,>=5.3.0",
52
+ "numpy>=2.4",
53
+ "pybrid-computing>=0.12.6",
54
+ "pybrid-computing-native>=0.12.6",
55
+ "pyredacc>=0.11.7",
56
+ "sympy>=1.13.3",
57
+ "sqlalchemy[asyncio]>=2.0",
58
+ "asyncpg>=0.29",
59
+ "alembic>=1.13",
60
+ "pyyaml>=6.0",
61
+ "jinja2>=3.1",
62
+ "aioboto3>=15.5.0",
63
+ ]
64
+ name = "analogcloud-common"
65
+ version = "0.1.4"
66
+ description = "Common data models and storage components for Analog Cloud"
67
+ readme = "README.md"
68
+
69
+ [project.scripts]
70
+ analogcloud-deploy = "anabrid.cloud.deploy.generate:main"
71
+
72
+ [dependency-groups]
73
+ dev = [
74
+ "pytest<8.0.0,>=7.0.0",
75
+ "pytest-asyncio<1.0.0,>=0.21.0",
76
+ "black>=24.0.0",
77
+ "ruff<1.0.0,>=0.0.280",
78
+ "psycopg[binary]>=3.1",
79
+ "testcontainers>=4.15.0rc2",
80
+ ]