cs-image-system-gcloud-runtime-plugin 0.1.5__tar.gz → 0.1.6__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.
Files changed (16) hide show
  1. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/.gitignore +2 -0
  2. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/PKG-INFO +4 -4
  3. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/pyproject.toml +4 -4
  4. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/gcp_runtime_builders.py +22 -0
  5. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/LICENSE +0 -0
  6. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/README.md +0 -0
  7. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/__init__.py +0 -0
  8. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/bootstrap.py +0 -0
  9. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/gcp_packer_source.py +0 -0
  10. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/gcp_provider_specific_image.py +0 -0
  11. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/gcp_runtime_models.py +0 -0
  12. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/gcp_utils.py +0 -0
  13. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/gcloud_runtime/main.py +0 -0
  14. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/src/cs_image_system/py.typed +0 -0
  15. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/tests/test_gcp_provider_specific_image.py +0 -0
  16. {cs_image_system_gcloud_runtime_plugin-0.1.5 → cs_image_system_gcloud_runtime_plugin-0.1.6}/tests/test_gcp_utils.py +0 -0
@@ -13,6 +13,8 @@ build/
13
13
  .venv/
14
14
  .DS_Store
15
15
  packages/**/*.code-workspace
16
+ # the IDE rewrites the root workspace file whenever folders are opened: it is the editor's, not the repository's (hygiene XXI)
17
+ /*.code-workspace
16
18
  trial
17
19
  tfmodules/tftest
18
20
  YAML_DUMP.yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cs-image-system-gcloud-runtime-plugin
3
- Version: 0.1.5
3
+ Version: 0.1.6
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,9 +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-base==0.1.5
13
- Requires-Dist: cs-image-system-contract==0.1.5
14
- Requires-Dist: cs-image-system-hashicorp-utils==0.1.5
12
+ Requires-Dist: cs-image-system-base==0.1.6
13
+ Requires-Dist: cs-image-system-contract==0.1.6
14
+ Requires-Dist: cs-image-system-hashicorp-utils==0.1.6
15
15
  Requires-Dist: google-api-core>=2.31
16
16
  Requires-Dist: google-auth>=2.55
17
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.5"
7
+ version = "0.1.6"
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,9 +12,9 @@ license = "Apache-2.0"
12
12
  license-files = ["LICENSE"]
13
13
  requires-python = ">=3.13"
14
14
  dependencies = [
15
- "cs-image-system-contract==0.1.5",
16
- "cs-image-system-base==0.1.5",
17
- "cs-image-system-hashicorp-utils==0.1.5",
15
+ "cs-image-system-contract==0.1.6",
16
+ "cs-image-system-base==0.1.6",
17
+ "cs-image-system-hashicorp-utils==0.1.6",
18
18
  "google-cloud-compute>=1.49",
19
19
  "google-api-core>=2.31",
20
20
  "google-auth>=2.55",
@@ -160,6 +160,28 @@ class GCPCloudBuilder(CloudBuilderBase[GCPCloudBuilderModel], PluginArtifactProt
160
160
  return f"GCE label keys must start with a lowercase letter; {key!r} becomes {label!r}"
161
161
  return None
162
162
 
163
+ def image_name_as_made(self, name: str) -> str:
164
+ """What GCE makes of a build name (stage 105): ``gce_name`` --
165
+ lowercase, dashes for what it cannot keep, a letter first, at most
166
+ 63 characters -- the name the packer source writes."""
167
+ from .gcp_packer_source import gce_name
168
+ return gce_name(name)
169
+
170
+ def image_name_problem(self, name: str) -> str | None:
171
+ """Why a build's full name cannot be a GCE image name (stage 105):
172
+ only its length. ``gce_name`` can lowercase and rewrite, but it
173
+ shortens by cutting the end, where the timestamp is, so a name
174
+ longer than 63 characters once rewritten would lose what keeps
175
+ builds apart."""
176
+ import re
177
+ made = re.sub(r"[^a-z0-9-]+", "-", str(name).lower()).strip("-")
178
+ if made and not made[0].isalpha():
179
+ made = f"i-{made}"
180
+ if len(made) > 63:
181
+ return (f"a GCE image name is at most 63 characters; {name!r} becomes {made!r} "
182
+ f"({len(made)}) and would be cut where the timestamp is")
183
+ return None
184
+
163
185
  def one_bake_user_per_chain(self) -> bool:
164
186
  return True # finding 43
165
187