Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(crater): update ubuntu image of agents #599

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

MarcoIeni
Copy link
Member

Is terraform apply enough? Will all the instances be replaced? I don't know how crater works

plan:

  # google_compute_instance_template.agent["c2d-highcpu-8"] must be replaced
+/- resource "google_compute_instance_template" "agent" {
      ~ id                   = "projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549459800000001" -> (known after apply)
      - labels               = {} -> null
      ~ metadata_fingerprint = "aUIYehI4xwA=" -> (known after apply)
      ~ name                 = "crater-agent-20240903093549459800000001" -> (known after apply)
      + region               = (known after apply)
      ~ self_link            = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549459800000001" -> (known after apply)
      ~ self_link_unique     = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549459800000001?uniqueId=2883057209250113178" -> (known after apply)
      - tags                 = [] -> null
      + tags_fingerprint     = (known after apply)
        # (8 unchanged attributes hidden)

      ~ disk {
          ~ device_name           = "persistent-disk-0" -> (known after apply)
          ~ interface             = "SCSI" -> (known after apply)
          - labels                = {} -> null
          ~ mode                  = "READ_WRITE" -> (known after apply)
          ~ provisioned_iops      = 0 -> (known after apply)
          - resource_manager_tags = {} -> null
          - resource_policies     = [] -> null
          ~ source_image          = "projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2204-jammy-v20240829" -> "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2404-noble-amd64-v20241001" # forces replacement
          ~ type                  = "PERSISTENT" -> (known after apply)
            # (4 unchanged attributes hidden)
        }

      ~ network_interface {
          ~ internal_ipv6_prefix_length = 0 -> (known after apply)
          + ipv6_access_type            = (known after apply)
          + ipv6_address                = (known after apply)
          ~ name                        = "nic0" -> (known after apply)
          ~ network                     = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/networks/crater" -> "crater"
          - queue_count                 = 0 -> null
          + stack_type                  = (known after apply)
          + subnetwork                  = (known after apply)
          + subnetwork_project          = (known after apply)

          ~ access_config {
              + nat_ip                 = (known after apply)
              ~ network_tier           = "PREMIUM" -> (known after apply)
              + public_ptr_domain_name = (known after apply)
            }
        }

      ~ scheduling {
          - instance_termination_action = "STOP" -> null # forces replacement
          - min_node_cpus               = 0 -> null
          ~ on_host_maintenance         = "TERMINATE" -> (known after apply)
            # (3 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # google_compute_instance_template.agent["n2d-highcpu-16"] must be replaced
+/- resource "google_compute_instance_template" "agent" {
      ~ id                   = "projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549460900000002" -> (known after apply)
      - labels               = {} -> null
      ~ metadata_fingerprint = "aUIYehI4xwA=" -> (known after apply)
      ~ name                 = "crater-agent-20240903093549460900000002" -> (known after apply)
      + region               = (known after apply)
      ~ self_link            = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549460900000002" -> (known after apply)
      ~ self_link_unique     = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549460900000002?uniqueId=6169639138463803034" -> (known after apply)
      - tags                 = [] -> null
      + tags_fingerprint     = (known after apply)
        # (8 unchanged attributes hidden)

      ~ disk {
          ~ device_name           = "persistent-disk-0" -> (known after apply)
          ~ interface             = "SCSI" -> (known after apply)
          - labels                = {} -> null
          ~ mode                  = "READ_WRITE" -> (known after apply)
          ~ provisioned_iops      = 0 -> (known after apply)
          - resource_manager_tags = {} -> null
          - resource_policies     = [] -> null
          ~ source_image          = "projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2204-jammy-v20240829" -> "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2404-noble-amd64-v20241001" # forces replacement
          ~ type                  = "PERSISTENT" -> (known after apply)
            # (4 unchanged attributes hidden)
        }

      ~ network_interface {
          ~ internal_ipv6_prefix_length = 0 -> (known after apply)
          + ipv6_access_type            = (known after apply)
          + ipv6_address                = (known after apply)
          ~ name                        = "nic0" -> (known after apply)
          ~ network                     = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/networks/crater" -> "crater"
          - queue_count                 = 0 -> null
          + stack_type                  = (known after apply)
          + subnetwork                  = (known after apply)
          + subnetwork_project          = (known after apply)

          ~ access_config {
              + nat_ip                 = (known after apply)
              ~ network_tier           = "PREMIUM" -> (known after apply)
              + public_ptr_domain_name = (known after apply)
            }
        }

      ~ scheduling {
          - instance_termination_action = "STOP" -> null # forces replacement
          - min_node_cpus               = 0 -> null
          ~ on_host_maintenance         = "TERMINATE" -> (known after apply)
            # (3 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # google_compute_region_instance_group_manager.agents["us-central1-c2d"] will be updated in-place
  ~ resource "google_compute_region_instance_group_manager" "agents" {
        id                               = "projects/rust-crater/regions/us-central1/instanceGroupManagers/crater-agents-us-central1-c2d"
        name                             = "crater-agents-us-central1-c2d"
        # (15 unchanged attributes hidden)

      ~ version {
          ~ instance_template = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549459800000001" -> (known after apply)
        }

        # (3 unchanged blocks hidden)
    }

  # google_compute_region_instance_group_manager.agents["us-central1-n2d"] will be updated in-place
  ~ resource "google_compute_region_instance_group_manager" "agents" {
        id                               = "projects/rust-crater/regions/us-central1/instanceGroupManagers/crater-agents-us-central1-n2d"
        name                             = "crater-agents-us-central1-n2d"
        # (15 unchanged attributes hidden)

      ~ version {
          ~ instance_template = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549460900000002" -> (known after apply)
        }

        # (3 unchanged blocks hidden)
    }

  # google_compute_region_instance_group_manager.agents["us-east1-n2d"] will be updated in-place
  ~ resource "google_compute_region_instance_group_manager" "agents" {
        id                               = "projects/rust-crater/regions/us-east5/instanceGroupManagers/crater-agents-us-east1-n2d"
        name                             = "crater-agents-us-east1-n2d"
        # (15 unchanged attributes hidden)

      ~ version {
          ~ instance_template = "https://www.googleapis.com/compute/v1/projects/rust-crater/global/instanceTemplates/crater-agent-20240903093549460900000002" -> (known after apply)
        }

        # (3 unchanged blocks hidden)
    }

Plan: 2 to add, 3 to change, 2 to destroy.

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just applying should be enough.

@MarcoIeni
Copy link
Member Author

applied

@MarcoIeni MarcoIeni merged commit e111d59 into master Oct 7, 2024
3 checks passed
@MarcoIeni MarcoIeni deleted the chore-crater-update-ubuntu-image-of-agents branch October 7, 2024 12:26
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Oct 7, 2024

It looks like this broke Crater GCP instance startup due to awscli no longer being installable, needing a patch something like this:

diff --git a/terraform/crater/startup-script.sh b/terraform/crater/startup-script.sh
index 7c82bc4..761864b 100644
--- a/terraform/crater/startup-script.sh
+++ b/terraform/crater/startup-script.sh
@@ -5,7 +5,12 @@ set -euo pipefail
 mkdir -p /opt
 cd /opt
 sudo apt update
-sudo apt install -y vim jq docker.io awscli
+sudo apt install -y vim jq docker.io
+
+# Install aws cli per instructions (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
+curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
+unzip awscliv2.zip
+sudo ./aws/install

 sudo systemctl unmask docker.service
 sudo systemctl start docker.service

However I've not managed to test this as terraform is giving me errors:

│ Error: Error when reading or editing ComputeHealthCheck "projects/rust-crater/global/healthChecks/crater-agent-health-check": Get "https://compute.googleapis.com/compute/v1/projects/rust-crater/global/healthChecks/crater-agent-health-check?alt=json": oauth2: "invalid_grant" "Bad Request"

Not sure what's up with these, I tried logging in again but it didn't seem to help. We should probably revert.

@MarcoIeni
Copy link
Member Author

applied #603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants