Skip to content

Commit

Permalink
PMM-12197 Fix update.yml workflow (#3060)
Browse files Browse the repository at this point in the history
Why
Currently, the update workflow fails on some PMM image version as yum can't reach some or all of RHEL repository mirrors.

In this PR we are working around the issue by changing the base URL to point to the archive.
  • Loading branch information
ademidoff committed Jul 8, 2024
1 parent b4b26e1 commit a8aa2e8
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions update/.devcontainer/install-dev-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,54 @@ set -o errexit
set -o xtrace

# download (in the background) the same verison as used by PMM build process
curl -sS https://dl.google.com/go/go1.22.2.linux-amd64.tar.gz -o /tmp/golang.tar.gz &
curl -sSL https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz -o /tmp/golang.tar.gz &

# to install man pages
sed -i '/nodocs/d' /etc/yum.conf

# enable experimental repository with latest development packages
sed -i'' -e 's^/release/^/experimental/^' /etc/yum.repos.d/pmm2-server.repo
percona-release enable original testing

RHEL=$(rpm --eval '%{rhel}')
if [ "$RHEL" = "7" ]; then
# this mirror always fails, on both AWS and github
echo "exclude=mirror.es.its.nyu.edu" >> /etc/yum/pluginconf.d/fastestmirror.conf
yum clean plugins
# https://stackoverflow.com/questions/26734777/yum-error-cannot-retrieve-metalink-for-repository-epel-please-verify-its-path
sed -i "s/metalink=https/metalink=http/" /etc/yum.repos.d/epel.repo
# disable fastestmirror plugin, which mostly fails due to CentOS 7 being EOL
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf

if [ "$PMM_SERVER_IMAGE" = "percona/pmm-server:2.0.0" ]; then
sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i -e 's/^#baseurl.*/baseurl=http:\/\/vault.centos.org\/centos\/$releasever\/os\/$basearch\//g' /etc/yum.repos.d/CentOS-Base.repo

# https://stackoverflow.com/questions/26734777/yum-error-cannot-retrieve-metalink-for-repository-epel-please-verify-its-path
yum --disablerepo=epel install -y ca-certificates-2020.2.41
yum install -y gcc-4.8.5 glibc-static-2.17.317
else
yum --disablerepo=epel update -y ca-certificates
yum --disablerepo="*" --enablerepo=base --enablerepo=updates install -y gcc glibc-static

sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i -e 's/^#baseurl.*/baseurl=http:\/\/vault.centos.org\/centos\/$releasever\/os\/$basearch\//g' /etc/yum.repos.d/CentOS-Base.repo
fi

yum clean all
yum makecache fast
fi

yum update -y percona-release
percona-release enable pmm2-client testing

# reinstall with man pages
yum install -y yum rpm
yum reinstall -y yum rpm

yum install -y gcc git make pkgconfig \
ansible \
yum install -y git make pkgconfig ansible \
mc tmux psmisc lsof which iproute \
bash-completion \
man man-pages

if [ "$RHEL" = '7' ]; then
yum install -y ansible-lint glibc-static bash-completion-extras
yum install -y ansible-lint bash-completion-extras
else
yum install -y ansible-lint glibc-static --enablerepo=ol9_codeready_builder
yum --enablerepo=ol9_codeready_builder install -y gcc glibc-static ansible-lint
fi

fg || true
Expand Down

0 comments on commit a8aa2e8

Please sign in to comment.