agent-starter-pack 0.11.1__py3-none-any.whl → 0.11.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/METADATA +1 -1
- {agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/RECORD +9 -9
- src/base_template/deployment/terraform/dev/variables.tf +3 -2
- src/base_template/deployment/terraform/iam.tf +10 -34
- src/base_template/deployment/terraform/variables.tf +3 -3
- src/cli/commands/setup_cicd.py +50 -41
- {agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/entry_points.txt +0 -0
- {agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/licenses/LICENSE +0 -0
@@ -47,13 +47,13 @@ src/base_template/app/utils/typing.py,sha256=DP5OZC3IGvqA1XbvWt8kI3gyAK3ZjzUSL5C
|
|
47
47
|
src/base_template/deployment/README.md,sha256=gZJvSWdQh_Mi-bZ3dmuPv7fMezIw04fgN5tq7KgglPw,692
|
48
48
|
src/base_template/deployment/terraform/apis.tf,sha256=KX8Oe2gjT-gh9Bkntz9yIAyRjPc1gZvwOhroJ6NZVp4,1513
|
49
49
|
src/base_template/deployment/terraform/github.tf,sha256=KhfNBAzeUH9jDr8FOw_DiypesA5AEC8IZT1PRqntSt8,10838
|
50
|
-
src/base_template/deployment/terraform/iam.tf,sha256=
|
50
|
+
src/base_template/deployment/terraform/iam.tf,sha256=I70ROOjXcYiqxtzuak6n0ZNhkjH6vjOzykXQG1Zi1dE,4700
|
51
51
|
src/base_template/deployment/terraform/locals.tf,sha256=nvjlavqWRL6e-iIqfIRvsai5JY9l6KhRGcwJQFRdu_U,1653
|
52
52
|
src/base_template/deployment/terraform/log_sinks.tf,sha256=eAGh_dCjOKUQjylkqp1fNM9cfE4QB9HSEovjD6_G9Lg,2971
|
53
53
|
src/base_template/deployment/terraform/providers.tf,sha256=wNWvXJbpvV3njDYO8t4s6DdDkL0dQpWgkPsmJw61ABM,1167
|
54
54
|
src/base_template/deployment/terraform/service_accounts.tf,sha256=iSRrRzxL16pZHel5cZDzC7m15IRTRv8qMxkcg4nd30o,1672
|
55
55
|
src/base_template/deployment/terraform/storage.tf,sha256=W0l34U7Ql2wdegfWsWfKzaEooaMaTL2TkU18KM_Vuys,8695
|
56
|
-
src/base_template/deployment/terraform/variables.tf,sha256=
|
56
|
+
src/base_template/deployment/terraform/variables.tf,sha256=JD-lvsVYSgE0pR15ZJhmNAn2SAWo5CNDCofXGNVJy1o,6749
|
57
57
|
src/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'github_actions' %}wif.tf{% else %}unused_wif.tf{% endif %},sha256=rCupUnvaTVj75ahJOckNuzlQ-xcLTik_HpqXzVEEB5g,2666
|
58
58
|
src/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}build_triggers.tf{% else %}unused_build_triggers.tf{% endif %},sha256=wb8Frd95PF0PHDRoh9v3QF5kpF-Fi-GDcD7mKmTxGJ8,6813
|
59
59
|
src/base_template/deployment/terraform/dev/apis.tf,sha256=R5fyLQGHsZy7JyDdFpuNzUBute6Rn9xR32zIMjkGxzc,1592
|
@@ -61,7 +61,7 @@ src/base_template/deployment/terraform/dev/iam.tf,sha256=q8dfqbMNSpgMXW96hP7rnAp
|
|
61
61
|
src/base_template/deployment/terraform/dev/log_sinks.tf,sha256=uVdMtDdd8MnxtKhqzVaYqadE11P3r4fs2IdgNecxM4I,2671
|
62
62
|
src/base_template/deployment/terraform/dev/providers.tf,sha256=1S9jCh48d6ailVZ1e14EHsUUDSp7DyGZGExJwViFCkM,900
|
63
63
|
src/base_template/deployment/terraform/dev/storage.tf,sha256=1mgLs21SUhfcoRICqd7BqUlEVAVGeN3kMsQ4UAQLOh8,4654
|
64
|
-
src/base_template/deployment/terraform/dev/variables.tf,sha256=
|
64
|
+
src/base_template/deployment/terraform/dev/variables.tf,sha256=l95zljQbchR6b--wJGJJcCAu89FqsR3UqAiCz_bH7to,4089
|
65
65
|
src/base_template/deployment/terraform/dev/vars/env.tfvars,sha256=LoQMjh1AAMR-MGfaSCsVMjdoYTk2T4oS4D9vMH54CdQ,714
|
66
66
|
src/base_template/deployment/terraform/vars/env.tfvars,sha256=Jyc36pt-0xNMwQsoXucad0QAWFMeGe67fdimCKXx-tw,1411
|
67
67
|
src/base_template/tests/unit/test_dummy.py,sha256=2exfCH8qhkZrLWvK04ZxNTO9MV3fdTbZkJN3uK6zvok,850
|
@@ -75,7 +75,7 @@ src/cli/main.py,sha256=Dya7Sw3ozMTaGDcwMh_-W7udkGZHGzgAj8aBdSZaZxI,1832
|
|
75
75
|
src/cli/commands/create.py,sha256=mUFukCCpuFV6bgS-JmQEZ6D-zB-_ddxmTMeuygrhogI,43876
|
76
76
|
src/cli/commands/enhance.py,sha256=KcSLRmhNDxbQa_XoJqcXtC16enyx8FWq20bkpmLSpyQ,11370
|
77
77
|
src/cli/commands/list.py,sha256=qey_XDoJkjBvvuVMilFqjMUdBRmbHkSyqGeM23E3xHM,5502
|
78
|
-
src/cli/commands/setup_cicd.py,sha256=
|
78
|
+
src/cli/commands/setup_cicd.py,sha256=nSgMUD4_ncYGwLWU1Fl7Ypw3GTJc8qVfjPxwZMLn4xo,32113
|
79
79
|
src/cli/utils/__init__.py,sha256=_cTmsXGPqOtK0q8UW5164QTltbJRJFR_Efxq_BRL1-o,1311
|
80
80
|
src/cli/utils/cicd.py,sha256=9s_OcusQznT_pSjFP60BfDBoZ5V6bwPE0QWbWdMaVlY,26515
|
81
81
|
src/cli/utils/datastores.py,sha256=gv1V6eDcOEKx4MRNG5C3Y-VfixYq1AzQuaYMLp8QRNo,1058
|
@@ -197,8 +197,8 @@ src/resources/locks/uv-live_api-cloud_run.lock,sha256=xOPEAiyHooNT2nMP1wbnJ2ekOD
|
|
197
197
|
src/utils/generate_locks.py,sha256=6V1B8V2BEuevWnXUsxZVTrLjXwFRII8UfsIGrQqZxVs,4320
|
198
198
|
src/utils/lock_utils.py,sha256=IFOMUWtb-ypm2Y8w8J5y2oI_-MaPuwPF_JOAAlnNudA,2275
|
199
199
|
src/utils/watch_and_rebuild.py,sha256=vP4yIiA7E_lj5sfQdJUl8TXas6V7msDg8XWUutAC05Q,6679
|
200
|
-
agent_starter_pack-0.11.
|
201
|
-
agent_starter_pack-0.11.
|
202
|
-
agent_starter_pack-0.11.
|
203
|
-
agent_starter_pack-0.11.
|
204
|
-
agent_starter_pack-0.11.
|
200
|
+
agent_starter_pack-0.11.2.dist-info/METADATA,sha256=TKkrd80Yfxfp3hFQKQCwakKeLulHCfqEprBiVty9P38,11102
|
201
|
+
agent_starter_pack-0.11.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
202
|
+
agent_starter_pack-0.11.2.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
|
203
|
+
agent_starter_pack-0.11.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
204
|
+
agent_starter_pack-0.11.2.dist-info/RECORD,,
|
@@ -49,14 +49,15 @@ variable "app_sa_roles" {
|
|
49
49
|
description = "List of roles to assign to the application service account"
|
50
50
|
type = list(string)
|
51
51
|
default = [
|
52
|
-
{%- if
|
52
|
+
{%- if cookiecutter.session_type == "alloydb" %}
|
53
53
|
"roles/secretmanager.secretAccessor",
|
54
54
|
{%- endif %}
|
55
55
|
"roles/aiplatform.user",
|
56
56
|
"roles/discoveryengine.editor",
|
57
57
|
"roles/logging.logWriter",
|
58
58
|
"roles/cloudtrace.agent",
|
59
|
-
"roles/storage.admin"
|
59
|
+
"roles/storage.admin",
|
60
|
+
"roles/serviceusage.serviceUsageConsumer",
|
60
61
|
]
|
61
62
|
}
|
62
63
|
{% if cookiecutter.data_ingestion %}
|
@@ -44,19 +44,7 @@ resource "google_project_iam_member" "other_projects_roles" {
|
|
44
44
|
member = "serviceAccount:${resource.google_service_account.cicd_runner_sa.email}"
|
45
45
|
depends_on = [resource.google_project_service.cicd_services, resource.google_project_service.deploy_project_services]
|
46
46
|
}
|
47
|
-
|
48
|
-
# 3. Allow Cloud Run service SA to pull containers stored in the CICD project
|
49
|
-
resource "google_project_iam_member" "cicd_run_invoker_artifact_registry_reader" {
|
50
|
-
for_each = local.deploy_project_ids
|
51
|
-
project = var.cicd_runner_project_id
|
52
|
-
|
53
|
-
role = "roles/artifactregistry.reader"
|
54
|
-
member = "serviceAccount:service-${data.google_project.projects[each.key].number}@serverless-robot-prod.iam.gserviceaccount.com"
|
55
|
-
depends_on = [resource.google_project_service.cicd_services, resource.google_project_service.deploy_project_services]
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
# 4. Grant application SA the required permissions to run the application
|
47
|
+
# 3. Grant application SA the required permissions to run the application
|
60
48
|
resource "google_project_iam_member" "app_sa_roles" {
|
61
49
|
for_each = {
|
62
50
|
for pair in setproduct(keys(local.deploy_project_ids), var.app_sa_roles) :
|
@@ -72,33 +60,21 @@ resource "google_project_iam_member" "app_sa_roles" {
|
|
72
60
|
depends_on = [resource.google_project_service.cicd_services, resource.google_project_service.deploy_project_services]
|
73
61
|
}
|
74
62
|
|
75
|
-
{%
|
76
|
-
|
77
|
-
|
78
|
-
resource "google_project_service_identity" "vertex_sa" {
|
63
|
+
{% if cookiecutter.deployment_target == 'cloud_run' %}
|
64
|
+
# 4. Allow Cloud Run service SA to pull containers stored in the CICD project
|
65
|
+
resource "google_project_iam_member" "cicd_run_invoker_artifact_registry_reader" {
|
79
66
|
for_each = local.deploy_project_ids
|
80
|
-
|
81
|
-
project = each.value
|
82
|
-
service = "aiplatform.googleapis.com"
|
83
|
-
}
|
67
|
+
project = var.cicd_runner_project_id
|
84
68
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
for pair in setproduct(keys(local.deploy_project_ids), var.app_sa_roles) :
|
89
|
-
"${pair[0]}_${pair[1]}" => {
|
90
|
-
project = local.deploy_project_ids[pair[0]]
|
91
|
-
role = pair[1]
|
92
|
-
}
|
93
|
-
}
|
69
|
+
role = "roles/artifactregistry.reader"
|
70
|
+
member = "serviceAccount:service-${data.google_project.projects[each.key].number}@serverless-robot-prod.iam.gserviceaccount.com"
|
71
|
+
depends_on = [resource.google_project_service.cicd_services, resource.google_project_service.deploy_project_services]
|
94
72
|
|
95
|
-
project = each.value.project
|
96
|
-
role = each.value.role
|
97
|
-
member = "serviceAccount:service-${data.google_project.projects[split("_", each.key)[0]].number}@gcp-sa-aiplatform-re.iam.gserviceaccount.com"
|
98
|
-
depends_on = [resource.google_project_service.deploy_project_services, resource.google_project_service_identity.vertex_sa]
|
99
73
|
}
|
74
|
+
|
100
75
|
{% endif %}
|
101
76
|
|
77
|
+
|
102
78
|
# Special assignment: Allow the CICD SA to create tokens
|
103
79
|
resource "google_service_account_iam_member" "cicd_run_invoker_token_creator" {
|
104
80
|
service_account_id = google_service_account.cicd_runner_sa.name
|
@@ -70,15 +70,15 @@ variable "app_sa_roles" {
|
|
70
70
|
description = "List of roles to assign to the application service account"
|
71
71
|
type = list(string)
|
72
72
|
default = [
|
73
|
-
{%- if cookiecutter.
|
74
|
-
"roles/run.invoker",
|
73
|
+
{%- if cookiecutter.session_type == "alloydb" %}
|
75
74
|
"roles/secretmanager.secretAccessor",
|
76
75
|
{%- endif %}
|
77
76
|
"roles/aiplatform.user",
|
78
77
|
"roles/discoveryengine.editor",
|
79
78
|
"roles/logging.logWriter",
|
80
79
|
"roles/cloudtrace.agent",
|
81
|
-
"roles/storage.admin"
|
80
|
+
"roles/storage.admin",
|
81
|
+
"roles/serviceusage.serviceUsageConsumer",
|
82
82
|
]
|
83
83
|
}
|
84
84
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
src/cli/commands/setup_cicd.py
CHANGED
@@ -48,7 +48,7 @@ def display_intro_message() -> None:
|
|
48
48
|
"This command helps set up a basic CI/CD pipeline for development and testing purposes."
|
49
49
|
)
|
50
50
|
console.print("It will:")
|
51
|
-
console.print("- Create a GitHub repository and connect it to
|
51
|
+
console.print("- Create a GitHub repository and connect it to your CI/CD runner")
|
52
52
|
console.print("- Set up development environment infrastructure")
|
53
53
|
console.print("- Configure basic CI/CD triggers for PR checks and deployments")
|
54
54
|
console.print(
|
@@ -218,6 +218,34 @@ def validate_working_directory() -> None:
|
|
218
218
|
)
|
219
219
|
|
220
220
|
|
221
|
+
def detect_region_from_terraform_vars() -> str | None:
|
222
|
+
"""Detect region from Terraform vars file.
|
223
|
+
|
224
|
+
Returns:
|
225
|
+
str | None: The detected region, or None if not found or is default
|
226
|
+
"""
|
227
|
+
try:
|
228
|
+
tf_vars_path = Path("deployment/terraform/vars/env.tfvars")
|
229
|
+
if not tf_vars_path.exists():
|
230
|
+
return None
|
231
|
+
|
232
|
+
with open(tf_vars_path, encoding="utf-8") as f:
|
233
|
+
content = f.read()
|
234
|
+
|
235
|
+
# Look for region = "value" pattern
|
236
|
+
region_match = re.search(r'region\s*=\s*"([^"]+)"', content)
|
237
|
+
if region_match:
|
238
|
+
detected_region = region_match.group(1)
|
239
|
+
# Don't auto-detect if it's the default value
|
240
|
+
if detected_region != "us-central1":
|
241
|
+
return detected_region
|
242
|
+
|
243
|
+
return None
|
244
|
+
except Exception:
|
245
|
+
# If any error occurs, return None to use default
|
246
|
+
return None
|
247
|
+
|
248
|
+
|
221
249
|
def update_build_triggers(tf_dir: Path) -> None:
|
222
250
|
"""Update build triggers configuration."""
|
223
251
|
build_triggers_path = tf_dir / "build_triggers.tf"
|
@@ -427,7 +455,9 @@ console = Console()
|
|
427
455
|
@click.option(
|
428
456
|
"--cicd-project", help="CICD project ID (defaults to prod project if not specified)"
|
429
457
|
)
|
430
|
-
@click.option(
|
458
|
+
@click.option(
|
459
|
+
"--region", help="GCP region (auto-detects from Terraform vars if not specified)"
|
460
|
+
)
|
431
461
|
@click.option("--repository-name", help="Repository name (optional)")
|
432
462
|
@click.option(
|
433
463
|
"--repository-owner",
|
@@ -468,7 +498,7 @@ def setup_cicd(
|
|
468
498
|
staging_project: str | None,
|
469
499
|
prod_project: str | None,
|
470
500
|
cicd_project: str | None,
|
471
|
-
region: str,
|
501
|
+
region: str | None,
|
472
502
|
repository_name: str | None,
|
473
503
|
repository_owner: str | None,
|
474
504
|
host_connection_name: str | None,
|
@@ -502,23 +532,24 @@ def setup_cicd(
|
|
502
532
|
cicd_project = prod_project
|
503
533
|
console.print(f"Using production project '{prod_project}' for CI/CD resources")
|
504
534
|
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
535
|
+
# Auto-detect region if not provided
|
536
|
+
if region is None:
|
537
|
+
detected_region = detect_region_from_terraform_vars()
|
538
|
+
if detected_region:
|
539
|
+
region = detected_region
|
540
|
+
console.print(f"Auto-detected region from Terraform vars: {region}")
|
541
|
+
else:
|
542
|
+
region = "us-central1"
|
543
|
+
console.print(f"Using default region: {region}")
|
544
|
+
else:
|
545
|
+
console.print(f"Using provided region: {region}")
|
510
546
|
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
console.print("- Set up development environment infrastructure")
|
518
|
-
console.print("- Configure basic CI/CD triggers for PR checks and deployments")
|
519
|
-
console.print(
|
520
|
-
"- Configure remote Terraform state in GCS (use --local-state to use local state instead)"
|
521
|
-
)
|
547
|
+
# Auto-detect CI/CD runner based on Terraform files (moved earlier)
|
548
|
+
tf_dir = Path("deployment/terraform")
|
549
|
+
is_github_actions = (tf_dir / "wif.tf").exists() and (tf_dir / "github.tf").exists()
|
550
|
+
cicd_runner = "github_actions" if is_github_actions else "google_cloud_build"
|
551
|
+
|
552
|
+
display_intro_message()
|
522
553
|
|
523
554
|
console.print("\n⚡ Production Setup Note:", style="bold yellow")
|
524
555
|
console.print(
|
@@ -537,28 +568,6 @@ def setup_cicd(
|
|
537
568
|
console.print("\n🛑 Setup cancelled by user", style="bold yellow")
|
538
569
|
return
|
539
570
|
|
540
|
-
console.print(
|
541
|
-
"This command helps set up a basic CI/CD pipeline for development and testing purposes."
|
542
|
-
)
|
543
|
-
console.print("It will:")
|
544
|
-
console.print("- Create a GitHub repository and connect it to Cloud Build")
|
545
|
-
console.print("- Set up development environment infrastructure")
|
546
|
-
console.print("- Configure basic CI/CD triggers for PR checks and deployments")
|
547
|
-
console.print(
|
548
|
-
"- Configure remote Terraform state in GCS (use --local-state to use local state instead)"
|
549
|
-
)
|
550
|
-
|
551
|
-
console.print("\n⚡ Production Setup Note:", style="bold yellow")
|
552
|
-
console.print(
|
553
|
-
"For production deployments and maximum flexibility, we recommend following"
|
554
|
-
)
|
555
|
-
console.print("the manual setup instructions in deployment/README.md")
|
556
|
-
console.print("This will give you more control over:")
|
557
|
-
console.print("- Security configurations")
|
558
|
-
console.print("- Custom deployment workflows")
|
559
|
-
console.print("- Environment-specific settings")
|
560
|
-
console.print("- Advanced CI/CD pipeline customization\n")
|
561
|
-
|
562
571
|
if debug:
|
563
572
|
logging.basicConfig(level=logging.DEBUG)
|
564
573
|
console.print("> Debug mode enabled")
|
File without changes
|
{agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/entry_points.txt
RENAMED
File without changes
|
{agent_starter_pack-0.11.1.dist-info → agent_starter_pack-0.11.2.dist-info}/licenses/LICENSE
RENAMED
File without changes
|