diff --git a/exasol_sagemaker_extension/deployment/deploy_create_statements.py b/exasol_sagemaker_extension/deployment/deploy_create_statements.py index 6c2c145..a117bb2 100644 --- a/exasol_sagemaker_extension/deployment/deploy_create_statements.py +++ b/exasol_sagemaker_extension/deployment/deploy_create_statements.py @@ -144,22 +144,22 @@ def create_and_run(cls, passing the connection object to it and calls its run method. Parameters: - schema - schema where the scripts should be created - dsn - On-Prem database address including the port + schema - Schema where the scripts should be created + dsn - On-Prem database host address, including the port db_user - On-Prem database username - db_password - On-Prem database user password + db_pass - On-Prem database user password saas_url - SaaS service url saas_account_id - SaaS account id saas_database_id - SaaS database id - saas_database_name - SaaS database name, to use in case the id is unknown + saas_database_name - SaaS database name, to be used in case the id is unknown saas_token - SaaS Personal Access Token (PAT) use_ssl_cert_validation - Use SSL server certificate validation - ssl_trusted_ca - Path to a file or directory with a CA bundle + ssl_trusted_ca - Path to a file or directory with a trusted CA bundle ssl_client_certificate - Path to a file with the client SSL certificate ssl_private_key - Path to a file with the client private key - to_print - if True the script creation SQL commands will be - printed rather than executed - develop - if True the scripts will be generated from scratch + to_print - If True the script creation SQL commands will be + printed rather than executed + develop - If True the scripts will be generated from scratch """ # Infer where the database is - on-prem or SaaS. diff --git a/tests/ci_tests/test_deploying_autopilot.py b/tests/ci_tests/test_deploying_autopilot.py index 5d9f504..4f6e348 100644 --- a/tests/ci_tests/test_deploying_autopilot.py +++ b/tests/ci_tests/test_deploying_autopilot.py @@ -54,7 +54,6 @@ def _deploy_endpoint(job_name, endpoint_name, model_setup_params, ci_test_env: C assert endpoint_name in list(map(lambda x: x[0], all_scripts)) -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) diff --git a/tests/ci_tests/test_polling_autopilot.py b/tests/ci_tests/test_polling_autopilot.py index 289f331..af8e67c 100644 --- a/tests/ci_tests/test_polling_autopilot.py +++ b/tests/ci_tests/test_polling_autopilot.py @@ -8,7 +8,6 @@ from tests.ci_tests.utils.parameters import cls_model_setup_params -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) diff --git a/tests/ci_tests/test_predicting_autopilot.py b/tests/ci_tests/test_predicting_autopilot.py index b7604e2..98871ee 100644 --- a/tests/ci_tests/test_predicting_autopilot.py +++ b/tests/ci_tests/test_predicting_autopilot.py @@ -55,7 +55,6 @@ def _make_prediction(job_name, endpoint_name, model_setup_params, ci_test_env: C assert predictions -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) @@ -78,7 +77,6 @@ def test_predict_autopilot_regression_job(db_conn, deploy_params, prepare_ci_tes db_conn=prepare_ci_test_environment) -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) diff --git a/tests/ci_tests/test_training_autopilot.py b/tests/ci_tests/test_training_autopilot.py index 20f4121..9eb6fe7 100644 --- a/tests/ci_tests/test_training_autopilot.py +++ b/tests/ci_tests/test_training_autopilot.py @@ -10,7 +10,6 @@ from tests.ci_tests.utils.queries import DatabaseQueries -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) @@ -28,7 +27,6 @@ def test_train_autopilot_regression_job(db_conn, deploy_params, prepare_ci_test_ job_name, reg_model_setup_params, prepare_ci_test_environment) -@pytest.mark.skip @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) diff --git a/tests/ci_tests/utils/parameters.py b/tests/ci_tests/utils/parameters.py index de018a1..056db80 100644 --- a/tests/ci_tests/utils/parameters.py +++ b/tests/ci_tests/utils/parameters.py @@ -31,11 +31,16 @@ def get_deploy_arg_list(deploy_params: dict[str, Any], schema: str) -> list[Any]: + """ + Creates a CLI parameter list to be used when calling the script deployment + command (see deployment/deploy_cli.py). + """ args_list: list[Any] = [] for param_name, param_value in deploy_params.items(): args_list.append(f'--{param_name.replace("_", "-")}') args_list.append(param_value) args_list.extend(["--schema", schema]) + # We validate the server certificate in SaaS, but not in the Docker DB if "saas_url" in deploy_params: args_list.append("--use-ssl-cert-validation") else: diff --git a/tests/deployment/test_deploy_cli.py b/tests/deployment/test_deploy_cli.py index e112b61..2536eb1 100644 --- a/tests/deployment/test_deploy_cli.py +++ b/tests/deployment/test_deploy_cli.py @@ -39,7 +39,7 @@ def get_all_scripts(db_conn): @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), - # (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) + (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) ], indirect=True) def test_deploy_cli_main(db_conn, deploy_params): diff --git a/tests/deployment/test_deploy_create_statements.py b/tests/deployment/test_deploy_create_statements.py index b469984..5c41a47 100644 --- a/tests/deployment/test_deploy_create_statements.py +++ b/tests/deployment/test_deploy_create_statements.py @@ -30,10 +30,11 @@ def get_all_scripts(db_conn): @pytest.mark.parametrize("db_conn,deploy_params", [ (bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem), - # (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) + (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas) ], indirect=True) def test_deploy_create_statements(db_conn, deploy_params): + # We validate the server certificate in SaaS, but not in the Docker DB cert_validation = "saas_url" in deploy_params DeployCreateStatements.create_and_run(**deploy_params, schema=DB_SCHEMA, use_ssl_cert_validation=cert_validation)