holado 0.6.2__py3-none-any.whl → 0.6.4__py3-none-any.whl
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.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/__init__.py +2 -2
- holado/common/handlers/object.py +15 -1
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/METADATA +42 -1
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/RECORD +66 -21
- holado_ais/ais/ais_messages.py +3 -1
- holado_docker/tools/docker_controller/server/grpc/docker_controller_client.py → holado_crypto/__init__.py +15 -20
- holado_crypto/crypto/transport/__init__.py +0 -0
- holado_crypto/crypto/transport/crc.py +40 -0
- holado_docker/tools/docker_controller/server/grpc/docker_controller_server.py → holado_crypto/test/behave/steps/__init__.py +2 -17
- holado_docker/sdk/docker/docker_client.py +26 -22
- holado_docker/tools/docker_controller/client/rest/docker_controller_client.py +10 -4
- holado_docker/tools/docker_controller/docker_controller_manager.py +5 -3
- holado_docker/tools/docker_controller/server/Dockerfile +9 -7
- holado_docker/tools/docker_controller/server/requirements.txt +1 -2
- holado_docker/tools/docker_controller/server/rest/README +2 -0
- holado_docker/tools/docker_controller/server/rest/api/__init__.py +16 -17
- holado_docker/tools/docker_controller/server/rest/openapi.yaml +20 -3
- holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh +6 -6
- holado_docker/tools/docker_viewer/client/rest/docker_viewer_client.py +40 -0
- holado_docker/tools/docker_viewer/docker_viewer_manager.py +44 -0
- holado_docker/tools/docker_viewer/server/Dockerfile +70 -0
- holado_docker/tools/docker_viewer/server/requirements.txt +2 -0
- holado_docker/tools/docker_viewer/server/rest/README +2 -0
- holado_docker/tools/docker_viewer/server/rest/api/__init__.py +40 -0
- holado_docker/tools/docker_viewer/server/rest/initialize_holado.py +72 -0
- holado_docker/tools/docker_viewer/server/rest/openapi.yaml +58 -0
- holado_docker/tools/docker_viewer/server/rest/run.py +28 -0
- holado_docker/tools/docker_viewer/server/run_docker_viewer_in_docker.sh +101 -0
- holado_examples/projects/server_rest/server_rest_example/initialize_holado.py +72 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/db.sqlite3 +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/manage.py +22 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/admin.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/apps.py +7 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/migrations/__init__.py +0 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/models.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/serializers.py +15 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/tests.py +3 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/views.py +24 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/asgi.py +16 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/settings.py +130 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/urls.py +31 -0
- holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/wsgi.py +16 -0
- holado_examples/projects/server_rest/server_rest_example/rest_server.py +37 -0
- holado_examples/scripts/script_custom_initialization.py +16 -0
- holado_examples/scripts/script_minimal_initialization.py +23 -0
- holado_examples/tests/behave/testing_solution/__main__.py +13 -0
- holado_examples/tests/behave/testing_solution/behave_environment.py +35 -0
- holado_examples/tests/behave/testing_solution/environment.py +36 -0
- holado_examples/tests/behave/testing_solution/features/Configuration/Actions/configure_system.feature +10 -0
- holado_examples/tests/behave/testing_solution/features/NonReg/example.feature +26 -0
- holado_examples/tests/behave/testing_solution/initialize_holado.py +62 -0
- holado_examples/tests/behave/testing_solution/logging.conf +102 -0
- holado_examples/tests/behave/testing_solution/requirements.txt +5 -0
- holado_examples/tests/behave/testing_solution/run_test.sh +7 -0
- holado_examples/tests/behave/testing_solution/run_test_nonreg.sh +6 -0
- holado_examples/tests/behave/testing_solution/src/common/tools/path_manager.py +40 -0
- holado_examples/tests/behave/testing_solution/src/config/config_manager.py +30 -0
- holado_examples/tests/behave/testing_solution/src/context/session_context.py +45 -0
- holado_examples/tests/behave/testing_solution/steps/config_steps.py +21 -0
- holado_examples/tests/behave/testing_solution/steps/public_steps.py +10 -0
- holado_multitask/multithreading/functionthreaded.py +11 -5
- holado_rest/api/rest/rest_client.py +13 -5
- holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2.py +0 -52
- holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2_grpc.py +0 -233
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/WHEEL +0 -0
- {holado-0.6.2.dist-info → holado-0.6.4.dist-info}/licenses/LICENSE +0 -0
holado/__init__.py
CHANGED
|
@@ -209,8 +209,8 @@ def __import_modules(module_names):
|
|
|
209
209
|
except Exception as exc:
|
|
210
210
|
if Tools.do_log(logger, logging.DEBUG):
|
|
211
211
|
logger.debug(f"Failed to import HolAdo module '{module_name}':\n{Tools.represent_exception(exc)}")
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
if "No module named" not in str(exc):
|
|
213
|
+
logger.warning(f"Failed to import HolAdo module '{module_name}': {str(exc)} (see debug logs for more details)")
|
|
214
214
|
else:
|
|
215
215
|
if Tools.do_log(logger, logging.DEBUG):
|
|
216
216
|
logger.debug(f"Imported HolAdo module '{module_name}'")
|
holado/common/handlers/object.py
CHANGED
|
@@ -62,9 +62,20 @@ class DeleteableObject(Object):
|
|
|
62
62
|
|
|
63
63
|
self.__on_delete_funcs = []
|
|
64
64
|
self.__on_delete_gc_collect = False
|
|
65
|
+
self.__is_deleteable = True
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def _is_deleteable(self):
|
|
69
|
+
return self.__is_deleteable
|
|
70
|
+
|
|
71
|
+
@_is_deleteable.setter
|
|
72
|
+
def _is_deleteable(self, is_deleteable):
|
|
73
|
+
self.__is_deleteable = is_deleteable
|
|
65
74
|
|
|
66
75
|
def __del__(self):
|
|
67
76
|
try:
|
|
77
|
+
if not self._is_deleteable:
|
|
78
|
+
return
|
|
68
79
|
if self.object_state in [ObjectStates.Deleting, ObjectStates.Deleted]:
|
|
69
80
|
return
|
|
70
81
|
|
|
@@ -83,7 +94,8 @@ class DeleteableObject(Object):
|
|
|
83
94
|
self.__delete()
|
|
84
95
|
else:
|
|
85
96
|
from holado_multitask.multithreading.functionthreaded import FunctionThreaded
|
|
86
|
-
func = FunctionThreaded(self.__delete, name=f"delete object '{self.name}'", register_thread=False)
|
|
97
|
+
func = FunctionThreaded(self.__delete, name=f"delete object '{self.name}'", register_thread=False, do_log=False)
|
|
98
|
+
func._is_deleteable = False # Deactivate deletion mechanism of DeleteableObject to avoid an infinite loop
|
|
87
99
|
func.start()
|
|
88
100
|
func.join(timeout=30, raise_if_still_alive=False) # timeout of 30s to limit deadlock impact ; raise to False since exceptions are omitted in gc collect context
|
|
89
101
|
except AttributeError as exc:
|
|
@@ -124,6 +136,8 @@ class DeleteableObject(Object):
|
|
|
124
136
|
from holado_core.common.tools.tools import Tools
|
|
125
137
|
from holado_python.standard_library.typing import Typing
|
|
126
138
|
|
|
139
|
+
if not self._is_deleteable:
|
|
140
|
+
return
|
|
127
141
|
if self.object_state in [ObjectStates.Deleting, ObjectStates.Deleted]:
|
|
128
142
|
return False
|
|
129
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: holado
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: HolAdo framework
|
|
5
5
|
Project-URL: Homepage, https://gitlab.com/holado_framework/python
|
|
6
6
|
Project-URL: Issues, https://gitlab.com/holado_framework/python/-/issues
|
|
@@ -20,6 +20,38 @@ Requires-Dist: psutil
|
|
|
20
20
|
Requires-Dist: python-dateutil
|
|
21
21
|
Provides-Extra: ais
|
|
22
22
|
Requires-Dist: pyais; extra == 'ais'
|
|
23
|
+
Provides-Extra: all
|
|
24
|
+
Requires-Dist: boto3; extra == 'all'
|
|
25
|
+
Requires-Dist: certifi; extra == 'all'
|
|
26
|
+
Requires-Dist: connexion[flask,swagger-ui,uvicorn]; extra == 'all'
|
|
27
|
+
Requires-Dist: docker; extra == 'all'
|
|
28
|
+
Requires-Dist: flask; extra == 'all'
|
|
29
|
+
Requires-Dist: flask-cors; extra == 'all'
|
|
30
|
+
Requires-Dist: google; extra == 'all'
|
|
31
|
+
Requires-Dist: google-api-core; extra == 'all'
|
|
32
|
+
Requires-Dist: grpc-requests; extra == 'all'
|
|
33
|
+
Requires-Dist: grpcio; extra == 'all'
|
|
34
|
+
Requires-Dist: grpcio-reflection; extra == 'all'
|
|
35
|
+
Requires-Dist: grpcio-tools; extra == 'all'
|
|
36
|
+
Requires-Dist: minio; extra == 'all'
|
|
37
|
+
Requires-Dist: moto; extra == 'all'
|
|
38
|
+
Requires-Dist: paramiko<4.0.0; extra == 'all'
|
|
39
|
+
Requires-Dist: pika; extra == 'all'
|
|
40
|
+
Requires-Dist: protobuf; extra == 'all'
|
|
41
|
+
Requires-Dist: psycopg; extra == 'all'
|
|
42
|
+
Requires-Dist: psycopg-binary; extra == 'all'
|
|
43
|
+
Requires-Dist: pyais; extra == 'all'
|
|
44
|
+
Requires-Dist: pympler; extra == 'all'
|
|
45
|
+
Requires-Dist: pyopenssl; extra == 'all'
|
|
46
|
+
Requires-Dist: pypika; extra == 'all'
|
|
47
|
+
Requires-Dist: pysftp; extra == 'all'
|
|
48
|
+
Requires-Dist: pyyaml; extra == 'all'
|
|
49
|
+
Requires-Dist: redis; extra == 'all'
|
|
50
|
+
Requires-Dist: redis-om; extra == 'all'
|
|
51
|
+
Requires-Dist: sftpserver; extra == 'all'
|
|
52
|
+
Requires-Dist: sql-metadata; extra == 'all'
|
|
53
|
+
Requires-Dist: truststore; extra == 'all'
|
|
54
|
+
Requires-Dist: zeep; extra == 'all'
|
|
23
55
|
Provides-Extra: api-connexion
|
|
24
56
|
Requires-Dist: connexion[flask,swagger-ui,uvicorn]; extra == 'api-connexion'
|
|
25
57
|
Provides-Extra: db
|
|
@@ -28,8 +60,13 @@ Requires-Dist: sql-metadata; extra == 'db'
|
|
|
28
60
|
Provides-Extra: db-postgresql
|
|
29
61
|
Requires-Dist: psycopg; extra == 'db-postgresql'
|
|
30
62
|
Requires-Dist: psycopg-binary; extra == 'db-postgresql'
|
|
63
|
+
Requires-Dist: pypika; extra == 'db-postgresql'
|
|
64
|
+
Requires-Dist: sql-metadata; extra == 'db-postgresql'
|
|
31
65
|
Provides-Extra: docker
|
|
32
66
|
Requires-Dist: docker; extra == 'docker'
|
|
67
|
+
Provides-Extra: docker-tools
|
|
68
|
+
Requires-Dist: connexion[flask,swagger-ui,uvicorn]; extra == 'docker-tools'
|
|
69
|
+
Requires-Dist: docker; extra == 'docker-tools'
|
|
33
70
|
Provides-Extra: grpc
|
|
34
71
|
Requires-Dist: google; extra == 'grpc'
|
|
35
72
|
Requires-Dist: google-api-core; extra == 'grpc'
|
|
@@ -56,8 +93,12 @@ Requires-Dist: flask-cors; extra == 's3'
|
|
|
56
93
|
Requires-Dist: minio; extra == 's3'
|
|
57
94
|
Requires-Dist: moto; extra == 's3'
|
|
58
95
|
Provides-Extra: sftp
|
|
96
|
+
Requires-Dist: certifi; extra == 'sftp'
|
|
97
|
+
Requires-Dist: paramiko<4.0.0; extra == 'sftp'
|
|
98
|
+
Requires-Dist: pyopenssl; extra == 'sftp'
|
|
59
99
|
Requires-Dist: pysftp; extra == 'sftp'
|
|
60
100
|
Requires-Dist: sftpserver; extra == 'sftp'
|
|
101
|
+
Requires-Dist: truststore; extra == 'sftp'
|
|
61
102
|
Provides-Extra: ssl
|
|
62
103
|
Requires-Dist: certifi; extra == 'ssl'
|
|
63
104
|
Requires-Dist: pyopenssl; extra == 'ssl'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
holado/__init__.py,sha256=
|
|
1
|
+
holado/__init__.py,sha256=ibxjS0XIck0rguf8FT_3HftofWmJqyfWraxjczMzzrw,14895
|
|
2
2
|
holado/holado_config.py,sha256=-HPwBdEcdG1kLfqSq4bH_esXbndVkNX4WW0VSpqoxu4,2459
|
|
3
3
|
holado/common/__init__.py,sha256=ZjXM-FRQgnfzRNXqcvJOGewDHVRR-U5-ugStSs8U2Xs,1525
|
|
4
4
|
holado/common/context/__init__.py,sha256=3jJBLm8myrYF9jbdV1EhIA6BtnlmjX33eeoDpTzwmLA,1604
|
|
@@ -7,14 +7,14 @@ holado/common/context/service_manager.py,sha256=LaCn8ukE1aqJynmwoexAYj5hCkdb_F3h
|
|
|
7
7
|
holado/common/context/session_context.py,sha256=eIcq3AfS1zQLzd2ud6n2T-p8Z6I-WThCmhFFSb22O70,22770
|
|
8
8
|
holado/common/handlers/__init__.py,sha256=d0KDUpaAAw1eBXyX08gaRh4RECnJlXjYQ0TcU-Ndicc,1372
|
|
9
9
|
holado/common/handlers/enums.py,sha256=ieqKVoukEiNyfE3KrKmMOImdbFS1ocUMud8JHe2xNLs,1662
|
|
10
|
-
holado/common/handlers/object.py,sha256=
|
|
10
|
+
holado/common/handlers/object.py,sha256=rDaav8zHTYfKVEaLtEdeXMxYXATGVcs2a7um1f5MvCs,7205
|
|
11
11
|
holado/common/handlers/undefined.py,sha256=yXZRPIDZI8R0vT4kdf87JPkFhnltLcQwwc3zmKhmv30,2529
|
|
12
12
|
holado/common/tools/__init__.py,sha256=z-T6zX_tOVkJjniTDA0KSKmdtosjfEhjaNa1-3g8wTs,1374
|
|
13
13
|
holado/common/tools/gc_manager.py,sha256=TjQg7MisGRhxuiQ22hB3IuqNhnWCVEWpU253-rOjR0w,7611
|
|
14
14
|
holado_ais/__init__.py,sha256=Mudcgu_7p1hBDBs6LpSz757H4haB0yLHgT70sznG82c,1807
|
|
15
15
|
holado_ais/ais/MaritimeIdentificationDigits.csv,sha256=r-uHt4wOvxlbA26af9e-N3BKbuiMf6ia3PN0ZGfYk2A,8547
|
|
16
16
|
holado_ais/ais/ais_manager.py,sha256=QvN94JoUBbSXT08HABl2FNsAVOM-YCmQO5tN9COg6Rc,6496
|
|
17
|
-
holado_ais/ais/ais_messages.py,sha256
|
|
17
|
+
holado_ais/ais/ais_messages.py,sha256=-kAQCgHwNZpmtMqx4LsGBGuxQTJfj80fUB9U5xxiHNs,15991
|
|
18
18
|
holado_ais/ais/ais_payload.py,sha256=mdOa_4JIbkFLK4_KUmQF5jUt1nLxvZhmIcqK8i-YY6w,1791
|
|
19
19
|
holado_ais/ais/enums.py,sha256=bsqfJVg65fWiJwL_VlSKwKgTY0pLoDcI4T06aEOcQnw,1108
|
|
20
20
|
holado_ais/ais/patch_pyais.py,sha256=M4Fa8GZubXx4auRsk5I1yQPC40IR1p-1iVZIc4PXFfk,49850
|
|
@@ -141,6 +141,10 @@ holado_core/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
141
141
|
holado_core/tools/abstracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
142
142
|
holado_core/tools/abstracts/blocking_command_service.py,sha256=_mJ1DkIRMTKKASq2XCDLWQK3K0fbVAeU0IsMHNs9TdI,2796
|
|
143
143
|
holado_core/tools/abstracts/service.py,sha256=07JkHz5bK2WBpAtiH2YmpZnUZY6roaUbHfD4QJ1spD4,2062
|
|
144
|
+
holado_crypto/__init__.py,sha256=KpbIi2cm1BYZgoWf0LuhE0ei3ZCE15UcUtjC1cSA55M,1653
|
|
145
|
+
holado_crypto/crypto/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
146
|
+
holado_crypto/crypto/transport/crc.py,sha256=byAZlKO-33BPd0cLN4wUJmgqaZWpIlq17rmD8iv9lJU,1700
|
|
147
|
+
holado_crypto/test/behave/steps/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
144
148
|
holado_data/__init__.py,sha256=KpbIi2cm1BYZgoWf0LuhE0ei3ZCE15UcUtjC1cSA55M,1653
|
|
145
149
|
holado_data/data/generator/base.py,sha256=axzEsz0A_6Ty0gnZ-ebFskY40dqEb_hX4D2qjrB6b3o,3764
|
|
146
150
|
holado_data/data/generator/generator_manager.py,sha256=V6Vvj2nGEaGeVWLNFnlR38jqFpoXlabaAWVJA93U_sM,1360
|
|
@@ -185,28 +189,69 @@ holado_django/server/django_projects/rest_api/rest_api/application/migrations/__
|
|
|
185
189
|
holado_django/tests/behave/steps/__init__.py,sha256=1x7ID0w53eDe1P-n4Y5XOnLOTg_bta54gZE2YI0-IHo,1281
|
|
186
190
|
holado_django/tests/behave/steps/django_server_steps.py,sha256=XAnKDUXJxsZ4L7-PYatjevh2BT3qdKIg5sXXG5Y3QFQ,3819
|
|
187
191
|
holado_docker/__init__.py,sha256=CtGYR7aEkaCdAHPDAsu_ErjpVtYE0yz9wbgbfRUwS8s,1574
|
|
188
|
-
holado_docker/sdk/docker/docker_client.py,sha256=
|
|
192
|
+
holado_docker/sdk/docker/docker_client.py,sha256=rh1VLtcefIAZY88FMz7eyh1mFrWn3vVxop6TlC9t2sU,14138
|
|
189
193
|
holado_docker/sdk/docker/docker_service.py,sha256=SvMSIZ7XTCbC7q5rur03lJhJVSHL3uIq1dBQz9oDpkw,3767
|
|
190
194
|
holado_docker/tests/behave/steps/__init__.py,sha256=lrP0btKLA3qQD2wp3zbOp0ug8RmgpaYWCrOAWehcPiI,1298
|
|
191
195
|
holado_docker/tests/behave/steps/tools/docker_controller/client_steps.py,sha256=hgns0Kyl38jJlZsVpMtEWlQKfga815BfJRFS_JhQvWc,4438
|
|
192
|
-
holado_docker/tools/docker_controller/docker_controller_manager.py,sha256=
|
|
193
|
-
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=
|
|
194
|
-
holado_docker/tools/docker_controller/server/Dockerfile,sha256=
|
|
195
|
-
holado_docker/tools/docker_controller/server/requirements.txt,sha256=
|
|
196
|
-
holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh,sha256=
|
|
196
|
+
holado_docker/tools/docker_controller/docker_controller_manager.py,sha256=q3oac2KIK9wGfMQqGIol65nHUmeuuV0rQ61tfH2APAk,2477
|
|
197
|
+
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=SJYonsiyOTdnwg4j-6OjcQTfdu75bm-LFVeQbJMKj_c,2655
|
|
198
|
+
holado_docker/tools/docker_controller/server/Dockerfile,sha256=zuSkj3HYDhvpjOSXmxL4oDqhN7dRB1YTX5Fyur1cuDY,1774
|
|
199
|
+
holado_docker/tools/docker_controller/server/requirements.txt,sha256=0RvLV3t2DyBR2FsbAd1WVEcbsVc6FVUN2horQJU4POo,57
|
|
200
|
+
holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh,sha256=G_4D5iqDCRFNtZVLFJu2urslXxo6cbAi7B2CJ9snotw,3230
|
|
197
201
|
holado_docker/tools/docker_controller/server/grpc/README,sha256=cNOly0Lfsfz_qyhTqLGmELOXzAgZbByNUowuYrUnJa0,132
|
|
198
202
|
holado_docker/tools/docker_controller/server/grpc/__init__.py,sha256=QBkE1ydbCvARUimeSY2PvBkZ-Jp0bCv6k_l89a_8zNw,1551
|
|
199
|
-
holado_docker/tools/docker_controller/server/grpc/docker_controller_client.py,sha256=pVSTohQnm_DnSyKNuZpbOBHQ9NtSwd7t7yn2ZBNB-bU,1702
|
|
200
|
-
holado_docker/tools/docker_controller/server/grpc/docker_controller_server.py,sha256=sCl0dUuatG9R-_EVaZBe6HSe6Ew8TqolfScrwQAn8Zo,1535
|
|
201
203
|
holado_docker/tools/docker_controller/server/grpc/proto/compile_proto.py,sha256=NjcStLaAO_zKcSprrcGscq3R_4anh55QeguXLq6SPjo,2191
|
|
202
204
|
holado_docker/tools/docker_controller/server/grpc/proto/definitions/docker_controler.proto,sha256=n9bsXaQfnZX-R5HvfquCVt3QjpFtDJSH6p8gnTjm06k,1650
|
|
203
|
-
holado_docker/tools/docker_controller/server/
|
|
204
|
-
holado_docker/tools/docker_controller/server/grpc/proto/generated/docker_controler_pb2_grpc.py,sha256=r56UidBcB4jjxGWEsTY08_71Iz0E6pI2b5LR46qvoPc,9295
|
|
205
|
+
holado_docker/tools/docker_controller/server/rest/README,sha256=-uqu3drdPXkPkU4ha1IKcXGBHFIBEWH-uiTT74DExwE,167
|
|
205
206
|
holado_docker/tools/docker_controller/server/rest/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
206
|
-
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=
|
|
207
|
+
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=aUZYaj6y9vBNl_ETkng4afUkcGovni53JsY55t6PUds,4027
|
|
207
208
|
holado_docker/tools/docker_controller/server/rest/run.py,sha256=8w5Xl7uOnjsYW59cmuUMOUd71fcXQn30k2jVis7cVNs,1748
|
|
208
|
-
holado_docker/tools/docker_controller/server/rest/api/__init__.py,sha256=
|
|
209
|
+
holado_docker/tools/docker_controller/server/rest/api/__init__.py,sha256=FlLRagAiw1LDxnF0CmW7Y6bVXuj8x6volT8-DuHTTVY,2427
|
|
209
210
|
holado_docker/tools/docker_controller/server/rest/api/container.py,sha256=Y0iE3AqdJVbFUTcQNK90ymc2gwQeW0P3yBA5-RpMXvQ,2662
|
|
211
|
+
holado_docker/tools/docker_viewer/docker_viewer_manager.py,sha256=tSLuIUdYjJoZIFUc1k4WnrRTUtjjTAmNTbrDmS-8SjI,2287
|
|
212
|
+
holado_docker/tools/docker_viewer/client/rest/docker_viewer_client.py,sha256=XNBt7QE-Elz9wUT32hdft7vU0ytcY8f-0AvlDZ8NWMo,2005
|
|
213
|
+
holado_docker/tools/docker_viewer/server/Dockerfile,sha256=012m7y_jg1Jh0NoqJSUTnmG9OppX2zlcFe-KhB71cVA,1750
|
|
214
|
+
holado_docker/tools/docker_viewer/server/requirements.txt,sha256=0RvLV3t2DyBR2FsbAd1WVEcbsVc6FVUN2horQJU4POo,57
|
|
215
|
+
holado_docker/tools/docker_viewer/server/run_docker_viewer_in_docker.sh,sha256=qwy4JErJvv09qgzp5yjEI4skVTsfQjHeu8NVxZmAKwU,3138
|
|
216
|
+
holado_docker/tools/docker_viewer/server/rest/README,sha256=1FMg-U_D9pUMBVmZJsirOXHFLTciDL5jB-Yqzp9U6uM,163
|
|
217
|
+
holado_docker/tools/docker_viewer/server/rest/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
218
|
+
holado_docker/tools/docker_viewer/server/rest/openapi.yaml,sha256=ZBjVs7Ld1VCdTBk7FgZXEvUACtn6aDdv8cHDE669YZc,1715
|
|
219
|
+
holado_docker/tools/docker_viewer/server/rest/run.py,sha256=8w5Xl7uOnjsYW59cmuUMOUd71fcXQn30k2jVis7cVNs,1748
|
|
220
|
+
holado_docker/tools/docker_viewer/server/rest/api/__init__.py,sha256=FlLRagAiw1LDxnF0CmW7Y6bVXuj8x6volT8-DuHTTVY,2427
|
|
221
|
+
holado_examples/projects/server_rest/server_rest_example/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
222
|
+
holado_examples/projects/server_rest/server_rest_example/rest_server.py,sha256=xMLHBwGBdBvT0DYOpGBuvnSXNjEu3cvU9ty_h187QW4,1887
|
|
223
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/db.sqlite3,sha256=LBFAfNepksCk8npTt9QtnG7CVtDKbZM7kmy13wv1Er0,131072
|
|
224
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/manage.py,sha256=tElgH5cQY8xlY1-mVesjaqsqxe6U3Y--2kXfNIUZ5m0,664
|
|
225
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
226
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/asgi.py,sha256=aTxP-NQKwxMWy9eRFU05I0ZzetU-xjblCtJCrnx5ImM,404
|
|
227
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/settings.py,sha256=9Qqw6yM-6ZwZEuL2J_vVtVzl1weWGC0XWhbhJzyEDNo,3324
|
|
228
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/urls.py,sha256=aIgPAcdW65ExAwZoBTlCCm4idITLRh5b4K2lzg1wIJI,1123
|
|
229
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/wsgi.py,sha256=vuHLvl2v-OGGWQUz0fd6ekLrjRrJsAdnmIBFqZazP7k,404
|
|
230
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
231
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/admin.py,sha256=VWlhkFyPcKZz6ThllvIz1NT1yhDC-eBsdDWtpsuuhO0,65
|
|
232
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/apps.py,sha256=OVtOJmZZ1Ir_Zq1SyGnd9RIhZmwtkZOoiXh4B2ingbs,155
|
|
233
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/models.py,sha256=wzz6N5oF4ngNFMn3G0Bf2ZunnZL0eNuQdopNLnNyyL8,59
|
|
234
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/serializers.py,sha256=o_YxFr-tgCjBp8xAHIdPgPxNah5C7v_W4NpUAc2hdEc,392
|
|
235
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/tests.py,sha256=oGgalLR6qiJdN-bHSH1ZLbRNhJHX_MyZtKsaR4jRy_Q,62
|
|
236
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/views.py,sha256=-0ifZNElxXXH3Ixese-l-Jm8zeYHLmzfSJhr_Dt8ZME,745
|
|
237
|
+
holado_examples/projects/server_rest/server_rest_example/rest_api/rest_api/application/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
238
|
+
holado_examples/scripts/script_custom_initialization.py,sha256=yOWo08UwUqpDS2vjzzYvpmJCq6gSE7_0wybu81u2q1Y,741
|
|
239
|
+
holado_examples/scripts/script_minimal_initialization.py,sha256=4cc3osHekltsJ4ZxmwiqiPYnaGP8tWBaMiz7mHHBiI0,889
|
|
240
|
+
holado_examples/tests/behave/testing_solution/__main__.py,sha256=IS48dqsE3gbHNYGS-1sSIkzfTpefZD58BoNPvQVL57M,299
|
|
241
|
+
holado_examples/tests/behave/testing_solution/behave_environment.py,sha256=-DYfSJkBuB2jOpPmYFtNDW-mnBqXWT8vfi5OE-MON80,1044
|
|
242
|
+
holado_examples/tests/behave/testing_solution/environment.py,sha256=SOKZL-pr1rZTKd77ELDd0lbjUIpogWUsCK8jfN6_RWU,964
|
|
243
|
+
holado_examples/tests/behave/testing_solution/initialize_holado.py,sha256=IPYH-GYNiHV5-7ZCCH6CFmPpmACsPrTV74TYz3MRjpA,3102
|
|
244
|
+
holado_examples/tests/behave/testing_solution/logging.conf,sha256=R0yhuVbgQxl7RLA_SLgXvXaYuEzEGD24w8_tiWeiiR0,2687
|
|
245
|
+
holado_examples/tests/behave/testing_solution/requirements.txt,sha256=GEOHLDGhGbwfMoMt9lfY9iCkSTmby36bko3vqi8KioU,33
|
|
246
|
+
holado_examples/tests/behave/testing_solution/run_test.sh,sha256=I_88YYsuI9jWOvUb0FZP6vedYud-baro1LC_VhVDTGo,115
|
|
247
|
+
holado_examples/tests/behave/testing_solution/run_test_nonreg.sh,sha256=dKnDkFyfzOj9V1A_2-FDEGVCFYPAIdmdxL2C0q9SwgI,167
|
|
248
|
+
holado_examples/tests/behave/testing_solution/features/Configuration/Actions/configure_system.feature,sha256=e8Iy0eGU9f1XrpbKE4NGP_PuL6bsR3U7HikChuGxJiY,219
|
|
249
|
+
holado_examples/tests/behave/testing_solution/features/NonReg/example.feature,sha256=AO_q3ubyC4yXg2ZVEY4mJscVfZhuv2itrbt56a7Xe3o,787
|
|
250
|
+
holado_examples/tests/behave/testing_solution/src/common/tools/path_manager.py,sha256=2-3bJIMXLnSD__0FX_rXWv2YGTrAPdAXoTPxz3qjaNY,1209
|
|
251
|
+
holado_examples/tests/behave/testing_solution/src/config/config_manager.py,sha256=WPSrkLX-C5oJ0bANSwzgBKeeSo38CBrgKGdMOp3pHtI,623
|
|
252
|
+
holado_examples/tests/behave/testing_solution/src/context/session_context.py,sha256=mLLCHRK5qEwASMwX5clj0n3FWJP2XEgFCnDek3xz548,1373
|
|
253
|
+
holado_examples/tests/behave/testing_solution/steps/config_steps.py,sha256=pYEGVok31UmJt6msbNPNhiG0GC5M5kp2ZwHKQdck2gI,514
|
|
254
|
+
holado_examples/tests/behave/testing_solution/steps/public_steps.py,sha256=nnxgBjFMpuQ9xVAAxma0lRwLz8VrbTZuF61vRkKKafA,252
|
|
210
255
|
holado_grpc/TODO,sha256=ESjES2-J6-3AJYdt6olcz_YGt4YTxw80CjIt-tjJ0z4,206
|
|
211
256
|
holado_grpc/__init__.py,sha256=SaAz66iSTqMw7oIDrj94rGcO8W7BgS15B78p--OogHc,2266
|
|
212
257
|
holado_grpc/api/rpc/TODO.txt,sha256=uWZT-WtrGuWbiOVU8-6xNiNyx_kKx-htM691zprLjh0,130
|
|
@@ -265,7 +310,7 @@ holado_multitask/multiprocessing/processesmanager.py,sha256=WCWD-Zo5adBNKz-X34Vh
|
|
|
265
310
|
holado_multitask/multiprocessing/context/process_context.py,sha256=UADxmma8f5tW6etJz7kvrfDdeBOrFxNYCieRev0hFJY,1709
|
|
266
311
|
holado_multitask/multitasking/multitask_manager.py,sha256=lPi4gqK9HNK3FR4Mi-0hDn43PEq7RxXJ4JXKl2Nr_DM,21838
|
|
267
312
|
holado_multitask/multithreading/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
268
|
-
holado_multitask/multithreading/functionthreaded.py,sha256=
|
|
313
|
+
holado_multitask/multithreading/functionthreaded.py,sha256=jtfytI-AtST7Ay8U9ZvsCbWmYSvtZe8u-BvpmqWCO8Y,5848
|
|
269
314
|
holado_multitask/multithreading/loopfunctionthreaded.py,sha256=5kfONDR76uuT1bTJrAtnfSncHwvVvzl8jagWUvTduHw,2492
|
|
270
315
|
holado_multitask/multithreading/loopthread.py,sha256=4II3d22PRf891De8dd9P4WjuwI52KrTDRTSTPzzvso8,4265
|
|
271
316
|
holado_multitask/multithreading/periodicfunctionthreaded.py,sha256=PCBKpbOIThNGLq12rOONAh2ECxEOmaOb6Aqj2Ob2XY8,6926
|
|
@@ -363,7 +408,7 @@ holado_report/report/reports/feature_report.py,sha256=i0wpk3LQLArVjWDsP9UcNSJzAU
|
|
|
363
408
|
holado_report/report/reports/scenario_report.py,sha256=eMyqw9EzaKMmX3pGFJN1rqAOQ5eqO2ISZdxAfK3XQR4,2945
|
|
364
409
|
holado_rest/__init__.py,sha256=BOeE6t6ejeqRYd44SE4vYJVTNz01BwcVCIWfwRQ5axg,1526
|
|
365
410
|
holado_rest/api/rest/TODO.txt,sha256=Oz8BYPkBEs9OAEgyYLLm7i5tJ1bRE5POBpT3SRFWTi4,29
|
|
366
|
-
holado_rest/api/rest/rest_client.py,sha256=
|
|
411
|
+
holado_rest/api/rest/rest_client.py,sha256=rJipR3_I4c90GR38c-gwOE49Iz6QDbf8KbMFUoobKqQ,7024
|
|
367
412
|
holado_rest/api/rest/rest_manager.py,sha256=lo8zUAXsi86Diw5dego-AOn3vUbwKj5xK7i0atIgwlA,4013
|
|
368
413
|
holado_rest/tests/behave/steps/__init__.py,sha256=lEH5NYkKtpgDV2ZAO1qAGNN4ipwILWMpgvQgnamgYKk,1283
|
|
369
414
|
holado_rest/tests/behave/steps/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -605,7 +650,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
|
|
|
605
650
|
test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
606
651
|
test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
|
|
607
652
|
test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
608
|
-
holado-0.6.
|
|
609
|
-
holado-0.6.
|
|
610
|
-
holado-0.6.
|
|
611
|
-
holado-0.6.
|
|
653
|
+
holado-0.6.4.dist-info/METADATA,sha256=toT9iziJs2FKYcZblQEtqqPUtaedZM9FGX83fUHogD8,7885
|
|
654
|
+
holado-0.6.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
655
|
+
holado-0.6.4.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
656
|
+
holado-0.6.4.dist-info/RECORD,,
|
holado_ais/ais/ais_messages.py
CHANGED
|
@@ -40,7 +40,9 @@ except Exception as exc:
|
|
|
40
40
|
if Tools.do_log(logger, logging.DEBUG):
|
|
41
41
|
logger.debug(f"AIS is not available. Initialization failed on error: {exc}")
|
|
42
42
|
with_pyais = False
|
|
43
|
-
|
|
43
|
+
# else:
|
|
44
|
+
# if Tools.do_log(logger, logging.DEBUG):
|
|
45
|
+
# logger.debug(f"AIS is available !")
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
class AISMessages(object):
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
1
2
|
|
|
2
3
|
#################################################
|
|
3
4
|
# HolAdo (Holistic Automation do)
|
|
@@ -11,26 +12,20 @@
|
|
|
11
12
|
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
12
13
|
#################################################
|
|
13
14
|
|
|
14
|
-
import logging
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
def dependencies():
|
|
17
|
+
"""
|
|
18
|
+
Return None or the list of names of modules it depend on
|
|
19
|
+
"""
|
|
20
|
+
return None
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@property
|
|
25
|
-
def internal_client(self):
|
|
26
|
-
return self.__client
|
|
27
|
-
|
|
28
|
-
def start_container(self, name):
|
|
29
|
-
raise NotImplementedError
|
|
30
|
-
|
|
31
|
-
def stop_container(self, name):
|
|
32
|
-
raise NotImplementedError
|
|
33
|
-
|
|
34
|
-
def restart_container(self, name):
|
|
35
|
-
raise NotImplementedError
|
|
22
|
+
def register():
|
|
23
|
+
"""
|
|
24
|
+
Register the services of this module
|
|
25
|
+
"""
|
|
26
|
+
# from holado.common.context.session_context import SessionContext
|
|
36
27
|
|
|
28
|
+
# from holado_xxx.xxx import XXXManager
|
|
29
|
+
# SessionContext.instance().services.register_service_type("xxx_manager", XXXManager)
|
|
30
|
+
pass
|
|
31
|
+
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
import logging
|
|
3
|
+
from holado_core.common.tools.tools import Tools
|
|
4
|
+
|
|
5
|
+
logger = logging.getLogger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Crc(object):
|
|
9
|
+
|
|
10
|
+
@staticmethod
|
|
11
|
+
def crc(msg_bytes, offset, nb_bits, crc_size, polynomial, init_val, xor_val, reverse=False):
|
|
12
|
+
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
13
|
+
logger.trace(f"Computing CRC for:\n {msg_bytes=}\n {offset=}\n {nb_bits=}\n {crc_size=}\n {polynomial=}\n {init_val=}\n {xor_val=}")
|
|
14
|
+
res = init_val
|
|
15
|
+
|
|
16
|
+
# For each data bit in the data, process bits from left to right (or from right to left if reverse=True)
|
|
17
|
+
if reverse:
|
|
18
|
+
bits_range = range(offset+nb_bits-1, offset-1, -1)
|
|
19
|
+
else:
|
|
20
|
+
bits_range = range(offset, offset+nb_bits)
|
|
21
|
+
for i in bits_range:
|
|
22
|
+
bit = (msg_bytes[i // 8] >> (7 - (i % 8))) & 0x1
|
|
23
|
+
out = (res >> (crc_size - 1)) & 0x1
|
|
24
|
+
res = (res << 1) & (0xFFFFFFFF >> (32 - crc_size))
|
|
25
|
+
# Apply polynomial if the bit about to be shifted out of the crc is different than the processed bit
|
|
26
|
+
if bit ^ out == 1:
|
|
27
|
+
res ^= polynomial
|
|
28
|
+
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
29
|
+
logger.trace(f"Computing CRC: {i=}, {bit=} => {res}")
|
|
30
|
+
|
|
31
|
+
res ^= xor_val
|
|
32
|
+
|
|
33
|
+
# Be careful, for a crc-32, we can't make <<32, this should result to <<0
|
|
34
|
+
res &= 0xFFFFFFFF >> (32 - crc_size)
|
|
35
|
+
|
|
36
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
37
|
+
logger.debug(f"CRC for:\n {msg_bytes=}\n {offset=}\n {nb_bits=}\n {crc_size=}\n {polynomial=}\n {init_val=}\n {xor_val=}\n => {res}")
|
|
38
|
+
return res
|
|
39
|
+
|
|
40
|
+
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
1
2
|
|
|
2
3
|
#################################################
|
|
3
4
|
# HolAdo (Holistic Automation do)
|
|
@@ -11,21 +12,5 @@
|
|
|
11
12
|
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
12
13
|
#################################################
|
|
13
14
|
|
|
14
|
-
import logging
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class DockerControllerService(object):
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
class DockerControllerServer(object):
|
|
23
|
-
|
|
24
|
-
def __init__(self):
|
|
25
|
-
|
|
26
|
-
@property
|
|
27
|
-
def internal_client(self):
|
|
28
|
-
return self.__client
|
|
29
|
-
|
|
30
|
-
def start(self):
|
|
31
|
-
raise NotImplementedError
|
|
16
|
+
# from .xxx import *
|
|
@@ -43,10 +43,10 @@ class DockerClient(object):
|
|
|
43
43
|
def client(self):
|
|
44
44
|
return self.__client
|
|
45
45
|
|
|
46
|
-
def has_container(self, name, in_list=True, reset_if_removed=True):
|
|
46
|
+
def has_container(self, name, in_list=True, all_=False, reset_if_removed=True):
|
|
47
47
|
# Note: Even if name exists in __containers, it is possible that the container has been removed
|
|
48
48
|
if in_list:
|
|
49
|
-
c = self.__get_container_from_list(name)
|
|
49
|
+
c = self.__get_container_from_list(name, all_=all_)
|
|
50
50
|
res = c is not None
|
|
51
51
|
|
|
52
52
|
if reset_if_removed and not res and name in self.__containers:
|
|
@@ -60,7 +60,7 @@ class DockerClient(object):
|
|
|
60
60
|
res = False
|
|
61
61
|
return res
|
|
62
62
|
|
|
63
|
-
def get_container(self, name, reset_if_removed=True):
|
|
63
|
+
def get_container(self, name, all_=False, reset_if_removed=True):
|
|
64
64
|
# Reset container if removed
|
|
65
65
|
if reset_if_removed and name in self.__containers:
|
|
66
66
|
if self.__containers[name].status == "removed":
|
|
@@ -68,16 +68,16 @@ class DockerClient(object):
|
|
|
68
68
|
|
|
69
69
|
# Get container from list if needed
|
|
70
70
|
if name not in self.__containers:
|
|
71
|
-
c = self.__get_container_from_list(name)
|
|
71
|
+
c = self.__get_container_from_list(name, all_=all_)
|
|
72
72
|
if c:
|
|
73
73
|
self.__containers[name] = DockerContainer(self, c)
|
|
74
74
|
|
|
75
75
|
return self.__containers.get(name)
|
|
76
76
|
|
|
77
|
-
def update_containers(self, reset_if_removed=True):
|
|
77
|
+
def update_containers(self, all_=False, sparse=False, reset_if_removed=True):
|
|
78
78
|
# Add new containers
|
|
79
79
|
updated_names = set()
|
|
80
|
-
for c in self.__client.containers.list(all=
|
|
80
|
+
for c in self.__client.containers.list(all=all_, sparse=sparse, ignore_removed=True):
|
|
81
81
|
try:
|
|
82
82
|
c_name = c.name
|
|
83
83
|
except docker.errors.NotFound:
|
|
@@ -92,21 +92,24 @@ class DockerClient(object):
|
|
|
92
92
|
for name in set(self.__containers.keys()).difference(updated_names):
|
|
93
93
|
del self.__containers[name]
|
|
94
94
|
|
|
95
|
-
def
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
def get_container_names(self, in_list=True, all_=False, sparse=False):
|
|
96
|
+
if in_list:
|
|
97
|
+
res = []
|
|
98
|
+
for c in self.__client.containers.list(all=all_, sparse=sparse, ignore_removed=True):
|
|
99
|
+
try:
|
|
100
|
+
c_name = c.name
|
|
101
|
+
except docker.errors.NotFound:
|
|
102
|
+
# Container 'c' doesn't exist anymore
|
|
103
|
+
continue
|
|
104
|
+
|
|
105
|
+
res.append(c_name)
|
|
106
|
+
else:
|
|
107
|
+
res = list(self.__containers.keys())
|
|
105
108
|
return res
|
|
106
109
|
|
|
107
|
-
def __get_container_from_list(self, name):
|
|
110
|
+
def __get_container_from_list(self, name, all_=False):
|
|
108
111
|
res = None
|
|
109
|
-
for c in self.__client.containers.list(all=
|
|
112
|
+
for c in self.__client.containers.list(all=all_, ignore_removed=True):
|
|
110
113
|
try:
|
|
111
114
|
c_name = c.name
|
|
112
115
|
except docker.errors.NotFound:
|
|
@@ -205,7 +208,7 @@ class DockerClient(object):
|
|
|
205
208
|
def start_container(self, name, wait_running=True, **kwargs):
|
|
206
209
|
if Tools.do_log(logger, logging.DEBUG):
|
|
207
210
|
logger.debug(f"Starting docker container '{name}' with arguments {kwargs}{', and waiting running status' if wait_running else ''}")
|
|
208
|
-
container = self.get_container(name)
|
|
211
|
+
container = self.get_container(name, all_=True)
|
|
209
212
|
if not container:
|
|
210
213
|
raise FunctionalException("Container of name '{}' doesn't exist")
|
|
211
214
|
|
|
@@ -245,13 +248,14 @@ class DockerClient(object):
|
|
|
245
248
|
def remove_container(self, name):
|
|
246
249
|
if Tools.do_log(logger, logging.DEBUG):
|
|
247
250
|
logger.debug(f"Removing docker container of name '{name}'")
|
|
248
|
-
if not self.has_container(name):
|
|
251
|
+
if not self.has_container(name, in_list=True, all_=True):
|
|
249
252
|
raise FunctionalException(f"Container of name '{name}' doesn't exist")
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
if name in self.__containers:
|
|
255
|
+
del self.__containers[name]
|
|
252
256
|
self.client.api.remove_container(name)
|
|
253
257
|
|
|
254
|
-
if self.has_container(name):
|
|
258
|
+
if self.has_container(name, in_list=True, all_=True):
|
|
255
259
|
raise FunctionalException(f"Failed to remove container of name '{name}'")
|
|
256
260
|
else:
|
|
257
261
|
if Tools.do_log(logger, logging.DEBUG):
|
|
@@ -22,12 +22,18 @@ class DockerControllerClient(RestClient):
|
|
|
22
22
|
def __init__(self, name, url, headers=None):
|
|
23
23
|
super().__init__(name, url, headers)
|
|
24
24
|
|
|
25
|
-
def get_containers_status(self):
|
|
26
|
-
|
|
25
|
+
def get_containers_status(self, all_=False):
|
|
26
|
+
if all_:
|
|
27
|
+
response = self.get("container?all=true")
|
|
28
|
+
else:
|
|
29
|
+
response = self.get("container")
|
|
27
30
|
return self.response_result(response, status_ok=[200,204])
|
|
28
31
|
|
|
29
|
-
def get_container_info(self, name):
|
|
30
|
-
|
|
32
|
+
def get_container_info(self, name, all_=False):
|
|
33
|
+
if all_:
|
|
34
|
+
response = self.get(f"container/{name}?all=true")
|
|
35
|
+
else:
|
|
36
|
+
response = self.get(f"container/{name}")
|
|
31
37
|
return self.response_result(response, status_ok=[200,204])
|
|
32
38
|
|
|
33
39
|
def restart_container(self, name):
|
|
@@ -16,6 +16,7 @@ from holado_core.common.tools.converters.converter import Converter
|
|
|
16
16
|
import os
|
|
17
17
|
from holado_docker.tools.docker_controller.client.rest.docker_controller_client import DockerControllerClient
|
|
18
18
|
from holado_rest.api.rest.rest_manager import RestManager
|
|
19
|
+
from holado.common.handlers.undefined import undefined_argument
|
|
19
20
|
|
|
20
21
|
logger = logging.getLogger(__name__)
|
|
21
22
|
|
|
@@ -23,12 +24,13 @@ logger = logging.getLogger(__name__)
|
|
|
23
24
|
class DockerControllerManager(object):
|
|
24
25
|
|
|
25
26
|
@classmethod
|
|
26
|
-
def new_client(cls, **kwargs):
|
|
27
|
+
def new_client(cls, use_localhost=undefined_argument, **kwargs):
|
|
27
28
|
if 'name' not in kwargs:
|
|
28
29
|
kwargs['name'] = None
|
|
29
30
|
if 'url' not in kwargs:
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
if use_localhost is undefined_argument:
|
|
32
|
+
env_use = os.getenv("HOLADO_USE_LOCALHOST", False)
|
|
33
|
+
use_localhost = Converter.is_boolean(env_use) and Converter.to_boolean(env_use)
|
|
32
34
|
|
|
33
35
|
host = "localhost" if use_localhost else os.getenv("HOLADO_DOCKER_CONTROLLER_NAME", "holado_docker_controller")
|
|
34
36
|
port = os.getenv("HOLADO_DOCKER_CONTROLLER_PORT", 8000)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
### Build
|
|
2
2
|
|
|
3
|
-
FROM python:3.12.9-alpine3.21 AS build
|
|
3
|
+
#FROM python:3.12.9-alpine3.21 AS build
|
|
4
|
+
FROM python:3.12.11-alpine3.22 AS build
|
|
4
5
|
|
|
5
6
|
# Install to build python requirements
|
|
6
7
|
RUN apk update \
|
|
@@ -27,8 +28,8 @@ RUN mkdir /code \
|
|
|
27
28
|
USER appuser
|
|
28
29
|
|
|
29
30
|
# Create python venv and install requirements
|
|
30
|
-
COPY --chown=appuser ./requirements.txt /code/
|
|
31
|
-
WORKDIR /code/
|
|
31
|
+
COPY --chown=appuser ./requirements.txt /code/docker_controller/requirements.txt
|
|
32
|
+
WORKDIR /code/docker_controller
|
|
32
33
|
RUN python -m venv /code/env \
|
|
33
34
|
&& source /code/env/bin/activate \
|
|
34
35
|
&& pip install -r requirements.txt
|
|
@@ -37,7 +38,8 @@ RUN python -m venv /code/env \
|
|
|
37
38
|
|
|
38
39
|
### Runtime
|
|
39
40
|
|
|
40
|
-
FROM python:3.12.9-alpine3.21 AS runtime
|
|
41
|
+
#FROM python:3.12.9-alpine3.21 AS runtime
|
|
42
|
+
FROM python:3.12.11-alpine3.22 AS runtime
|
|
41
43
|
|
|
42
44
|
# Install for python requirements
|
|
43
45
|
#RUN apk update \
|
|
@@ -57,12 +59,12 @@ USER appuser
|
|
|
57
59
|
# Copy /code from build
|
|
58
60
|
COPY --chown=appuser --from=build /code /code
|
|
59
61
|
|
|
60
|
-
# Copy docker
|
|
61
|
-
COPY --chown=appuser ./rest /code/
|
|
62
|
+
# Copy docker controller sources
|
|
63
|
+
COPY --chown=appuser ./rest /code/docker_controller
|
|
62
64
|
|
|
63
65
|
# Activate permanently python venv
|
|
64
66
|
ENV PATH=/code/env/bin:$PATH
|
|
65
67
|
|
|
66
|
-
WORKDIR /code/
|
|
68
|
+
WORKDIR /code/docker_controller
|
|
67
69
|
CMD ["sh", "-c", "uvicorn run:app --host 0.0.0.0 --port $HOLADO_DOCKER_CONTROLLER_PORT"]
|
|
68
70
|
|