kubernetes-sigs / image-builder

Tools for building Kubernetes disk images
https://image-builder.sigs.k8s.io/
Apache License 2.0
372 stars 379 forks source link

RHEL 8 build broken for GCE #1516

Open mboersma opened 1 month ago

mboersma commented 1 month ago

Environment

Running the pull-image-builder-gcp-all target in CI failed on rhel-8. See #1515 for an example:

...
    googlecompute.rhel-8: TASK [providers : ansible.builtin.include_tasks] *******************************
    googlecompute.rhel-8: included: /home/prow/go/src/sigs.k8s.io/image-builder/images/capi/ansible/roles/providers/tasks/googlecompute.yml for default
    googlecompute.rhel-8:
    googlecompute.rhel-8: TASK [providers : Download gcloud SDK] *****************************************
    googlecompute.rhel-8: changed: [default]
    googlecompute.rhel-8:
    googlecompute.rhel-8: TASK [providers : Execute install-gcloud.sh] ***********************************
    googlecompute.rhel-8: fatal: [default]: FAILED! => {"changed": true, "cmd": "bash -o errexit -o pipefail /tmp/install-gcloud.sh --disable-prompts --install-dir=/", "delta": "0:00:06.086712", "end": "2024-07-18 21:05:22.335836", "msg": "non-zero return code", "rc": 1, "start": "2024-07-18 21:05:16.249124", "stderr": "#=#=#                                                                         \r\r######################################################################## 100.0%\nwhich curl\ncurl -# -f https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz\n#=#=#                                                                         \r\r                                                                           0.3%\r######################################################################## 100.0%\nmkdir -p /\ntar -C / -zxvf /tmp/tmp.x2lbfShoyl/google-cloud-sdk.tar.gz\n//google-cloud-sdk/install.sh\nWARNING:  Python 3.6.x is no longer officially supported by the Google Cloud CLI\nand may not function correctly. Please use Python version 3.8 and up.\n\nIf you have a compatible Python interpreter installed, you can use it by setting\nthe CLOUDSDK_PYTHON environment variable to point to it.\n\nTraceback (most recent call last):\n  File \"//google-cloud-sdk/bin/bootstrapping/install.py\", line 12, in \n    import bootstrapping\n  File \"/google-cloud-sdk/bin/bootstrapping/bootstrapping.py\", line 50, in \n    from googlecloudsdk.core.credentials import store as c_store\n  File \"/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py\", line 34, in \n    from googlecloudsdk.api_lib.auth import external_account as auth_external_account\n  File \"/google-cloud-sdk/lib/googlecloudsdk/api_lib/auth/external_account.py\", line 24, in \n    from googlecloudsdk.core.credentials import creds as c_creds\n  File \"/google-cloud-sdk/lib/googlecloudsdk/core/credentials/creds.py\", line 36, in \n    from google.auth import external_account as google_auth_external_account\n  File \"/google-cloud-sdk/lib/third_party/google/auth/external_account.py\", line 32, in \n    from dataclasses import dataclass\nModuleNotFoundError: No module named 'dataclasses'", "stderr_lines": ["#=#=#  
...
    googlecompute.rhel-8:
    googlecompute.rhel-8: PLAY RECAP *********************************************************************
    googlecompute.rhel-8: default                    : ok=18   changed=13   unreachable=0    failed=1    skipped=244  rescued=0    ignored=0
    googlecompute.rhel-8:
==> googlecompute.rhel-8: Provisioning step had errors: Running the cleanup provisioner, if present...
==> googlecompute.rhel-8: Deleting instance...
heartbeat sent for resource "k8s-infra-e2e-boskos-081"
    googlecompute.rhel-8: Instance has been deleted!
==> googlecompute.rhel-8: Deleting disk...
    googlecompute.rhel-8: Disk has been deleted!
Build 'googlecompute.rhel-8' errored after 7 minutes 26 seconds: Error executing Ansible: Non-zero exit status: exit status 2
==> Wait completed after 7 minutes 26 seconds
==> Some builds didn't complete successfully and had errors:
--> googlecompute.rhel-8: Error executing Ansible: Non-zero exit status: exit status 2
==> Builds finished but no artifacts were created.
make: *** [Makefile:480: build-gce-rhel-8] Error 1
mboersma commented 1 month ago

Seems to boil down to the RHEL 8 base image having Python 3.6, which won't work with gcloud any longer as it requires dataclasses which were added in 3.7.

We could either remove this build option from the gce-all target, or maybe install gcloud differently, through a versioned archive.