Skip to content

Commit

Permalink
Merge pull request #136 from cevich/fix_podman_tooling
Browse files Browse the repository at this point in the history
Fix podman_tooling script
  • Loading branch information
cevich authored Jun 14, 2022
2 parents cd4d809 + 6b66a74 commit 841849c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 42 deletions.
6 changes: 3 additions & 3 deletions base_images/gce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ variables: # Empty value means it must be passed in on command-line

# Upstream source for Ubuntu image to duplicate (prevents expiration).
# Use the most recent image based on this family name.
UBUNTU_BASE_FAMILY: 'ubuntu-2110'
UBUNTU_BASE_FAMILY: 'ubuntu-2204-lts'

# Latest Fedora release (qcow and CHECKSUM) download URLs
# N/B: There are Fedora-Cloud...GCP.tar.gz images available, however
# as of this comment, they lack the cloud-init package which is
# required by GCP for startup resizing of the rootfs.
FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/development/36/Cloud/x86_64/images/Fedora-Cloud-36-x86_64-20220428.n.0-CHECKSUM"
FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/development/36/Cloud/x86_64/images/Fedora-Cloud-Base-36-20220428.n.0.x86_64.qcow2"
FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/36/Cloud/x86_64/images/Fedora-Cloud-36-1.5-x86_64-CHECKSUM"
FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/36/Cloud/x86_64/images/Fedora-Cloud-Base-36-1.5.x86_64.qcow2"

# Prior Fedora release
PRIOR_FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/35/Cloud/x86_64/images/Fedora-Cloud-35-1.2-x86_64-CHECKSUM"
Expand Down
2 changes: 2 additions & 0 deletions base_images/ubuntu_base-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PKGS=( \
git
openssh-client
openssh-server
rng-tools5
software-properties-common
)

Expand All @@ -47,6 +48,7 @@ install_automation_tooling

if ! ((CONTAINER)); then
custom_cloud_init
$SUDO systemctl enable rngd
fi

finalize
9 changes: 2 additions & 7 deletions cache_images/fedora_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,5 @@ fi
# It was observed in F33, dnf install doesn't always get you the latest/greatest
lilto $SUDO dnf update -y

echo "Configuring Go environment"
export GOPATH=/var/tmp/go
mkdir -p "$GOPATH"
eval $(go env | tee /dev/stderr)
export PATH="$GOPATH/bin:$PATH"
# shellcheck source=./podman_tooling.sh
source $SCRIPT_DIRPATH/podman_tooling.sh
chmod +x $SCRIPT_DIRPATH/podman_tooling.sh
$SUDO $SCRIPT_DIRPATH/podman_tooling.sh
46 changes: 29 additions & 17 deletions cache_images/podman_tooling.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
#!/bin/bash

# This script is sourced from *_packaging.sh script to install common/shared
# This script is executed from *_packaging.sh script to install common/shared
# tooling from the containers/podman repository. It expects
# a go 1.13+ environment has already been setup. The script should
# not be used for any other purpose or from any other context.
# a go 1.16+ environment has already been set up, and should be called
# as root or through sudo. The script should not be used for any other
# purpose or from any other context.

set -e

SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}")
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")
# shellcheck source=./lib.sh
source "$REPO_DIRPATH/lib.sh"

echo "Configuring Go environment"
export GOPATH="${GOPATH:-/var/tmp/go}"
mkdir -p "$GOPATH"
export GOSRC=${GOPATH}/src/github.com/containers/podman
export GOCACHE="${GOCACHE:-$GOPATH/cache}"
eval $(go env | tee /dev/stderr)
export PATH="$GOPATH/bin:$PATH"

echo "Installing runtime tooling"
export GOPATH="${GOPATH:/var/tmp/go}"
export GOSRC=/var/tmp/go/src/github.com/containers/podman
export GOCACHE="${GOCACHE:-/root/.cache/go-build}"
lilto git clone --quiet https://github.com/containers/podman.git "$GOSRC"

cd "$GOSRC" || die "Podman repo. not cloned to expected directory: '$GOSRC'"
# Calling script already loaded lib.sh
# shellcheck disable=SC2154
lilto $SUDO ./hack/install_catatonit.sh
bigto $SUDO make install.tools
lilto ./hack/install_catatonit.sh
bigto make install.tools

# shellcheck disable=SC2154
if [[ "$OS_RELEASE_ID" == "ubuntu" ]]; then
lilto $SUDO make install.libseccomp.sudo
else # Fedora
if [[ "$OS_RELEASE_ID" == "fedora" ]]; then
msg "Installing swagger binary"
download_url=$(\
curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
jq -r '.assets[] | select(.name | contains("linux_amd64")) | .browser_download_url')
$SUDO curl --fail -s -o /usr/local/bin/swagger -L'#' "$download_url"
$SUDO chmod +x /usr/local/bin/swagger
curl --fail -s -o /usr/local/bin/swagger -L'#' "$download_url"
chmod +x /usr/local/bin/swagger
/usr/local/bin/swagger version

# This is needed for rootless testing
$SUDO make install.modules-load
make install.modules-load
fi

# Make pristine for other runtime usage/expectations also save a bit
# of space in the images.
$SUDO rm -rf "$GOPATH/src" "$GOCACHE"
$SUDO chown -R root.root /var/tmp/go
rm -rf "$GOPATH/src" "$GOCACHE"
chown -R root.root "$GOPATH"
22 changes: 8 additions & 14 deletions cache_images/ubuntu_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ fi
# automated testing. These packages are not otherwise intended for
# end-user consumption.
VERSION_ID=$(source /etc/os-release; echo $VERSION_ID)
# Overview: https://build.opensuse.org/project/show/devel:kubic:libcontainers:testing
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/testing/xUbuntu_$VERSION_ID/"
GPG_URL="https://download.opensuse.org/repositories/devel:kubic:libcontainers:testing/xUbuntu_$VERSION_ID/Release.key"
# Overview: https://build.opensuse.org/project/show/devel:kubic:libcontainers:unstable
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$VERSION_ID/"
GPG_URL="https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$VERSION_ID/Release.key"

echo "deb $REPO_URL /" | ooe.sh $SUDO \
tee /etc/apt/sources.list.d/devel:kubic:libcontainers:testing:ci.list
tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable:ci.list
curl --fail --silent --location --url "$GPG_URL" | \
gpg --dearmor | \
$SUDO tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_testing_ci.gpg &> /dev/null
$SUDO tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable_ci.gpg &> /dev/null


# Removed golang-1.14 from install packages due to known
Expand All @@ -51,7 +51,6 @@ INSTALL_PACKAGES=(\
apache2-utils
apparmor
apt-transport-https
aufs-tools
autoconf
automake
bash-completion
Expand All @@ -65,7 +64,6 @@ INSTALL_PACKAGES=(\
conmon
containernetworking-plugins
containers-common
cri-o-runc
criu
crun
dnsmasq
Expand Down Expand Up @@ -128,6 +126,7 @@ INSTALL_PACKAGES=(\
python3-requests
python3-setuptools
rsync
runc
scons
skopeo
slirp4netns
Expand Down Expand Up @@ -194,10 +193,5 @@ curl -s -L https://golang.org/dl/go1.17.3.linux-amd64.tar.gz | \
# Now linking to upstream golang until ubuntu performance issues are resolved
$SUDO ln -sf /usr/local/go/bin/* /usr/bin/

export GOPATH=/var/tmp/go
mkdir -p "$GOPATH"
eval $(go env | tee /dev/stderr)
export PATH="$GOPATH/bin:$PATH"

# shellcheck source=./podman_tooling.sh
source $SCRIPT_DIRPATH/podman_tooling.sh
chmod +x $SCRIPT_DIRPATH/podman_tooling.sh
$SUDO bash $SCRIPT_DIRPATH/podman_tooling.sh
2 changes: 1 addition & 1 deletion podman/ubuntu_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.10
22.04

0 comments on commit 841849c

Please sign in to comment.