Skip to content

Commit

Permalink
[custom-images] allowing rocky but no longer centos for image versions (
Browse files Browse the repository at this point in the history
#87)

* [custom-images] allowing rocky but no longer centos for image versions

* included documentation in Dockerfile from README.md ; updated README.md
  • Loading branch information
cjac authored Jul 26, 2024
1 parent 8d1dd23 commit a67f63f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# since this script depends on python 2.7, we need a stable base from which to run it
FROM python:2.7-slim

# To build: docker build -t dataproc-custom-images:latest .
# To run: docker run -it dataproc-custom-images:latest /bin/bash

# and then from the docker bash shell, run the
# generate_custom_image.py as per examples/secure-boot/README.md

# python generate_custom_image.py \
# --image-name ${image_name} \
# --dataproc-version ${dataproc_version} \
# --trusted-cert "tls/db.der" \
# --customization-script ${customization_script} \
# --metadata "${metadata}" \
# --zone "${custom_image_zone}" \
# --disk-size "${disk_size_gb}" \
# --no-smoke-test \
# --gcs-bucket "${my_bucket}"

WORKDIR /custom-images

RUN apt-get update && apt-get -y install apt-transport-https ca-certificates gnupg curl
Expand Down
2 changes: 1 addition & 1 deletion custom_image_utils/args_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
_VERSION_REGEX = re.compile(r"^\d+\.\d+\.\d+(-RC\d+)?(-[a-z]+\d+)?$")
_FULL_IMAGE_URI = re.compile(r"^(https://www\.googleapis\.com/compute/([^/]+)/)?projects/([^/]+)/global/images/([^/]+)$")
_FULL_IMAGE_FAMILY_URI = re.compile(r"^(https://www\.googleapis\.com/compute/([^/]+)/)?projects/([^/]+)/global/images/family/([^/]+)$")
_LATEST_FROM_MINOR_VERSION = re.compile(r"^(\d+)\.(\d+)-((?:debian|ubuntu|centos)\d+)$")
_LATEST_FROM_MINOR_VERSION = re.compile(r"^(\d+)\.(\d+)-((?:debian|ubuntu|rocky)\d+)$")

def _version_regex_type(s):
"""Check if version string matches regex."""
Expand Down
8 changes: 5 additions & 3 deletions examples/secure-boot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ metadata="${metadata},private_secret_name=${private_secret_name}"
metadata="${metadata},secret_project=${secret_project}"
metadata="${metadata},secret_version=${secret_version}"

#dataproc_version=2.1-debian11
#dataproc_version=2.2-rocky9
#dataproc_version=2.2-ubuntu22
dataproc_version=2.2-debian12
#customization_script=examples/secure-boot/install-nvidia-driver-debian11.sh
customization_script=examples/secure-boot/install-nvidia-driver-debian12.sh
#image_name="nvidia-open-kernel-bullseye-$(date +%F)"
image_name="nvidia-open-kernel-bookworm-$(date +%F)"
#image_name="nvidia-open-kernel-2.2-ubuntu22-$(date +%F)"
#image_name="nvidia-open-kernel-2.2-rocky9-$(date +%F)"
image_name="nvidia-open-kernel-2.2-debian12-$(date +%F)"
disk_size_gb="50"

python generate_custom_image.py \
Expand Down

0 comments on commit a67f63f

Please sign in to comment.