Skip to content

Commit

Permalink
feat: [google-cloud-dataproc] Added support for the AuthenticationCon…
Browse files Browse the repository at this point in the history
…fig field to Dataproc serverless workload configurations, allowing specification of the user workload identity as either the end user or a service account (#13549)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 729645002

Source-Link:
googleapis/googleapis@d4da473

Source-Link:
googleapis/googleapis-gen@74d5a52
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiI3NGQ1YTUyOTc1YTZmODAzMDQyMDk0ZTk1YzRmMGE0MjI2ZmE2NjY0In0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 24, 2025
1 parent 8097512 commit 4c96416
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 3 deletions.
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

0 comments on commit 4c96416

Please sign in to comment.