Skip to content

Commit

Permalink
Add new option to allow disabling the Spark UI (#22)
Browse files Browse the repository at this point in the history
* Add new option to allow disabling the Spark UI

* Prevent publishing PR builds
  • Loading branch information
jongeorge1 authored May 9, 2024
1 parent c6bfe6d commit 9fb90e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
netSdkVersion: '8.0.x'
# additionalNetSdkVersion: ''
# workflow_dispatch inputs are always strings, the type property is just for the UI
forcePublish: ${{ github.event.inputs.forcePublish == 'true' || github.event_name == 'pull_request' }}
forcePublish: ${{ github.event.inputs.forcePublish == 'true' }}
skipCleanup: ${{ github.event.inputs.skipCleanup == 'true' }}
# testArtifactName: ''
# testArtifactPath: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class LocalSparkSessionConfig():
enable_az_cli_auth (bool, optional): Whether to enable Azure CLI authentication. Defaults to False. If using
Azure Data Lake Storage Gen 2, this should be set to True to enable authentication using your current
Azure CLI credentials.
enable_spark_ui (bool, optional): Whether to enable the Spark UI. Defaults to True. It can be useful to turn
the UI off for unit tests to avoid port binding issues.
"""
workload_name: str
storage_configuration: StorageConfiguration = LocalFileSystemStorageConfiguration(os.path.join(CWD, "data"))
Expand All @@ -38,6 +40,7 @@ class LocalSparkSessionConfig():
hive_metastore_dir: str = os.path.join(CWD, "metastore")
install_hadoop_azure_package: bool = False
enable_az_cli_auth: bool = False
enable_spark_ui: bool = True


@dataclass
Expand All @@ -64,6 +67,9 @@ def create_spark_session(self) -> SparkSession:
.config(
"spark.sql.catalog.spark_catalog",
"org.apache.spark.sql.delta.catalog.DeltaCatalog")
.config(
"spark.ui.enabled",
"true" if self.config.enable_spark_ui else "false")
)

extra_packages = []
Expand Down

0 comments on commit 9fb90e3

Please sign in to comment.