From 70079d861db3c870710e817955b4c7572ecc217b Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 23 Apr 2020 15:44:06 -0700 Subject: [PATCH] Fix building Ubuntu 20.04 focal amphorae Ubuntu 20.04 is a "Tested Runtime" for the Victoria release[1]. This patch updated our diskimage-create script and elements to support building a amphora image that uses Ubuntu 20.04 (focal). [1] https://governance.openstack.org/tc/reference/runtimes/victoria.html Change-Id: I6f53ea5d012ab64b985d981ecd1b1967e18e4e81 --- diskimage-create/diskimage-create.sh | 4 +--- .../75-amphora-agent-install | 3 +-- elements/amphora-agent/package-installs.yaml | 8 +++++++- elements/amphora-agent/pkg-map | 13 +++++++++++-- .../post-install.d/10-enable-network-scripts | 4 ++++ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index c51f62c604..8b767e87e3 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -420,10 +420,8 @@ AMP_element_sequence="$AMP_element_sequence ${AMP_BASEOS}" if [ "$AMP_PACKAGE_INSTALL" -eq 1 ]; then export DIB_INSTALLTYPE_amphora_agent=package -else - # We will need pip for amphora-agent - AMP_element_sequence="$AMP_element_sequence pip-and-virtualenv" fi + # Add our backend element (haproxy, etc.) AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND" diff --git a/elements/amphora-agent/install.d/amphora-agent-source-install/75-amphora-agent-install b/elements/amphora-agent/install.d/amphora-agent-source-install/75-amphora-agent-install index 940b7ae6e7..6a9bf0a5d0 100755 --- a/elements/amphora-agent/install.d/amphora-agent-source-install/75-amphora-agent-install +++ b/elements/amphora-agent/install.d/amphora-agent-source-install/75-amphora-agent-install @@ -9,8 +9,7 @@ set -o pipefail SCRIPTDIR=$(dirname $0) AMP_VENV=/opt/amphora-agent-venv -# Create a virtual environment to contain the amphora agent -${DIB_PYTHON} -m virtualenv $AMP_VENV +/usr/bin/python3 -m venv $AMP_VENV $AMP_VENV/bin/pip install pip --upgrade diff --git a/elements/amphora-agent/package-installs.yaml b/elements/amphora-agent/package-installs.yaml index d122486326..f9987a22e8 100644 --- a/elements/amphora-agent/package-installs.yaml +++ b/elements/amphora-agent/package-installs.yaml @@ -6,8 +6,14 @@ libffi-dev: build-only: True libssl-dev: build-only: True -python-dev: +python3-dev: build-only: True + installtype: source +python3-pip: + installtype: source +python3: +python3-venv: + installtype: source acl: # Note: Red Hat family does not currently ship acpid for ppc64le. diff --git a/elements/amphora-agent/pkg-map b/elements/amphora-agent/pkg-map index f58bd7e126..da667f0abe 100644 --- a/elements/amphora-agent/pkg-map +++ b/elements/amphora-agent/pkg-map @@ -3,7 +3,9 @@ "rhel": { "8": { "isc-dhcp-client": "dhcp-client", - "python-dev": "platform-python-devel", + "python3-dev": "platform-python-devel", + "python3-venv": "python3-virtualenv", + "python3": "python36", "vlan": "", "screen": "", "dkms": "" @@ -12,11 +14,18 @@ "centos": { "8": { "isc-dhcp-client": "dhcp-client", - "python-dev": "platform-python-devel", + "python3-dev": "platform-python-devel", + "python3-venv": "python3-virtualenv", + "python3": "python36", "vlan": "", "screen": "", "dkms": "" } + }, + "ubuntu": { + "focal": { + "ureadahead": "" + } } }, "family": { diff --git a/elements/amphora-agent/post-install.d/10-enable-network-scripts b/elements/amphora-agent/post-install.d/10-enable-network-scripts index 7aaa190f8d..db43bf9bed 100755 --- a/elements/amphora-agent/post-install.d/10-enable-network-scripts +++ b/elements/amphora-agent/post-install.d/10-enable-network-scripts @@ -10,3 +10,7 @@ set -o pipefail if [[ "$DISTRO_NAME" =~ (rhel|centos) ]] && [ "$DIB_RELEASE" == "8" ]; then chkconfig network on fi + +if [[ "$DISTRO_NAME" =~ (ubuntu) ]] && [ "$DIB_RELEASE" == "focal" ]; then + systemctl enable systemd-networkd +fi