cs-image-system-gcloud-runtime-plugin 0.1.2__tar.gz → 0.1.4__tar.gz
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.
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/PKG-INFO +4 -3
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/pyproject.toml +4 -3
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/gcp_packer_source.py +1 -1
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/gcp_runtime_builders.py +12 -12
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/gcp_runtime_models.py +4 -8
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/gcp_utils.py +4 -4
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/main.py +1 -2
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/.gitignore +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/LICENSE +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/README.md +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/__init__.py +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/bootstrap.py +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/gcloud_runtime/gcp_provider_specific_image.py +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/src/cs_image_system/py.typed +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/tests/test_gcp_provider_specific_image.py +0 -0
- {cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/tests/test_gcp_utils.py +0 -0
{cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: cs-image-system-gcloud-runtime-plugin
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: The gcloud runtime type: Google Compute Engine as a place where images bake and instances run
|
|
5
5
|
Project-URL: Repository, https://github.com/infrastructurebuilder/cs-image-system-3
|
|
6
6
|
Project-URL: Documentation, https://github.com/infrastructurebuilder/cs-image-system-3/blob/develop/docs/OPERATIONS.md
|
|
@@ -9,8 +9,9 @@ Author-email: Mykel Alvis <mykelalvis@infrastructurebuilder.org>
|
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Requires-Python: >=3.13
|
|
12
|
-
Requires-Dist: cs-image-system-
|
|
13
|
-
Requires-Dist: cs-image-system-
|
|
12
|
+
Requires-Dist: cs-image-system-base==0.1.4
|
|
13
|
+
Requires-Dist: cs-image-system-contract==0.1.4
|
|
14
|
+
Requires-Dist: cs-image-system-hashicorp-utils==0.1.4
|
|
14
15
|
Requires-Dist: google-api-core>=2.31
|
|
15
16
|
Requires-Dist: google-auth>=2.55
|
|
16
17
|
Requires-Dist: google-cloud-compute>=1.49
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cs-image-system-gcloud-runtime-plugin"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.4"
|
|
8
8
|
description = "The gcloud runtime type: Google Compute Engine as a place where images bake and instances run"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Mykel Alvis", email = "mykelalvis@infrastructurebuilder.org" }]
|
|
@@ -12,8 +12,9 @@ license = "Apache-2.0"
|
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
requires-python = ">=3.13"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"cs-image-system-
|
|
16
|
-
"cs-image-system-
|
|
15
|
+
"cs-image-system-contract==0.1.4",
|
|
16
|
+
"cs-image-system-base==0.1.4",
|
|
17
|
+
"cs-image-system-hashicorp-utils==0.1.4",
|
|
17
18
|
"google-cloud-compute>=1.49",
|
|
18
19
|
"google-api-core>=2.31",
|
|
19
20
|
"google-auth>=2.55",
|
|
@@ -26,7 +26,7 @@ from typing import Any
|
|
|
26
26
|
import hcl2
|
|
27
27
|
from hcl2 import Builder
|
|
28
28
|
|
|
29
|
-
from cs_image_system.
|
|
29
|
+
from cs_image_system.contract.constants import OOPS_DEFAULTS, SELF
|
|
30
30
|
from cs_image_system.hashicorp_utils.hashicorp import FO
|
|
31
31
|
|
|
32
32
|
log = logging.getLogger(__name__)
|
|
@@ -8,14 +8,14 @@ from typing import Any
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
from cs_image_system.base.basic.abstract_version_checker import AbstractVersionChecker
|
|
11
|
-
from cs_image_system.
|
|
11
|
+
from cs_image_system.contract.assets import AssetSet
|
|
12
12
|
from cs_image_system.base.basic.builder_base_cloud import CloudBuilderBase
|
|
13
|
-
from cs_image_system.
|
|
14
|
-
from cs_image_system.
|
|
13
|
+
from cs_image_system.contract.constants import VCT
|
|
14
|
+
from cs_image_system.contract.lifecycle import ExecutionLifecyclePhase
|
|
15
15
|
from cs_image_system.base.models.os_builder_runtime_config import OSBuilderBaseImageBuilderSubconfig
|
|
16
16
|
from cs_image_system.base.models.provider_specific_image import ProviderSpecificImage
|
|
17
17
|
from cs_image_system.base import power_state
|
|
18
|
-
from cs_image_system.
|
|
18
|
+
from cs_image_system.contract.core import PluginArtifactProtocol
|
|
19
19
|
|
|
20
20
|
from .gcp_provider_specific_image import GcpProviderSpecificImage
|
|
21
21
|
from .gcp_runtime_models import GCPCloudBuilderModel
|
|
@@ -208,13 +208,13 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
|
|
|
208
208
|
def serial_console(self, instance_name: str) -> str:
|
|
209
209
|
"""The instance's serial port 1 output (read-only)."""
|
|
210
210
|
from .gcp_packer_source import gce_name
|
|
211
|
-
from .gcp_utils import
|
|
211
|
+
from .gcp_utils import make_credentials, resolve_project
|
|
212
212
|
from google.cloud import compute_v1 # noqa: PLC0415
|
|
213
213
|
cfg = self.model.self_to_gcp_client_config()
|
|
214
214
|
project, zone = resolve_project(cfg), getattr(self.model, "zone", None)
|
|
215
215
|
if not project or not zone:
|
|
216
216
|
raise RuntimeError(f"GCP runtime {self.get_name()}: no project/zone to read a serial console")
|
|
217
|
-
creds =
|
|
217
|
+
creds = make_credentials(cfg)
|
|
218
218
|
kw = {"credentials": creds} if creds else {}
|
|
219
219
|
out = compute_v1.InstancesClient(**kw).get_serial_port_output(
|
|
220
220
|
project=project, zone=zone, instance=gce_name(instance_name))
|
|
@@ -354,12 +354,12 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
|
|
|
354
354
|
93), so the emptiness check counts this configuration's alone."""
|
|
355
355
|
import subprocess # noqa: PLC0415
|
|
356
356
|
from google.cloud import compute_v1 # noqa: PLC0415
|
|
357
|
-
from .gcp_utils import
|
|
357
|
+
from .gcp_utils import make_credentials, resolve_project
|
|
358
358
|
cfg = self.model.self_to_gcp_client_config()
|
|
359
359
|
project, zone = resolve_project(cfg), getattr(self.model, "zone", None)
|
|
360
360
|
if not project or not zone:
|
|
361
361
|
raise RuntimeError(f"GCP runtime {self.get_name()}: no project/zone to inventory")
|
|
362
|
-
creds =
|
|
362
|
+
creds = make_credentials(cfg)
|
|
363
363
|
kw = {"credentials": creds} if creds else {}
|
|
364
364
|
from cs_image_system.base.lineage import CONFIG_TAG
|
|
365
365
|
owners: dict[str, dict[str, str]] = {"instances": {}, "images": {}, "disks": {}, "buckets": {}}
|
|
@@ -440,7 +440,7 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
|
|
|
440
440
|
Read-only; None when the instance, disk, zone or project cannot be
|
|
441
441
|
resolved, so the caller makes no claim."""
|
|
442
442
|
from .gcp_packer_source import gce_name
|
|
443
|
-
from .gcp_utils import
|
|
443
|
+
from .gcp_utils import make_credentials, resolve_project
|
|
444
444
|
try:
|
|
445
445
|
from google.cloud import compute_v1 # noqa: PLC0415
|
|
446
446
|
cfg = self.model.self_to_gcp_client_config()
|
|
@@ -448,7 +448,7 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
|
|
|
448
448
|
zone = getattr(self.model, "zone", None)
|
|
449
449
|
if not project or not zone:
|
|
450
450
|
return None
|
|
451
|
-
creds =
|
|
451
|
+
creds = make_credentials(cfg)
|
|
452
452
|
kw = {"credentials": creds} if creds else {}
|
|
453
453
|
inst = compute_v1.InstancesClient(**kw).get(project=project, zone=zone,
|
|
454
454
|
instance=gce_name(instance_name))
|
|
@@ -486,13 +486,13 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
|
|
|
486
486
|
def _instances_client(self):
|
|
487
487
|
"""(client, project, zone) for instance calls, or None when the
|
|
488
488
|
runtime is not resolvable."""
|
|
489
|
-
from .gcp_utils import
|
|
489
|
+
from .gcp_utils import make_credentials, resolve_project
|
|
490
490
|
from google.cloud import compute_v1 # noqa: PLC0415
|
|
491
491
|
cfg = self.model.self_to_gcp_client_config()
|
|
492
492
|
project, zone = resolve_project(cfg), getattr(self.model, "zone", None)
|
|
493
493
|
if not project or not zone:
|
|
494
494
|
return None
|
|
495
|
-
creds =
|
|
495
|
+
creds = make_credentials(cfg)
|
|
496
496
|
kw = {"credentials": creds} if creds else {}
|
|
497
497
|
return compute_v1.InstancesClient(**kw), str(project), str(zone)
|
|
498
498
|
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
from dataclasses import field
|
|
6
|
-
from cs_image_system.
|
|
6
|
+
from cs_image_system.contract.model_config import CSIS_MODEL_CONFIG
|
|
7
7
|
from pydantic.dataclasses import dataclass # stage 23: validation at construction
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
10
|
import logging
|
|
11
11
|
|
|
12
12
|
from cs_image_system.gcloud_runtime import gcp_utils
|
|
13
|
-
from cs_image_system.
|
|
13
|
+
from cs_image_system.contract.fields import fk_field, parent_field
|
|
14
14
|
log = logging.getLogger(__name__)
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
from cs_image_system.
|
|
17
|
+
from cs_image_system.contract.constants import DEFAULT, OOPS_DEFAULTS, VCT
|
|
18
18
|
from cs_image_system.base.models.cloud_builder import CloudBuilderModel, CloudNetworkingConfig
|
|
19
19
|
|
|
20
20
|
|
|
@@ -27,11 +27,7 @@ class GCPCloudNetworkingModel(CloudNetworkingConfig):
|
|
|
27
27
|
# closest GCP analog to AWS security group ids.
|
|
28
28
|
network_tags: list[str] = field(default_factory=list)
|
|
29
29
|
|
|
30
|
-
_model_id: str | None =
|
|
31
|
-
init=False,
|
|
32
|
-
default=None, metadata={
|
|
33
|
-
"description": "The name of the runtime model this object is associated with",
|
|
34
|
-
})
|
|
30
|
+
_model_id: str | None = parent_field(VCT.RUNTIME_BUILDER_MODEL, description="The name of the runtime model this object is associated with")
|
|
35
31
|
|
|
36
32
|
def __post_init__(self) -> None:
|
|
37
33
|
super().__post_init__()
|
|
@@ -15,7 +15,7 @@ from typing import Any, Sequence, cast
|
|
|
15
15
|
from google.api_core import exceptions as gcp_exceptions
|
|
16
16
|
from google.cloud import compute_v1
|
|
17
17
|
|
|
18
|
-
from cs_image_system.
|
|
18
|
+
from cs_image_system.contract.constants import SELF
|
|
19
19
|
from cs_image_system.base.models.os_builder_runtime_config import OSBuilderBaseImageBuilderSubconfig
|
|
20
20
|
|
|
21
21
|
log = logging.getLogger(__name__)
|
|
@@ -125,7 +125,7 @@ def _generic_architecture(value: Any) -> str:
|
|
|
125
125
|
return v if v in ("x86_64", "arm64") else "x86_64"
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
def
|
|
128
|
+
def make_credentials(session_config: Mapping[str, Any]) -> Any | None:
|
|
129
129
|
creds_cfg = session_config.get("credentials") or {}
|
|
130
130
|
key_file = creds_cfg.get("service_account_key_file")
|
|
131
131
|
if key_file:
|
|
@@ -136,7 +136,7 @@ def _make_credentials(session_config: Mapping[str, Any]) -> Any | None:
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
def _make_images_client(session_config: Mapping[str, Any]) -> compute_v1.ImagesClient:
|
|
139
|
-
creds =
|
|
139
|
+
creds = make_credentials(session_config)
|
|
140
140
|
return compute_v1.ImagesClient(credentials=creds) if creds else compute_v1.ImagesClient()
|
|
141
141
|
|
|
142
142
|
|
|
@@ -429,7 +429,7 @@ def get_network_map_and_default_network(
|
|
|
429
429
|
"the GCP runtime."
|
|
430
430
|
)
|
|
431
431
|
try:
|
|
432
|
-
creds =
|
|
432
|
+
creds = make_credentials(session_config)
|
|
433
433
|
kwargs: dict[str, Any] = {"credentials": creds} if creds else {}
|
|
434
434
|
clients = clients or {}
|
|
435
435
|
networks_client = clients.get("networks") or compute_v1.NetworksClient(**kwargs)
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
import logging
|
|
6
6
|
|
|
7
7
|
from cs_image_system.base.basic.abstract_plugin_metadata import AbstractPluginMetadata
|
|
8
|
-
from cs_image_system.base.protocols.plugin_metadata import PluginMetadataProtocol
|
|
9
8
|
from .gcp_runtime_builders import GCP_RUNTIME, GCPCLIVersionChecker, GCPCloudBuilder
|
|
10
9
|
from .gcp_runtime_models import GCPCloudBuilderModel
|
|
11
10
|
|
|
12
11
|
log = logging.getLogger(__name__)
|
|
13
12
|
|
|
14
|
-
class GcpRuntimePluginMetadata(AbstractPluginMetadata
|
|
13
|
+
class GcpRuntimePluginMetadata(AbstractPluginMetadata):
|
|
15
14
|
def __init__(self) -> None:
|
|
16
15
|
super().__init__( "1", "3.13",
|
|
17
16
|
{GCP_RUNTIME: [
|
|
File without changes
|
{cs_image_system_gcloud_runtime_plugin-0.1.2 → cs_image_system_gcloud_runtime_plugin-0.1.4}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|