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 4, 2020
1 parent 1318b39 commit 4795caf
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 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.4
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
45 changes: 33 additions & 12 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 @@ -41,9 +48,7 @@ INSTALL_PACKAGES=(\
bzip2
conmon
containernetworking-plugins
containers-common
coreutils
cri-o-runc
criu
crun
curl
Expand Down Expand Up @@ -85,7 +90,6 @@ INSTALL_PACKAGES=(\
libsystemd-dev
libtool
libudev-dev
libvarlink
lsof
make
netcat
Expand All @@ -94,8 +98,6 @@ INSTALL_PACKAGES=(\
podman
protobuf-c-compiler
protobuf-compiler
python-dateutil
python-protobuf
python2
python3-dateutil
python3-pip
Expand Down Expand Up @@ -125,16 +127,35 @@ 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+=(\
containers-common
libvarlink
python-dateutil
python-future
python-minimal
python-protobuf
yum-utils
)
elif [[ "$OS_RELEASE_VER" -le 2004 ]]; then
INSTALL_PACKAGES+=(\
containers-common
cri-o-runc
libvarlink
python-dateutil
python-is-python3
python-protobuf
)
else
INSTALL_PACKAGES+=(\
python-is-python3
python3-dateutil
python3-protobuf
golang-github-varlink-go-dev
varlink-go
golang-github-containers-common
)

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 4795caf

Please sign in to comment.