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

Develop and adopt boot-time fix for EOL CentOS 7 repositories #2738

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/compute/vm-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ limitations under the License.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_netstorage_startup_script"></a> [netstorage\_startup\_script](#module\_netstorage\_startup\_script) | github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script | v1.35.0&depth=1 |
| <a name="module_netstorage_startup_script"></a> [netstorage\_startup\_script](#module\_netstorage\_startup\_script) | github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script | b83107e0 |

## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ locals {
}

module "netstorage_startup_script" {
source = "github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script?ref=v1.35.0&depth=1"
source = "github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script?ref=b83107e0"

labels = local.labels
project_id = var.project_id
Expand Down
2 changes: 1 addition & 1 deletion modules/scheduler/batch-job-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ limitations under the License.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_instance_template"></a> [instance\_template](#module\_instance\_template) | terraform-google-modules/vm/google//modules/instance_template | ~> 10.1.1 |
| <a name="module_netstorage_startup_script"></a> [netstorage\_startup\_script](#module\_netstorage\_startup\_script) | github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script | v1.35.0&depth=1 |
| <a name="module_netstorage_startup_script"></a> [netstorage\_startup\_script](#module\_netstorage\_startup\_script) | github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script | b83107e0 |

## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ locals {
}

module "netstorage_startup_script" {
source = "github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script?ref=v1.35.0&depth=1"
source = "github.com/GoogleCloudPlatform/hpc-toolkit//modules/scripts/startup-script?ref=b83107e0"

labels = local.labels
project_id = var.project_id
Expand Down
32 changes: 32 additions & 0 deletions modules/scripts/startup-script/files/early_run_hotfixes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script applies fixes to VMs that must occur early in boot. For example,
# when yum or apt repositories are misconfigured, preventing most package
# operations from completing successfully.

source /etc/os-release

if [[ "$PRETTY_NAME" == "CentOS Linux 7 (Core)" ]]; then
echo "Applying hotfixes for CentOS 7"
if grep -q '^mirrorlist' /etc/yum.repos.d/CentOS-Base.repo; then
tpdownes marked this conversation as resolved.
Show resolved Hide resolved
echo "Removing mirrorlist from default CentOS 7 repositories"
sed -i '/^mirrorlist/d' /etc/yum.repos.d/CentOS-Base.repo
fi
if grep -q '^#baseurl=http://mirror.centos.org' /etc/yum.repos.d/CentOS-Base.repo; then
echo "Reconfiguring default CentOS 7 repositories to use CentOS Vault"
sed -i 's,^#baseurl=http://mirror.centos.org/,baseurl=http://vault.centos.org/,' /etc/yum.repos.d/CentOS-Base.repo
fi
fi
7 changes: 7 additions & 0 deletions modules/scripts/startup-script/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ locals {
args = var.ansible_virtualenv_path
}] : []

hotfix_runner = [{
type = "shell"
source = "${path.module}/files/early_run_hotfixes.sh"
destination = "early_run_hotfixes.sh"
}]

runners = concat(
local.warnings,
local.hotfix_runner,
local.proxy_runner,
local.monitoring_agent_installer,
local.ansible_installer,
Expand Down
2 changes: 1 addition & 1 deletion tools/cloud-build/daily-tests/blueprints/lustre-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ deployment_groups:
name_prefix: centos
add_deployment_name_before_prefix: true
instance_image:
family: centos-7
name: centos-7-v20240611
project: centos-cloud
- id: wait-centos
source: community/modules/scripts/wait-for-startup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ deployment_groups:
- homefs
settings:
instance_image:
family: centos-7
name: centos-7-v20240611
project: centos-cloud
name_prefix: workstation-centos
instance_count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ deployment_groups:
name_prefix: centos
instance_count: 1
instance_image:
family: centos-7
name: centos-7-v20240611
project: centos-cloud
- id: wait-centos
source: community/modules/scripts/wait-for-startup
Expand Down
Loading