@@ -98,6 +98,7 @@ def __init__(self):
98
98
self ._credentials = None
99
99
self ._encryption_spec_key_name = None
100
100
self ._network = None
101
+ self ._service_account = None
101
102
102
103
def init (
103
104
self ,
@@ -113,6 +114,7 @@ def init(
113
114
credentials : Optional [auth_credentials .Credentials ] = None ,
114
115
encryption_spec_key_name : Optional [str ] = None ,
115
116
network : Optional [str ] = None ,
117
+ service_account : Optional [str ] = None ,
116
118
):
117
119
"""Updates common initialization parameters with provided options.
118
120
@@ -155,6 +157,12 @@ def init(
155
157
Private services access must already be configured for the network.
156
158
If specified, all eligible jobs and resources created will be peered
157
159
with this VPC.
160
+ service_account (str):
161
+ Optional. The service account used to launch jobs and deploy models.
162
+ Jobs that use service_account: BatchPredictionJob, CustomJob,
163
+ PipelineJob, HyperparameterTuningJob, CustomTrainingJob,
164
+ CustomPythonPackageTrainingJob, CustomContainerTrainingJob,
165
+ ModelEvaluationJob.
158
166
Raises:
159
167
ValueError:
160
168
If experiment_description is provided but experiment is not.
@@ -194,6 +202,8 @@ def init(
194
202
self ._encryption_spec_key_name = encryption_spec_key_name
195
203
if network is not None :
196
204
self ._network = network
205
+ if service_account is not None :
206
+ self ._service_account = service_account
197
207
198
208
if experiment :
199
209
metadata ._experiment_tracker .set_experiment (
@@ -297,6 +307,11 @@ def network(self) -> Optional[str]:
297
307
"""Default Compute Engine network to peer to, if provided."""
298
308
return self ._network
299
309
310
+ @property
311
+ def service_account (self ) -> Optional [str ]:
312
+ """Default service account, if provided."""
313
+ return self ._service_account
314
+
300
315
@property
301
316
def experiment_name (self ) -> Optional [str ]:
302
317
"""Default experiment name, if provided."""
0 commit comments