Differential D4718 Diff 23667 integration_tests/python_modules/dagster-k8s-test-infra/dagster_k8s_test_infra/cluster.py
Changeset View
Changeset View
Standalone View
Standalone View
integration_tests/python_modules/dagster-k8s-test-infra/dagster_k8s_test_infra/cluster.py
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | ) as local_forward_port: | ||||
event_storage=PostgresEventLogStorage(postgres_url), | event_storage=PostgresEventLogStorage(postgres_url), | ||||
compute_log_manager=NoOpComputeLogManager(), | compute_log_manager=NoOpComputeLogManager(), | ||||
run_launcher=run_launcher, | run_launcher=run_launcher, | ||||
) | ) | ||||
yield instance | yield instance | ||||
@pytest.fixture(scope='session') | @pytest.fixture(scope='session') | ||||
def dagster_instance_for_k8s_run_launcher(helm_namespace_for_k8s_run_launcher, run_launcher): | |||||
tempdir = DagsterInstance.temp_storage() | |||||
with local_port_forward_postgres( | |||||
namespace=helm_namespace_for_k8s_run_launcher | |||||
) as local_forward_port: | |||||
postgres_url = 'postgresql://test:test@localhost:{local_forward_port}/test'.format( | |||||
local_forward_port=local_forward_port | |||||
) | |||||
print('Local Postgres forwarding URL: ', postgres_url) | |||||
instance = DagsterInstance( | |||||
instance_type=InstanceType.EPHEMERAL, | |||||
local_artifact_storage=LocalArtifactStorage(tempdir), | |||||
run_storage=PostgresRunStorage(postgres_url), | |||||
event_storage=PostgresEventLogStorage(postgres_url), | |||||
compute_log_manager=NoOpComputeLogManager(), | |||||
run_launcher=run_launcher, | |||||
) | |||||
yield instance | |||||
@pytest.fixture(scope='session') | |||||
def dagster_instance(helm_namespace, run_launcher): # pylint: disable=redefined-outer-name | def dagster_instance(helm_namespace, run_launcher): # pylint: disable=redefined-outer-name | ||||
tempdir = DagsterInstance.temp_storage() | tempdir = DagsterInstance.temp_storage() | ||||
with local_port_forward_postgres(namespace=helm_namespace) as local_forward_port: | with local_port_forward_postgres(namespace=helm_namespace) as local_forward_port: | ||||
postgres_url = 'postgresql://test:test@localhost:{local_forward_port}/test'.format( | postgres_url = 'postgresql://test:test@localhost:{local_forward_port}/test'.format( | ||||
local_forward_port=local_forward_port | local_forward_port=local_forward_port | ||||
) | ) | ||||
print('Local Postgres forwarding URL: ', postgres_url) | print('Local Postgres forwarding URL: ', postgres_url) | ||||
Show All 10 Lines |