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

[BACKPORT to v0.9] Missing erlang packages #2185

Merged
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
3 changes: 2 additions & 1 deletion CHANGELOG-0.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### Fixed

- [#2049](https://github.com/epiphany-platform/epiphany/issues/2049) - Elasticsearch-curator installation fails on RedHat
- [#2131](https://github.com/epiphany-platform/epiphany/issues/2131) - [RedHat/CentOS] Erlang package versions specified in requirements are missing in external repository
- [#2166](https://github.com/epiphany-platform/epiphany/issues/2166) - Replace Bintray repository

## [0.9.0] 2021-01-19

Expand All @@ -30,7 +32,6 @@
- [#1884](https://github.com/epiphany-platform/epiphany/issues/1884) - Prometheus is not able to scrape metrics from AKS/EKS nodes
- [#1887](https://github.com/epiphany-platform/epiphany/issues/1887) - epicli upgrade of cluster created by Epiphany v0.6 fails on "Store preflight facts" task
- [#1866](https://github.com/epiphany-platform/epiphany/issues/1866) - No logs from K8s apps in Elasticsearch
- [#2166](https://github.com/epiphany-platform/epiphany/issues/2166) - Replace Bintray repository

### Updated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
- name: Install packages
apt:
name:
- logrotate

- erlang-eldap={{ versions.debian.erlang }}
- erlang-inets={{ versions.debian.erlang }}
- erlang-os-mon={{ versions.debian.erlang }}
- erlang-public-key={{ versions.debian.erlang }}
- erlang-ssl={{ versions.debian.erlang }}

# Additional dependencies required to fix https://github.com/epiphany-platform/epiphany/issues/1920
- erlang-asn1={{ versions.debian.erlang }}
- erlang-base-hipe={{ versions.debian.erlang }}
- erlang-base={{ versions.debian.erlang }}
- erlang-crypto={{ versions.debian.erlang }}
- erlang-eldap={{ versions.debian.erlang }}
- erlang-ftp={{ versions.debian.erlang }}
- erlang-inets={{ versions.debian.erlang }}
- erlang-mnesia={{ versions.debian.erlang }}
- erlang-os-mon={{ versions.debian.erlang }}
- erlang-parsetools={{ versions.debian.erlang }}
- erlang-public-key={{ versions.debian.erlang }}
- erlang-runtime-tools={{ versions.debian.erlang }}
- erlang-snmp={{ versions.debian.erlang }}
- erlang-ssl={{ versions.debian.erlang }}
- erlang-syntax-tools={{ versions.debian.erlang }}
- erlang-tftp={{ versions.debian.erlang }}
- erlang-tools={{ versions.debian.erlang }}
- erlang-xmerl={{ versions.debian.erlang }}

- logrotate
- rabbitmq-server={{ versions.debian.rabbitmq }}
update_cache: true
state: present
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,32 @@ remove_installed_packages() {
fi
}

remove_yum_cache_for_untracked_repos() {
local basearch releasever
basearch=$(uname --machine)
releasever=$(rpm -q --provides "$(rpm -q --whatprovides 'system-release(releasever)')" | grep "system-release(releasever)" | cut -d ' ' -f 3)
local cachedir find_output
cachedir=$(grep --only-matching --perl-regexp '(?<=^cachedir=)[^#\n]+' /etc/yum.conf)
cachedir="${cachedir/\$basearch/$basearch}"
cachedir="${cachedir/\$releasever/$releasever}"
find_output=$(find "$cachedir" -mindepth 1 -maxdepth 1 -type d -exec basename '{}' ';')
local -a repos_with_cache=()
if [ -n "$find_output" ]; then
readarray -t repos_with_cache <<< "$find_output"
fi
local all_repos_output
all_repos_output=$(yum repolist -v all | grep --only-matching --perl-regexp '(?<=^Repo-id)[^/]+' | sed -e 's/^[[:space:]:]*//')
local -a all_repos=()
readarray -t all_repos <<< "$all_repos_output"
if (( ${#repos_with_cache[@]} > 0 )); then
for cached_repo in "${repos_with_cache[@]}"; do
if ! _in_array "$cached_repo" "${all_repos[@]}"; then
run_cmd rm -rf "$cachedir/$cached_repo"
fi
done
fi
}

# params: <command to execute>
run_cmd() {
local cmd_arr=("$@")
Expand All @@ -349,6 +375,15 @@ usage() {
[ -z "$1" ] || exit "$1"
}

# params: <value to test> <array>
_in_array() {
local value=${1}
shift
local array=( "$@" )

(( ${#array[@]} > 0 )) && printf '%s\n' "${array[@]}" | grep -q -Fx "$value"
}

# === Start ===

[ $# -gt 0 ] || usage 1 >&2
Expand Down Expand Up @@ -600,6 +635,8 @@ if ! is_package_installed 'epel-release'; then
install_package 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' 'epel-release'
fi

run_cmd remove_yum_cache_for_untracked_repos

run_cmd yum -y makecache fast

# --- Download packages ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,32 @@ remove_installed_packages() {
fi
}

remove_yum_cache_for_untracked_repos() {
local basearch releasever
basearch=$(uname --machine)
releasever=$(rpm -q --provides "$(rpm -q --whatprovides 'system-release(releasever)')" | grep "system-release(releasever)" | cut -d ' ' -f 3)
local cachedir find_output
cachedir=$(grep --only-matching --perl-regexp '(?<=^cachedir=)[^#\n]+' /etc/yum.conf)
cachedir="${cachedir/\$basearch/$basearch}"
cachedir="${cachedir/\$releasever/$releasever}"
find_output=$(find "$cachedir" -mindepth 1 -maxdepth 1 -type d -exec basename '{}' ';')
local -a repos_with_cache=()
if [ -n "$find_output" ]; then
readarray -t repos_with_cache <<< "$find_output"
fi
local all_repos_output
all_repos_output=$(yum repolist -v all | grep --only-matching --perl-regexp '(?<=^Repo-id)[^/]+' | sed -e 's/^[[:space:]:]*//')
local -a all_repos=()
readarray -t all_repos <<< "$all_repos_output"
if (( ${#repos_with_cache[@]} > 0 )); then
for cached_repo in "${repos_with_cache[@]}"; do
if ! _in_array "$cached_repo" "${all_repos[@]}"; then
run_cmd rm -rf "$cachedir/$cached_repo"
fi
done
fi
}

# params: <command to execute>
run_cmd() {
local cmd_arr=("$@")
Expand All @@ -366,6 +392,14 @@ usage() {
[ -z "$1" ] || exit "$1"
}

_in_array() {
local value=${1}
shift
local array=( "$@" )

(( ${#array[@]} > 0 )) && printf '%s\n' "${array[@]}" | grep -q -Fx "$value"
}

# === Start ===

[ $# -gt 0 ] || usage 1 >&2
Expand Down Expand Up @@ -623,6 +657,8 @@ if ! is_package_installed 'epel-release'; then
install_package 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' 'epel-release'
fi

run_cmd remove_yum_cache_for_untracked_repos

run_cmd yum -y makecache fast

# --- Download packages ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@ elasticsearch-curator 5.8.3
elasticsearch-oss 6.8.5 # for elasticsearch role
elasticsearch-oss 7.9.1 # for opendistroforelasticsearch & logging roles

# erlang packages must be compatible with rabbitmq version
erlang-eldap 1:23.1.4
erlang-inets 1:23.1.4
erlang-os-mon 1:23.1.4
erlang-public-key 1:23.1.4
erlang-ssl 1:23.1.4

# additional dependencies required to fix https://github.com/epiphany-platform/epiphany/issues/1920
erlang-asn1 1:23.1.4
erlang-base-hipe 1:23.1.4
erlang-crypto 1:23.1.4
erlang-ftp 1:23.1.4
erlang-mnesia 1:23.1.4
erlang-parsetools 1:23.1.4
erlang-runtime-tools 1:23.1.4
erlang-snmp 1:23.1.4
erlang-syntax-tools 1:23.1.4
erlang-tftp 1:23.1.4
erlang-tools 1:23.1.4
erlang-xmerl 1:23.1.4
# Erlang packages must be compatible with RabbitMQ version.
# Metapackages such as erlang and erlang-nox must only be used
# with apt version pinning. They do not pin their dependency versions.
# List based on: https://www.rabbitmq.com/install-debian.html#installing-erlang-package
erlang-asn1 1:23.1.5
erlang-base 1:23.1.5
erlang-crypto 1:23.1.5
erlang-eldap 1:23.1.5
erlang-ftp 1:23.1.5
erlang-inets 1:23.1.5
erlang-mnesia 1:23.1.5
erlang-os-mon 1:23.1.5
erlang-parsetools 1:23.1.5
erlang-public-key 1:23.1.5
erlang-runtime-tools 1:23.1.5
erlang-snmp 1:23.1.5
erlang-ssl 1:23.1.5
erlang-syntax-tools 1:23.1.5
erlang-tftp 1:23.1.5
erlang-tools 1:23.1.5
erlang-xmerl 1:23.1.5

ethtool
filebeat 7.9.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,19 @@
vars:
_packages:
Debian:
- erlang-eldap={{ versions.debian.erlang }}
- erlang-inets={{ versions.debian.erlang }}
- erlang-os-mon={{ versions.debian.erlang }}
- erlang-public-key={{ versions.debian.erlang }}
- erlang-ssl={{ versions.debian.erlang }}

# Additional dependencies required to fix issue #1920
- erlang-asn1={{ versions.debian.erlang }}
- erlang-base-hipe={{ versions.debian.erlang }}
- erlang-base={{ versions.debian.erlang }}
- erlang-crypto={{ versions.debian.erlang }}
- erlang-eldap={{ versions.debian.erlang }}
- erlang-ftp={{ versions.debian.erlang }}
- erlang-inets={{ versions.debian.erlang }}
- erlang-mnesia={{ versions.debian.erlang }}
- erlang-os-mon={{ versions.debian.erlang }}
- erlang-parsetools={{ versions.debian.erlang }}
- erlang-public-key={{ versions.debian.erlang }}
- erlang-runtime-tools={{ versions.debian.erlang }}
- erlang-snmp={{ versions.debian.erlang }}
- erlang-ssl={{ versions.debian.erlang }}
- erlang-syntax-tools={{ versions.debian.erlang }}
- erlang-tftp={{ versions.debian.erlang }}
- erlang-tools={{ versions.debian.erlang }}
Expand Down
2 changes: 1 addition & 1 deletion docs/home/howto/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ For more information visit RabbitMQ [site](https://www.rabbitmq.com/upgrade.html
---

With the latest Epiphany version it's possible to upgrade RabbitMQ to v3.8.9.
It requires Erlang system packages upgrade that is done automatically to v23.1.4.
It requires Erlang system packages upgrade that is done automatically to v23.1.5
Upgrade is performed in offline mode after stopping all RabbitMQ nodes.
[Rolling upgrade](https://www.rabbitmq.com/upgrade.html#rolling-upgrades) is not supported by Epiphany and it is advised not to use this approach when Erlang needs to be upgraded.