infrahub-server 1.3.7__py3-none-any.whl → 1.4.0__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.
- infrahub/api/internal.py +5 -0
- infrahub/artifacts/tasks.py +17 -22
- infrahub/branch/merge_mutation_checker.py +38 -0
- infrahub/cli/__init__.py +2 -2
- infrahub/cli/context.py +7 -3
- infrahub/cli/db.py +5 -16
- infrahub/cli/upgrade.py +10 -29
- infrahub/computed_attribute/tasks.py +36 -46
- infrahub/config.py +57 -6
- infrahub/constants/environment.py +1 -0
- infrahub/core/attribute.py +15 -7
- infrahub/core/branch/tasks.py +43 -41
- infrahub/core/constants/__init__.py +21 -6
- infrahub/core/constants/infrahubkind.py +2 -0
- infrahub/core/diff/coordinator.py +3 -1
- infrahub/core/diff/model/path.py +0 -39
- infrahub/core/diff/repository/repository.py +0 -8
- infrahub/core/diff/tasks.py +11 -8
- infrahub/core/graph/__init__.py +1 -1
- infrahub/core/graph/index.py +1 -2
- infrahub/core/graph/schema.py +50 -29
- infrahub/core/initialization.py +81 -47
- infrahub/core/ipam/tasks.py +4 -3
- infrahub/core/merge.py +8 -10
- infrahub/core/migrations/__init__.py +2 -0
- infrahub/core/migrations/graph/__init__.py +4 -0
- infrahub/core/migrations/graph/m036_drop_attr_value_index.py +45 -0
- infrahub/core/migrations/graph/m037_index_attr_vals.py +577 -0
- infrahub/core/migrations/query/attribute_add.py +27 -2
- infrahub/core/migrations/schema/attribute_kind_update.py +156 -0
- infrahub/core/migrations/schema/tasks.py +6 -5
- infrahub/core/models.py +5 -1
- infrahub/core/node/proposed_change.py +43 -0
- infrahub/core/protocols.py +12 -0
- infrahub/core/query/attribute.py +32 -14
- infrahub/core/query/diff.py +11 -0
- infrahub/core/query/ipam.py +13 -7
- infrahub/core/query/node.py +51 -10
- infrahub/core/query/resource_manager.py +3 -3
- infrahub/core/schema/basenode_schema.py +8 -0
- infrahub/core/schema/definitions/core/__init__.py +10 -1
- infrahub/core/schema/definitions/core/ipam.py +28 -2
- infrahub/core/schema/definitions/core/propose_change.py +15 -0
- infrahub/core/schema/definitions/core/webhook.py +3 -0
- infrahub/core/schema/definitions/internal.py +1 -1
- infrahub/core/schema/generated/attribute_schema.py +1 -1
- infrahub/core/schema/generic_schema.py +10 -0
- infrahub/core/schema/manager.py +10 -1
- infrahub/core/schema/node_schema.py +22 -22
- infrahub/core/schema/profile_schema.py +8 -0
- infrahub/core/schema/schema_branch.py +11 -7
- infrahub/core/schema/template_schema.py +8 -0
- infrahub/core/validators/attribute/kind.py +5 -1
- infrahub/core/validators/checks_runner.py +5 -5
- infrahub/core/validators/determiner.py +22 -2
- infrahub/core/validators/tasks.py +6 -7
- infrahub/core/validators/uniqueness/checker.py +4 -2
- infrahub/core/validators/uniqueness/model.py +1 -0
- infrahub/core/validators/uniqueness/query.py +57 -7
- infrahub/database/__init__.py +2 -1
- infrahub/events/__init__.py +20 -0
- infrahub/events/constants.py +7 -0
- infrahub/events/generator.py +29 -2
- infrahub/events/proposed_change_action.py +203 -0
- infrahub/generators/tasks.py +24 -20
- infrahub/git/base.py +4 -7
- infrahub/git/integrator.py +21 -12
- infrahub/git/repository.py +15 -30
- infrahub/git/tasks.py +121 -106
- infrahub/graphql/app.py +2 -1
- infrahub/graphql/field_extractor.py +69 -0
- infrahub/graphql/manager.py +15 -11
- infrahub/graphql/mutations/account.py +2 -2
- infrahub/graphql/mutations/action.py +8 -2
- infrahub/graphql/mutations/artifact_definition.py +4 -1
- infrahub/graphql/mutations/branch.py +10 -5
- infrahub/graphql/mutations/graphql_query.py +2 -1
- infrahub/graphql/mutations/main.py +14 -8
- infrahub/graphql/mutations/menu.py +2 -1
- infrahub/graphql/mutations/proposed_change.py +230 -8
- infrahub/graphql/mutations/relationship.py +5 -0
- infrahub/graphql/mutations/repository.py +2 -1
- infrahub/graphql/mutations/tasks.py +7 -9
- infrahub/graphql/mutations/webhook.py +4 -1
- infrahub/graphql/parser.py +15 -6
- infrahub/graphql/queries/__init__.py +10 -1
- infrahub/graphql/queries/account.py +3 -3
- infrahub/graphql/queries/branch.py +2 -2
- infrahub/graphql/queries/diff/tree.py +56 -5
- infrahub/graphql/queries/event.py +13 -3
- infrahub/graphql/queries/ipam.py +23 -1
- infrahub/graphql/queries/proposed_change.py +84 -0
- infrahub/graphql/queries/relationship.py +2 -2
- infrahub/graphql/queries/resource_manager.py +3 -3
- infrahub/graphql/queries/search.py +3 -2
- infrahub/graphql/queries/status.py +3 -2
- infrahub/graphql/queries/task.py +2 -2
- infrahub/graphql/resolvers/ipam.py +440 -0
- infrahub/graphql/resolvers/many_relationship.py +4 -3
- infrahub/graphql/resolvers/resolver.py +5 -5
- infrahub/graphql/resolvers/single_relationship.py +3 -2
- infrahub/graphql/schema.py +25 -5
- infrahub/graphql/types/__init__.py +2 -2
- infrahub/graphql/types/attribute.py +3 -3
- infrahub/graphql/types/event.py +68 -0
- infrahub/groups/tasks.py +6 -6
- infrahub/lock.py +3 -2
- infrahub/menu/generator.py +8 -0
- infrahub/message_bus/operations/__init__.py +9 -12
- infrahub/message_bus/operations/git/file.py +6 -5
- infrahub/message_bus/operations/git/repository.py +12 -20
- infrahub/message_bus/operations/refresh/registry.py +15 -9
- infrahub/message_bus/operations/send/echo.py +7 -4
- infrahub/message_bus/types.py +1 -0
- infrahub/permissions/__init__.py +2 -1
- infrahub/permissions/constants.py +13 -0
- infrahub/permissions/globals.py +31 -2
- infrahub/permissions/manager.py +8 -5
- infrahub/pools/prefix.py +7 -5
- infrahub/prefect_server/app.py +31 -0
- infrahub/prefect_server/bootstrap.py +18 -0
- infrahub/proposed_change/action_checker.py +206 -0
- infrahub/proposed_change/approval_revoker.py +40 -0
- infrahub/proposed_change/branch_diff.py +3 -1
- infrahub/proposed_change/checker.py +45 -0
- infrahub/proposed_change/constants.py +32 -2
- infrahub/proposed_change/tasks.py +182 -150
- infrahub/py.typed +0 -0
- infrahub/server.py +29 -17
- infrahub/services/__init__.py +13 -28
- infrahub/services/adapters/cache/__init__.py +4 -0
- infrahub/services/adapters/cache/nats.py +2 -0
- infrahub/services/adapters/cache/redis.py +3 -0
- infrahub/services/adapters/message_bus/__init__.py +0 -2
- infrahub/services/adapters/message_bus/local.py +1 -2
- infrahub/services/adapters/message_bus/nats.py +6 -8
- infrahub/services/adapters/message_bus/rabbitmq.py +7 -9
- infrahub/services/adapters/workflow/__init__.py +1 -0
- infrahub/services/adapters/workflow/local.py +1 -8
- infrahub/services/component.py +2 -1
- infrahub/task_manager/event.py +56 -0
- infrahub/task_manager/models.py +9 -0
- infrahub/tasks/artifact.py +6 -7
- infrahub/tasks/check.py +4 -7
- infrahub/telemetry/tasks.py +15 -18
- infrahub/transformations/tasks.py +10 -6
- infrahub/trigger/tasks.py +4 -3
- infrahub/types.py +4 -0
- infrahub/validators/events.py +7 -7
- infrahub/validators/tasks.py +6 -7
- infrahub/webhook/models.py +45 -45
- infrahub/webhook/tasks.py +25 -24
- infrahub/workers/dependencies.py +143 -0
- infrahub/workers/infrahub_async.py +19 -43
- infrahub/workflows/catalogue.py +16 -2
- infrahub/workflows/initialization.py +5 -4
- infrahub/workflows/models.py +2 -0
- infrahub_sdk/client.py +2 -2
- infrahub_sdk/ctl/repository.py +51 -0
- infrahub_sdk/ctl/schema.py +9 -9
- infrahub_sdk/node/node.py +2 -2
- infrahub_sdk/pytest_plugin/items/graphql_query.py +1 -1
- infrahub_sdk/schema/repository.py +1 -1
- infrahub_sdk/testing/docker.py +1 -1
- infrahub_sdk/utils.py +2 -2
- {infrahub_server-1.3.7.dist-info → infrahub_server-1.4.0.dist-info}/METADATA +7 -5
- {infrahub_server-1.3.7.dist-info → infrahub_server-1.4.0.dist-info}/RECORD +174 -158
- infrahub_testcontainers/container.py +17 -0
- infrahub_testcontainers/docker-compose-cluster.test.yml +56 -1
- infrahub_testcontainers/docker-compose.test.yml +56 -1
- infrahub_testcontainers/helpers.py +4 -1
- {infrahub_server-1.3.7.dist-info → infrahub_server-1.4.0.dist-info}/LICENSE.txt +0 -0
- {infrahub_server-1.3.7.dist-info → infrahub_server-1.4.0.dist-info}/WHEEL +0 -0
- {infrahub_server-1.3.7.dist-info → infrahub_server-1.4.0.dist-info}/entry_points.txt +0 -0
|
@@ -59,6 +59,8 @@ PROJECT_ENV_VARIABLES: dict[str, str] = {
|
|
|
59
59
|
"INFRAHUB_TESTING_PREFECT_UI_ENABLED": "true",
|
|
60
60
|
"INFRAHUB_TESTING_DOCKER_PULL": "true",
|
|
61
61
|
"INFRAHUB_TESTING_SCHEMA_STRICT_MODE": "true",
|
|
62
|
+
"INFRAHUB_TESTING_TASKMGR_API_WORKERS": "1",
|
|
63
|
+
"INFRAHUB_TESTING_TASKMGR_BACKGROUND_SVC_REPLICAS": "0",
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
|
|
@@ -144,6 +146,21 @@ class InfrahubDockerCompose(DockerCompose):
|
|
|
144
146
|
"NEO4J_DOCKER_IMAGE": "neo4j:2025.03.0-enterprise",
|
|
145
147
|
}
|
|
146
148
|
)
|
|
149
|
+
if os.environ.get("INFRAHUB_TESTING_TASKMGR_SCALEOUT"):
|
|
150
|
+
PROJECT_ENV_VARIABLES.update(
|
|
151
|
+
{
|
|
152
|
+
"INFRAHUB_TESTING_TASKMGR_BACKGROUND_SVC_REPLICAS": "1",
|
|
153
|
+
"PREFECT_MESSAGING_BROKER": "prefect_redis.messaging",
|
|
154
|
+
"PREFECT_MESSAGING_CACHE": "prefect_redis.messaging",
|
|
155
|
+
"PREFECT__SERVER_WEBSERVER_ONLY": "true",
|
|
156
|
+
"PREFECT_API_DATABASE_MIGRATE_ON_START": "false",
|
|
157
|
+
"PREFECT_API_BLOCKS_REGISTER_ON_START": "false",
|
|
158
|
+
"PREFECT_SERVER_SERVICES_EVENT_LOGGER_ENABLED": "false",
|
|
159
|
+
"PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED": "false",
|
|
160
|
+
"PREFECT_SERVER_SERVICES_TRIGGERS_ENABLED": "false",
|
|
161
|
+
"PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_ENABLED": "false",
|
|
162
|
+
}
|
|
163
|
+
)
|
|
147
164
|
|
|
148
165
|
with env_file.open(mode="w", encoding="utf-8") as file:
|
|
149
166
|
for key, value in PROJECT_ENV_VARIABLES.items():
|
|
@@ -166,13 +166,33 @@ services:
|
|
|
166
166
|
|
|
167
167
|
task-manager:
|
|
168
168
|
image: "${INFRAHUB_TESTING_DOCKER_IMAGE}:${INFRAHUB_TESTING_IMAGE_VERSION}"
|
|
169
|
-
command: uvicorn
|
|
169
|
+
command: "${PREFECT_SERVER_COMMAND:-gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:4200 'infrahub.prefect_server.app:create_infrahub_prefect()'}"
|
|
170
170
|
depends_on:
|
|
171
171
|
task-manager-db:
|
|
172
172
|
condition: service_healthy
|
|
173
|
+
cache:
|
|
174
|
+
condition: service_healthy
|
|
173
175
|
environment:
|
|
174
176
|
PREFECT_UI_ENABLED: "${INFRAHUB_TESTING_PREFECT_UI_ENABLED}" # enabling UI requires permissions, run container as root to enable UI
|
|
175
177
|
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:postgres@task-manager-db:5432/prefect
|
|
178
|
+
|
|
179
|
+
INFRAHUB_CACHE_ADDRESS: ${INFRAHUB_TESTING_CACHE_ADDRESS}
|
|
180
|
+
PREFECT_REDIS_MESSAGING_HOST: "${INFRAHUB_TESTING_CACHE_ADDRESS:-cache}"
|
|
181
|
+
PREFECT_REDIS_MESSAGING_DB: "1"
|
|
182
|
+
PREFECT_REDIS_MESSAGING_CONSUMER_MIN_IDLE_TIME: "30"
|
|
183
|
+
PREFECT_REDIS_MESSAGING_PUBLISHER_BATCH_SIZE: "1"
|
|
184
|
+
|
|
185
|
+
PREFECT_MESSAGING_BROKER:
|
|
186
|
+
PREFECT_MESSAGING_CACHE:
|
|
187
|
+
PREFECT__SERVER_WEBSERVER_ONLY:
|
|
188
|
+
PREFECT_API_DATABASE_MIGRATE_ON_START:
|
|
189
|
+
PREFECT_API_BLOCKS_REGISTER_ON_START:
|
|
190
|
+
PREFECT_SERVER_SERVICES_EVENT_LOGGER_ENABLED:
|
|
191
|
+
PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED:
|
|
192
|
+
PREFECT_SERVER_SERVICES_TRIGGERS_ENABLED:
|
|
193
|
+
PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_ENABLED:
|
|
194
|
+
|
|
195
|
+
WEB_CONCURRENCY: ${INFRAHUB_TESTING_TASKMGR_API_WORKERS:-1}
|
|
176
196
|
healthcheck:
|
|
177
197
|
test: /usr/local/bin/httpx http://localhost:4200/api/health || exit 1
|
|
178
198
|
interval: 5s
|
|
@@ -182,8 +202,42 @@ services:
|
|
|
182
202
|
ports:
|
|
183
203
|
- ${INFRAHUB_TESTING_TASK_MANAGER_PORT:-0}:4200
|
|
184
204
|
|
|
205
|
+
task-manager-background-svc:
|
|
206
|
+
deploy:
|
|
207
|
+
mode: replicated
|
|
208
|
+
replicas: ${INFRAHUB_TESTING_TASKMGR_BACKGROUND_SVC_REPLICAS:-0}
|
|
209
|
+
image: "${INFRAHUB_TESTING_DOCKER_IMAGE}:${INFRAHUB_TESTING_IMAGE_VERSION}"
|
|
210
|
+
command: prefect server services start
|
|
211
|
+
restart: unless-stopped
|
|
212
|
+
depends_on:
|
|
213
|
+
task-manager:
|
|
214
|
+
condition: service_healthy
|
|
215
|
+
task-manager-db:
|
|
216
|
+
condition: service_healthy
|
|
217
|
+
cache:
|
|
218
|
+
condition: service_healthy
|
|
219
|
+
environment:
|
|
220
|
+
PREFECT_UI_ENABLED: "${INFRAHUB_TESTING_PREFECT_UI_ENABLED}" # This might be required because triggers actions service depends on an in-memory API server
|
|
221
|
+
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:postgres@task-manager-db:5432/prefect
|
|
222
|
+
|
|
223
|
+
PREFECT_API_DATABASE_MIGRATE_ON_START: "false"
|
|
224
|
+
PREFECT_API_BLOCKS_REGISTER_ON_START: "false"
|
|
225
|
+
INFRAHUB_CACHE_ADDRESS: ${INFRAHUB_TESTING_CACHE_ADDRESS}
|
|
226
|
+
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
|
|
227
|
+
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
|
|
228
|
+
PREFECT_REDIS_MESSAGING_HOST: "${INFRAHUB_TESTING_CACHE_ADDRESS:-cache}"
|
|
229
|
+
PREFECT_REDIS_MESSAGING_DB: "1"
|
|
230
|
+
PREFECT_REDIS_MESSAGING_CONSUMER_MIN_IDLE_TIME: "30"
|
|
231
|
+
PREFECT_REDIS_MESSAGING_PUBLISHER_BATCH_SIZE: "1"
|
|
232
|
+
|
|
233
|
+
PREFECT_SERVER_SERVICES_EVENT_LOGGER_ENABLED: "true"
|
|
234
|
+
PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED: "true"
|
|
235
|
+
PREFECT_SERVER_SERVICES_TRIGGERS_ENABLED: "true"
|
|
236
|
+
PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_ENABLED: "true"
|
|
237
|
+
|
|
185
238
|
task-manager-db:
|
|
186
239
|
image: "${POSTGRES_DOCKER_IMAGE:-postgres:16-alpine}"
|
|
240
|
+
command: postgres -c 'max_connections=${INFRAHUB_TESTING_TASK_MANAGER_DB_MAX_CONNECTIONS:-100}'
|
|
187
241
|
environment:
|
|
188
242
|
- POSTGRES_USER=postgres
|
|
189
243
|
- POSTGRES_PASSWORD=postgres
|
|
@@ -265,6 +319,7 @@ services:
|
|
|
265
319
|
INFRAHUB_DB_PROTOCOL: ${INFRAHUB_TESTING_DB_PROTOCOL:-neo4j}
|
|
266
320
|
INFRAHUB_WORKFLOW_ADDRESS: ${INFRAHUB_TESTING_WORKFLOW_ADDRESS}
|
|
267
321
|
INFRAHUB_TIMEOUT: ${INFRAHUB_TESTING_TIMEOUT}
|
|
322
|
+
INFRAHUB_PAGINATION_SIZE: ${INFRAHUB_TESTING_PAGINATION_SIZE:-50}
|
|
268
323
|
PREFECT_API_URL: ${INFRAHUB_TESTING_PREFECT_API}
|
|
269
324
|
# Tracing
|
|
270
325
|
INFRAHUB_TRACE_ENABLE: ${INFRAHUB_TRACE_ENABLE:-false}
|
|
@@ -77,13 +77,33 @@ services:
|
|
|
77
77
|
|
|
78
78
|
task-manager:
|
|
79
79
|
image: "${INFRAHUB_TESTING_DOCKER_IMAGE}:${INFRAHUB_TESTING_IMAGE_VERSION}"
|
|
80
|
-
command: uvicorn
|
|
80
|
+
command: "${PREFECT_SERVER_COMMAND:-gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:4200 'infrahub.prefect_server.app:create_infrahub_prefect()'}"
|
|
81
81
|
depends_on:
|
|
82
82
|
task-manager-db:
|
|
83
83
|
condition: service_healthy
|
|
84
|
+
cache:
|
|
85
|
+
condition: service_healthy
|
|
84
86
|
environment:
|
|
85
87
|
PREFECT_UI_ENABLED: "${INFRAHUB_TESTING_PREFECT_UI_ENABLED}" # enabling UI requires permissions, run container as root to enable UI
|
|
86
88
|
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:postgres@task-manager-db:5432/prefect
|
|
89
|
+
|
|
90
|
+
INFRAHUB_CACHE_ADDRESS: ${INFRAHUB_TESTING_CACHE_ADDRESS}
|
|
91
|
+
PREFECT_REDIS_MESSAGING_HOST: "${INFRAHUB_TESTING_CACHE_ADDRESS:-cache}"
|
|
92
|
+
PREFECT_REDIS_MESSAGING_DB: "1"
|
|
93
|
+
PREFECT_REDIS_MESSAGING_CONSUMER_MIN_IDLE_TIME: "30"
|
|
94
|
+
PREFECT_REDIS_MESSAGING_PUBLISHER_BATCH_SIZE: "1"
|
|
95
|
+
|
|
96
|
+
PREFECT_MESSAGING_BROKER:
|
|
97
|
+
PREFECT_MESSAGING_CACHE:
|
|
98
|
+
PREFECT__SERVER_WEBSERVER_ONLY:
|
|
99
|
+
PREFECT_API_DATABASE_MIGRATE_ON_START:
|
|
100
|
+
PREFECT_API_BLOCKS_REGISTER_ON_START:
|
|
101
|
+
PREFECT_SERVER_SERVICES_EVENT_LOGGER_ENABLED:
|
|
102
|
+
PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED:
|
|
103
|
+
PREFECT_SERVER_SERVICES_TRIGGERS_ENABLED:
|
|
104
|
+
PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_ENABLED:
|
|
105
|
+
|
|
106
|
+
WEB_CONCURRENCY: ${INFRAHUB_TESTING_TASKMGR_API_WORKERS:-1}
|
|
87
107
|
healthcheck:
|
|
88
108
|
test: /usr/local/bin/httpx http://localhost:4200/api/health || exit 1
|
|
89
109
|
interval: 5s
|
|
@@ -93,8 +113,42 @@ services:
|
|
|
93
113
|
ports:
|
|
94
114
|
- ${INFRAHUB_TESTING_TASK_MANAGER_PORT:-0}:4200
|
|
95
115
|
|
|
116
|
+
task-manager-background-svc:
|
|
117
|
+
deploy:
|
|
118
|
+
mode: replicated
|
|
119
|
+
replicas: ${INFRAHUB_TESTING_TASKMGR_BACKGROUND_SVC_REPLICAS:-0}
|
|
120
|
+
image: "${INFRAHUB_TESTING_DOCKER_IMAGE}:${INFRAHUB_TESTING_IMAGE_VERSION}"
|
|
121
|
+
command: prefect server services start
|
|
122
|
+
restart: unless-stopped
|
|
123
|
+
depends_on:
|
|
124
|
+
task-manager:
|
|
125
|
+
condition: service_healthy
|
|
126
|
+
task-manager-db:
|
|
127
|
+
condition: service_healthy
|
|
128
|
+
cache:
|
|
129
|
+
condition: service_healthy
|
|
130
|
+
environment:
|
|
131
|
+
PREFECT_UI_ENABLED: "${INFRAHUB_TESTING_PREFECT_UI_ENABLED}" # This might be required because triggers actions service depends on an in-memory API server
|
|
132
|
+
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://postgres:postgres@task-manager-db:5432/prefect
|
|
133
|
+
|
|
134
|
+
PREFECT_API_DATABASE_MIGRATE_ON_START: "false"
|
|
135
|
+
PREFECT_API_BLOCKS_REGISTER_ON_START: "false"
|
|
136
|
+
INFRAHUB_CACHE_ADDRESS: ${INFRAHUB_TESTING_CACHE_ADDRESS}
|
|
137
|
+
PREFECT_MESSAGING_BROKER: prefect_redis.messaging
|
|
138
|
+
PREFECT_MESSAGING_CACHE: prefect_redis.messaging
|
|
139
|
+
PREFECT_REDIS_MESSAGING_HOST: "${INFRAHUB_TESTING_CACHE_ADDRESS:-cache}"
|
|
140
|
+
PREFECT_REDIS_MESSAGING_DB: "1"
|
|
141
|
+
PREFECT_REDIS_MESSAGING_CONSUMER_MIN_IDLE_TIME: "30"
|
|
142
|
+
PREFECT_REDIS_MESSAGING_PUBLISHER_BATCH_SIZE: "1"
|
|
143
|
+
|
|
144
|
+
PREFECT_SERVER_SERVICES_EVENT_LOGGER_ENABLED: "true"
|
|
145
|
+
PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED: "true"
|
|
146
|
+
PREFECT_SERVER_SERVICES_TRIGGERS_ENABLED: "true"
|
|
147
|
+
PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_ENABLED: "true"
|
|
148
|
+
|
|
96
149
|
task-manager-db:
|
|
97
150
|
image: "${POSTGRES_DOCKER_IMAGE:-postgres:16-alpine}"
|
|
151
|
+
command: postgres -c 'max_connections=${INFRAHUB_TESTING_TASK_MANAGER_DB_MAX_CONNECTIONS:-100}'
|
|
98
152
|
environment:
|
|
99
153
|
- POSTGRES_USER=postgres
|
|
100
154
|
- POSTGRES_PASSWORD=postgres
|
|
@@ -172,6 +226,7 @@ services:
|
|
|
172
226
|
INFRAHUB_DB_ADDRESS: ${INFRAHUB_TESTING_DB_ADDRESS:-database}
|
|
173
227
|
INFRAHUB_WORKFLOW_ADDRESS: ${INFRAHUB_TESTING_WORKFLOW_ADDRESS}
|
|
174
228
|
INFRAHUB_TIMEOUT: ${INFRAHUB_TESTING_TIMEOUT}
|
|
229
|
+
INFRAHUB_PAGINATION_SIZE: ${INFRAHUB_TESTING_PAGINATION_SIZE:-50}
|
|
175
230
|
PREFECT_API_URL: ${INFRAHUB_TESTING_PREFECT_API}
|
|
176
231
|
INFRAHUB_EXPERIMENTAL_VALUE_DB_INDEX:
|
|
177
232
|
# Tracing
|
|
@@ -29,11 +29,14 @@ class TestInfrahubDocker:
|
|
|
29
29
|
return result.stdout
|
|
30
30
|
|
|
31
31
|
@staticmethod
|
|
32
|
-
def execute_command(
|
|
32
|
+
def execute_command(
|
|
33
|
+
command: str, address: str, concurrent_execution: int = 10, pagination_size: int = 50
|
|
34
|
+
) -> subprocess.CompletedProcess[str]:
|
|
33
35
|
env = os.environ.copy()
|
|
34
36
|
env["INFRAHUB_ADDRESS"] = address
|
|
35
37
|
env["INFRAHUB_API_TOKEN"] = PROJECT_ENV_VARIABLES["INFRAHUB_TESTING_INITIAL_ADMIN_TOKEN"]
|
|
36
38
|
env["INFRAHUB_MAX_CONCURRENT_EXECUTION"] = f"{concurrent_execution}"
|
|
39
|
+
env["INFRAHUB_PAGINATION_SIZE"] = f"{pagination_size}"
|
|
37
40
|
result = subprocess.run( # noqa: S602
|
|
38
41
|
command, shell=True, capture_output=True, text=True, env=env, check=False
|
|
39
42
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|