Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-cloud-dataproc] Added support for the AuthenticationConfig field to Dataproc serverless workload configurations, allowing specification of the user workload identity as either the end user or a service account #13549

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
TerminateSessionRequest,
)
from google.cloud.dataproc_v1.types.shared import (
AuthenticationConfig,
AutotuningConfig,
Component,
EnvironmentConfig,
Expand Down Expand Up @@ -365,6 +366,7 @@
"Session",
"SparkConnectConfig",
"TerminateSessionRequest",
"AuthenticationConfig",
"AutotuningConfig",
"EnvironmentConfig",
"ExecutionConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.17.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
TerminateSessionRequest,
)
from .types.shared import (
AuthenticationConfig,
AutotuningConfig,
Component,
EnvironmentConfig,
Expand Down Expand Up @@ -226,6 +227,7 @@
"SessionTemplateControllerAsyncClient",
"WorkflowTemplateServiceAsyncClient",
"AcceleratorConfig",
"AuthenticationConfig",
"AutoscalingConfig",
"AutoscalingPolicy",
"AutoscalingPolicyServiceClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.17.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
TerminateSessionRequest,
)
from .shared import (
AuthenticationConfig,
AutotuningConfig,
Component,
EnvironmentConfig,
Expand Down Expand Up @@ -298,6 +299,7 @@
"Session",
"SparkConnectConfig",
"TerminateSessionRequest",
"AuthenticationConfig",
"AutotuningConfig",
"EnvironmentConfig",
"ExecutionConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"KubernetesSoftwareConfig",
"GkeNodePoolTarget",
"GkeNodePoolConfig",
"AuthenticationConfig",
"AutotuningConfig",
"RepositoryConfig",
"PyPiRepositoryConfig",
Expand Down Expand Up @@ -270,6 +271,13 @@ class ExecutionConfig(proto.Message):
project-level, per-location staging and temporary buckets.
**This field requires a Cloud Storage bucket name, not a
``gs://...`` URI to a Cloud Storage bucket.**
authentication_config (google.cloud.dataproc_v1.types.AuthenticationConfig):
Optional. Authentication configuration used
to set the default identity for the workload
execution. The config specifies the type of
identity (service account or user) that will be
used by workloads to access resources on the
project(s).
"""

service_account: str = proto.Field(
Expand Down Expand Up @@ -308,6 +316,11 @@ class ExecutionConfig(proto.Message):
proto.STRING,
number=10,
)
authentication_config: "AuthenticationConfig" = proto.Field(
proto.MESSAGE,
number=11,
message="AuthenticationConfig",
)


class SparkHistoryServerConfig(proto.Message):
Expand Down Expand Up @@ -888,6 +901,46 @@ class GkeNodePoolAutoscalingConfig(proto.Message):
)


class AuthenticationConfig(proto.Message):
r"""Authentication configuration for a workload is used to set
the default identity for the workload execution.
The config specifies the type of identity (service account or
user) that will be used by workloads to access resources on the
project(s).

Attributes:
user_workload_authentication_type (google.cloud.dataproc_v1.types.AuthenticationConfig.AuthenticationType):
Optional. Authentication type for the user
workload running in containers.
"""

class AuthenticationType(proto.Enum):
r"""Authentication types for workload execution.

Values:
AUTHENTICATION_TYPE_UNSPECIFIED (0):
If AuthenticationType is unspecified then
END_USER_CREDENTIALS is used for 3.0 and newer runtimes, and
SERVICE_ACCOUNT is used for older runtimes.
SERVICE_ACCOUNT (1):
Use service account credentials for
authenticating to other services.
END_USER_CREDENTIALS (2):
Use OAuth credentials associated with the
workload creator/user for authenticating to
other services.
"""
AUTHENTICATION_TYPE_UNSPECIFIED = 0
SERVICE_ACCOUNT = 1
END_USER_CREDENTIALS = 2

user_workload_authentication_type: AuthenticationType = proto.Field(
proto.ENUM,
number=1,
enum=AuthenticationType,
)


class AutotuningConfig(proto.Message):
r"""Autotuning configuration of the workload.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-dataproc",
"version": "5.17.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3906,6 +3906,7 @@ def test_create_batch_rest_call_success(request_type):
"idle_ttl": {"seconds": 751, "nanos": 543},
"ttl": {},
"staging_bucket": "staging_bucket_value",
"authentication_config": {"user_workload_authentication_type": 1},
},
"peripherals_config": {
"metastore_service": "metastore_service_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4512,6 +4512,7 @@ def test_create_session_rest_call_success(request_type):
"idle_ttl": {"seconds": 751, "nanos": 543},
"ttl": {},
"staging_bucket": "staging_bucket_value",
"authentication_config": {"user_workload_authentication_type": 1},
},
"peripherals_config": {
"metastore_service": "metastore_service_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4607,6 +4607,7 @@ def test_create_session_template_rest_call_success(request_type):
"idle_ttl": {"seconds": 751, "nanos": 543},
"ttl": {},
"staging_bucket": "staging_bucket_value",
"authentication_config": {"user_workload_authentication_type": 1},
},
"peripherals_config": {
"metastore_service": "metastore_service_value",
Expand Down Expand Up @@ -4861,6 +4862,7 @@ def test_update_session_template_rest_call_success(request_type):
"idle_ttl": {"seconds": 751, "nanos": 543},
"ttl": {},
"staging_bucket": "staging_bucket_value",
"authentication_config": {"user_workload_authentication_type": 1},
},
"peripherals_config": {
"metastore_service": "metastore_service_value",
Expand Down
Loading