@@ -470,14 +470,13 @@ def deploy(
470
470
self ,
471
471
model : "Model" ,
472
472
deployed_model_display_name : Optional [str ] = None ,
473
- traffic_percentage : int = 0 ,
473
+ traffic_percentage : Optional [ int ] = 0 ,
474
474
traffic_split : Optional [Dict [str , int ]] = None ,
475
475
machine_type : Optional [str ] = None ,
476
476
min_replica_count : int = 1 ,
477
477
max_replica_count : int = 1 ,
478
478
accelerator_type : Optional [str ] = None ,
479
479
accelerator_count : Optional [int ] = None ,
480
- service_account : Optional [str ] = None ,
481
480
explanation_metadata : Optional [explain .ExplanationMetadata ] = None ,
482
481
explanation_parameters : Optional [explain .ExplanationParameters ] = None ,
483
482
metadata : Optional [Sequence [Tuple [str , str ]]] = (),
@@ -532,13 +531,6 @@ def deploy(
532
531
NVIDIA_TESLA_V100, NVIDIA_TESLA_P4, NVIDIA_TESLA_T4, TPU_V2, TPU_V3
533
532
accelerator_count (int):
534
533
Optional. The number of accelerators to attach to a worker replica.
535
- service_account (str):
536
- The service account that the DeployedModel's container runs as. Specify the
537
- email address of the service account. If this service account is not
538
- specified, the container runs as a service account that doesn't have access
539
- to the resource project.
540
- Users deploying the Model must have the `iam.serviceAccounts.actAs`
541
- permission on this service account.
542
534
explanation_metadata (explain.ExplanationMetadata):
543
535
Optional. Metadata describing the Model's input and output for explanation.
544
536
Both `explanation_metadata` and `explanation_parameters` must be
@@ -577,7 +569,6 @@ def deploy(
577
569
max_replica_count = max_replica_count ,
578
570
accelerator_type = accelerator_type ,
579
571
accelerator_count = accelerator_count ,
580
- service_account = service_account ,
581
572
explanation_metadata = explanation_metadata ,
582
573
explanation_parameters = explanation_parameters ,
583
574
metadata = metadata ,
@@ -592,11 +583,10 @@ def _deploy(
592
583
traffic_percentage : Optional [int ] = 0 ,
593
584
traffic_split : Optional [Dict [str , int ]] = None ,
594
585
machine_type : Optional [str ] = None ,
595
- min_replica_count : Optional [ int ] = 1 ,
596
- max_replica_count : Optional [ int ] = 1 ,
586
+ min_replica_count : int = 1 ,
587
+ max_replica_count : int = 1 ,
597
588
accelerator_type : Optional [str ] = None ,
598
589
accelerator_count : Optional [int ] = None ,
599
- service_account : Optional [str ] = None ,
600
590
explanation_metadata : Optional [explain .ExplanationMetadata ] = None ,
601
591
explanation_parameters : Optional [explain .ExplanationParameters ] = None ,
602
592
metadata : Optional [Sequence [Tuple [str , str ]]] = (),
@@ -651,13 +641,6 @@ def _deploy(
651
641
NVIDIA_TESLA_V100, NVIDIA_TESLA_P4, NVIDIA_TESLA_T4, TPU_V2, TPU_V3
652
642
accelerator_count (int):
653
643
Optional. The number of accelerators to attach to a worker replica.
654
- service_account (str):
655
- The service account that the DeployedModel's container runs as. Specify the
656
- email address of the service account. If this service account is not
657
- specified, the container runs as a service account that doesn't have access
658
- to the resource project.
659
- Users deploying the Model must have the `iam.serviceAccounts.actAs`
660
- permission on this service account.
661
644
explanation_metadata (explain.ExplanationMetadata):
662
645
Optional. Metadata describing the Model's input and output for explanation.
663
646
Both `explanation_metadata` and `explanation_parameters` must be
@@ -694,7 +677,6 @@ def _deploy(
694
677
max_replica_count = max_replica_count ,
695
678
accelerator_type = accelerator_type ,
696
679
accelerator_count = accelerator_count ,
697
- service_account = service_account ,
698
680
explanation_metadata = explanation_metadata ,
699
681
explanation_parameters = explanation_parameters ,
700
682
metadata = metadata ,
@@ -715,11 +697,10 @@ def _deploy_call(
715
697
traffic_percentage : Optional [int ] = 0 ,
716
698
traffic_split : Optional [Dict [str , int ]] = None ,
717
699
machine_type : Optional [str ] = None ,
718
- min_replica_count : Optional [ int ] = 1 ,
719
- max_replica_count : Optional [ int ] = 1 ,
700
+ min_replica_count : int = 1 ,
701
+ max_replica_count : int = 1 ,
720
702
accelerator_type : Optional [str ] = None ,
721
703
accelerator_count : Optional [int ] = None ,
722
- service_account : Optional [str ] = None ,
723
704
explanation_metadata : Optional [explain .ExplanationMetadata ] = None ,
724
705
explanation_parameters : Optional [explain .ExplanationParameters ] = None ,
725
706
metadata : Optional [Sequence [Tuple [str , str ]]] = (),
@@ -772,13 +753,6 @@ def _deploy_call(
772
753
is not provided, the larger value of min_replica_count or 1 will
773
754
be used. If value provided is smaller than min_replica_count, it
774
755
will automatically be increased to be min_replica_count.
775
- service_account (str):
776
- The service account that the DeployedModel's container runs as. Specify the
777
- email address of the service account. If this service account is not
778
- specified, the container runs as a service account that doesn't have access
779
- to the resource project.
780
- Users deploying the Model must have the `iam.serviceAccounts.actAs`
781
- permission on this service account.
782
756
explanation_metadata (explain.ExplanationMetadata):
783
757
Optional. Metadata describing the Model's input and output for explanation.
784
758
Both `explanation_metadata` and `explanation_parameters` must be
@@ -814,12 +788,6 @@ def _deploy_call(
814
788
gca_endpoint = gca_endpoint_v1beta1
815
789
gca_machine_resources = gca_machine_resources_v1beta1
816
790
817
- deployed_model = gca_endpoint .DeployedModel (
818
- model = model_resource_name ,
819
- display_name = deployed_model_display_name ,
820
- service_account = service_account ,
821
- )
822
-
823
791
if machine_type :
824
792
machine_spec = gca_machine_resources .MachineSpec (machine_type = machine_type )
825
793
@@ -828,17 +796,26 @@ def _deploy_call(
828
796
machine_spec .accelerator_type = accelerator_type
829
797
machine_spec .accelerator_count = accelerator_count
830
798
831
- deployed_model . dedicated_resources = gca_machine_resources .DedicatedResources (
799
+ dedicated_resources = gca_machine_resources .DedicatedResources (
832
800
machine_spec = machine_spec ,
833
801
min_replica_count = min_replica_count ,
834
802
max_replica_count = max_replica_count ,
835
803
)
836
-
804
+ deployed_model = gca_endpoint .DeployedModel (
805
+ dedicated_resources = dedicated_resources ,
806
+ model = model_resource_name ,
807
+ display_name = deployed_model_display_name ,
808
+ )
837
809
else :
838
- deployed_model . automatic_resources = gca_machine_resources .AutomaticResources (
810
+ automatic_resources = gca_machine_resources .AutomaticResources (
839
811
min_replica_count = min_replica_count ,
840
812
max_replica_count = max_replica_count ,
841
813
)
814
+ deployed_model = gca_endpoint .DeployedModel (
815
+ automatic_resources = automatic_resources ,
816
+ model = model_resource_name ,
817
+ display_name = deployed_model_display_name ,
818
+ )
842
819
843
820
# Service will throw error if both metadata and parameters are not provided
844
821
if explanation_metadata and explanation_parameters :
@@ -1512,11 +1489,10 @@ def deploy(
1512
1489
traffic_percentage : Optional [int ] = 0 ,
1513
1490
traffic_split : Optional [Dict [str , int ]] = None ,
1514
1491
machine_type : Optional [str ] = None ,
1515
- min_replica_count : Optional [ int ] = 1 ,
1516
- max_replica_count : Optional [ int ] = 1 ,
1492
+ min_replica_count : int = 1 ,
1493
+ max_replica_count : int = 1 ,
1517
1494
accelerator_type : Optional [str ] = None ,
1518
1495
accelerator_count : Optional [int ] = None ,
1519
- service_account : Optional [str ] = None ,
1520
1496
explanation_metadata : Optional [explain .ExplanationMetadata ] = None ,
1521
1497
explanation_parameters : Optional [explain .ExplanationParameters ] = None ,
1522
1498
metadata : Optional [Sequence [Tuple [str , str ]]] = (),
@@ -1572,13 +1548,6 @@ def deploy(
1572
1548
NVIDIA_TESLA_V100, NVIDIA_TESLA_P4, NVIDIA_TESLA_T4, TPU_V2, TPU_V3
1573
1549
accelerator_count (int):
1574
1550
Optional. The number of accelerators to attach to a worker replica.
1575
- service_account (str):
1576
- The service account that the DeployedModel's container runs as. Specify the
1577
- email address of the service account. If this service account is not
1578
- specified, the container runs as a service account that doesn't have access
1579
- to the resource project.
1580
- Users deploying the Model must have the `iam.serviceAccounts.actAs`
1581
- permission on this service account.
1582
1551
explanation_metadata (explain.ExplanationMetadata):
1583
1552
Optional. Metadata describing the Model's input and output for explanation.
1584
1553
Both `explanation_metadata` and `explanation_parameters` must be
@@ -1632,7 +1601,6 @@ def deploy(
1632
1601
max_replica_count = max_replica_count ,
1633
1602
accelerator_type = accelerator_type ,
1634
1603
accelerator_count = accelerator_count ,
1635
- service_account = service_account ,
1636
1604
explanation_metadata = explanation_metadata ,
1637
1605
explanation_parameters = explanation_parameters ,
1638
1606
metadata = metadata ,
@@ -1649,11 +1617,10 @@ def _deploy(
1649
1617
traffic_percentage : Optional [int ] = 0 ,
1650
1618
traffic_split : Optional [Dict [str , int ]] = None ,
1651
1619
machine_type : Optional [str ] = None ,
1652
- min_replica_count : Optional [ int ] = 1 ,
1653
- max_replica_count : Optional [ int ] = 1 ,
1620
+ min_replica_count : int = 1 ,
1621
+ max_replica_count : int = 1 ,
1654
1622
accelerator_type : Optional [str ] = None ,
1655
1623
accelerator_count : Optional [int ] = None ,
1656
- service_account : Optional [str ] = None ,
1657
1624
explanation_metadata : Optional [explain .ExplanationMetadata ] = None ,
1658
1625
explanation_parameters : Optional [explain .ExplanationParameters ] = None ,
1659
1626
metadata : Optional [Sequence [Tuple [str , str ]]] = (),
@@ -1709,13 +1676,6 @@ def _deploy(
1709
1676
NVIDIA_TESLA_V100, NVIDIA_TESLA_P4, NVIDIA_TESLA_T4, TPU_V2, TPU_V3
1710
1677
accelerator_count (int):
1711
1678
Optional. The number of accelerators to attach to a worker replica.
1712
- service_account (str):
1713
- The service account that the DeployedModel's container runs as. Specify the
1714
- email address of the service account. If this service account is not
1715
- specified, the container runs as a service account that doesn't have access
1716
- to the resource project.
1717
- Users deploying the Model must have the `iam.serviceAccounts.actAs`
1718
- permission on this service account.
1719
1679
explanation_metadata (explain.ExplanationMetadata):
1720
1680
Optional. Metadata describing the Model's input and output for explanation.
1721
1681
Both `explanation_metadata` and `explanation_parameters` must be
@@ -1772,7 +1732,6 @@ def _deploy(
1772
1732
max_replica_count = max_replica_count ,
1773
1733
accelerator_type = accelerator_type ,
1774
1734
accelerator_count = accelerator_count ,
1775
- service_account = service_account ,
1776
1735
explanation_metadata = explanation_metadata ,
1777
1736
explanation_parameters = explanation_parameters ,
1778
1737
metadata = metadata ,
0 commit comments