Skip to content

Commit

Permalink
Use complete Ubuntu release + update base images
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Nov 3, 2020
1 parent 1318b39 commit 8948976
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ override _PKR_DIR := $(abspath $(call err_if_empty,PKR_DIR))
OSTYPE ?= linux
OSARCH ?= amd64
# Next version (1.5) changes DSL: JSON -> HCL
PACKER_VERSION ?= 1.6.3
PACKER_VERSION ?= 1.6.5
override _PACKER_URL := https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_$(OSTYPE)_$(OSARCH).zip

# Align each line properly to the header
Expand Down
4 changes: 2 additions & 2 deletions base_images/gce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ variables: # Empty value means it must be passed in on command-line
IMG_SFX: '{{ timestamp }}'

# Required for reliability, preserve image from upstream managed image changes
UBUNTU_BASE_IMAGE: 'ubuntu-2004-focal-v20200506'
PRIOR_UBUNTU_BASE_IMAGE: 'ubuntu-1910-eoan-v20200211'
UBUNTU_BASE_IMAGE: 'ubuntu-2010-groovy-v20201022a'
PRIOR_UBUNTU_BASE_IMAGE: 'ubuntu-2004-focal-v20201014'

# Latest Fedora release download URL
FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/test/33_Beta/Cloud/x86_64/images/Fedora-Cloud-Base-33_Beta-1.3.x86_64.qcow2"
Expand Down
28 changes: 20 additions & 8 deletions cache_images/ubuntu_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ lilto ooe.sh $SUDO apt-get -qq -y update
bigto ooe.sh $SUDO apt-get -qq -y upgrade

echo "Configuring additional package repositories"
lilto ooe.sh $SUDO add-apt-repository --yes ppa:criu/ppa
VERSION_ID=$(source /etc/os-release; echo $VERSION_ID)
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$VERSION_ID/ /" \
| ooe.sh $SUDO tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
ooe.sh curl -L -o /tmp/Release.key "https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key"
ooe.sh $SUDO apt-key add - < /tmp/Release.key


if [[ "$OS_RELEASE_VER" -le 2004 ]]; then

# Needed for criu package
lilto ooe.sh $SUDO add-apt-repository --yes ppa:criu/ppa

VERSION_ID=$(source /etc/os-release; echo $VERSION_ID)
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$VERSION_ID/ /" \
| ooe.sh $SUDO tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
ooe.sh curl -L -o /tmp/Release.key "https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key"
ooe.sh $SUDO apt-key add - < /tmp/Release.key
fi

INSTALL_PACKAGES=(\
apache2-utils
Expand All @@ -43,7 +50,6 @@ INSTALL_PACKAGES=(\
containernetworking-plugins
containers-common
coreutils
cri-o-runc
criu
crun
curl
Expand Down Expand Up @@ -125,16 +131,22 @@ DOWNLOAD_PACKAGES=(\
)

# These aren't resolvable on Ubuntu 20
if [[ "$OS_RELEASE_VER" -le 19 ]]; then
if [[ "$OS_RELEASE_VER" -le 1910 ]]; then
INSTALL_PACKAGES+=(\
python-future
python-minimal
yum-utils
)
elif [[ "$OS_RELEASE_VER" -le 2004 ]]; then
INSTALL_PACKAGES+=(\
cri-o-runc
python-is-python3
)
else
INSTALL_PACKAGES+=(\
python-is-python3
)

fi

echo "Installing general build/testing dependencies"
Expand Down
6 changes: 4 additions & 2 deletions cache_images/ubuntu_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ SCRIPT_FILEPATH=$(realpath "$0")
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")

# Run as quickly as possible after boot
/bin/bash $REPO_DIRPATH/systemd_banish.sh
if ! ((CONTAINER)); then
# Run as quickly as possible after boot
/bin/bash $REPO_DIRPATH/systemd_banish.sh
fi

# shellcheck source=./lib.sh
source "$REPO_DIRPATH/lib.sh"
Expand Down
11 changes: 7 additions & 4 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
# By default, assume we're not running inside a container
CONTAINER="${CONTAINER:-0}"

OS_RELEASE_VER="$(source /etc/os-release; echo $VERSION_ID | cut -d '.' -f 1)"
OS_RELEASE_VER="$(source /etc/os-release; echo $VERSION_ID | tr -d '.')"
OS_RELEASE_ID="$(source /etc/os-release; echo $ID)"
OS_REL_VER="$OS_RELEASE_ID-$OS_RELEASE_VER"

Expand All @@ -27,11 +27,14 @@ PACKAGE_DOWNLOAD_DIR=/var/cache/download
# TODO: Lock down to specific version number for stability
INSTALL_AUTOMATION_VERSION="latest"

SUDO="env"
SUDO=""
if [[ "$UID" -ne 0 ]]; then
SUDO="sudo"
[[ "$OS_RELEASE_ID" != "ubuntu" ]] || \
SUDO="$SUDO env DEBIAN_FRONTEND=noninteractive"
fi

if [[ "$OS_RELEASE_ID" == "ubuntu" ]]; then
export DEBIAN_FRONTEND=noninteractive
SUDO="$SUDO env DEBIAN_FRONTEND=$DEBIAN_FRONTEND"
fi

if [[ -d "/usr/share/automation" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion podman/prior-ubuntu_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.10
20.04
2 changes: 1 addition & 1 deletion podman/ubuntu_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.04
20.10

0 comments on commit 8948976

Please sign in to comment.