def testDeprecatedMysqlMetadataConnectionConfig(self): self._set_required_env_vars({ 'mysql_host': 'mysql', 'mysql_port': '3306', 'mysql_database': 'metadb', 'mysql_user_name': 'root', 'mysql_user_password': '******' }) metadata_config = kubeflow_pb2.KubeflowMetadataConfig() metadata_config.mysql_db_service_host.environment_variable = 'mysql_host' metadata_config.mysql_db_service_port.environment_variable = 'mysql_port' metadata_config.mysql_db_name.environment_variable = 'mysql_database' metadata_config.mysql_db_user.environment_variable = 'mysql_user_name' metadata_config.mysql_db_password.environment_variable = 'mysql_user_password' ml_metadata_config = container_entrypoint._get_metadata_connection_config( metadata_config) self.assertIsInstance(ml_metadata_config, metadata_store_pb2.ConnectionConfig) self.assertEqual(ml_metadata_config.mysql.host, 'mysql') self.assertEqual(ml_metadata_config.mysql.port, 3306) self.assertEqual(ml_metadata_config.mysql.database, 'metadb') self.assertEqual(ml_metadata_config.mysql.user, 'root') self.assertEqual(ml_metadata_config.mysql.password, 'test')
def testGrpcMetadataConnectionConfig(self): self._set_required_env_vars({ 'METADATA_GRPC_SERVICE_HOST': 'metadata-grpc', 'METADATA_GRPC_SERVICE_PORT': '8080', }) grpc_config = kubeflow_pb2.KubeflowGrpcMetadataConfig() grpc_config.grpc_service_host.environment_variable = 'METADATA_GRPC_SERVICE_HOST' grpc_config.grpc_service_port.environment_variable = 'METADATA_GRPC_SERVICE_PORT' metadata_config = kubeflow_pb2.KubeflowMetadataConfig() metadata_config.grpc_config.CopyFrom(grpc_config) ml_metadata_config = container_entrypoint._get_metadata_connection_config( metadata_config) self.assertIsInstance(ml_metadata_config, metadata_store_pb2.MetadataStoreClientConfig) self.assertEqual(ml_metadata_config.host, 'metadata-grpc') self.assertEqual(ml_metadata_config.port, 8080)