Skip to content
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
23 changes: 12 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: core-snap
path: "${{ github.workspace }}/core22.artifact"
path: "${{ github.workspace }}/core24.artifact"

- name: Discard spread workers
if: always()
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: core-snap
path: "${{ github.workspace }}/core22.artifact"
path: "${{ github.workspace }}/core24.artifact"

- name: Run tests
run: |
Expand Down Expand Up @@ -92,29 +92,30 @@ jobs:
- name: Build image
working-directory: '${{ github.workspace }}'
run: |
PROJECT_PATH=core-base
. "core-base/tests/lib/prepare-utils.sh"

echo "************* INSTALLING DEPS *************"
install_core22_deps
install_base_deps

echo "************* DOWNLOADING SNAPS *************"
download_core22_snaps 'edge'
download_core24_snaps 'edge'

echo "************* WRITING CLOUD-INIT CONFIG *************"
prepare_core22_cloudinit
prepare_base_cloudinit

echo "************* BUILDING CORE22 IMAGE *************"
echo "************* BUILDING CORE24 IMAGE *************"
uc_snap="$(get_core_snap_name)"
mv core22.artifact "$uc_snap"
build_core22_image
mv core24.artifact "$uc_snap"
build_base_image

echo "************* STARTING CORE22 VM *************"
echo "************* STARTING CORE24 VM *************"
start_snapd_core_vm '${{ github.workspace }}'

cd snapd

# add any test suites that should be tested here
SPREAD_EXTERNAL_ADDRESS=localhost:8022 spread external:ubuntu-core-22-64:tests/smoke/
SPREAD_EXTERNAL_ADDRESS=localhost:8022 spread external:ubuntu-core-24-64:tests/smoke/

- name: Discard spread workers
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ install:

script:
- sg lxd 'snapcraft'
- sudo unsquashfs -d prime core22*.snap
- sudo unsquashfs -d prime core24*.snap
- make test
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dir that contans the filesystem that must be checked
TESTDIR ?= "prime/"
SNAP_NAME=core24
BUILDDIR=/build/$(SNAP_NAME)

.PHONY: all
all: check
Expand Down Expand Up @@ -46,9 +48,9 @@ install:
touch $(DESTDIR)/usr/lib/clock-epoch

# only generate manifest and dpkg.yaml files for lp build
if [ -e /build/core22 ]; then \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.list /build/core22/core22-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).manifest; \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.yaml /build/core22/core22-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).dpkg.yaml; \
if [ -e $(BUILDDIR) ]; then \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.list $(BUILDDIR)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).manifest; \
/bin/cp $(DESTDIR)/usr/share/snappy/dpkg.yaml $(BUILDDIR)/$(SNAP_NAME)-$$(date +%Y%m%d%H%M)_$(DPKG_ARCH).dpkg.yaml; \
fi;

.PHONY: check
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Core22 snap for snapd & Ubuntu Core
# Core24 snap for snapd & Ubuntu Core

This is a base snap for snapd & Ubuntu Core that is based on Ubuntu 22.04
This is a base snap for snapd & Ubuntu Core that is based on Ubuntu 22.10 (will be base on 24.04)

# Building locally

Expand Down Expand Up @@ -58,7 +58,7 @@ mv autopkgtest-focal-amd64.img ubuntu-20.04-64.img
```
4. Now you are ready to run spread tests with the qemu backend
```
cd ~/core22 # or wherever you checked out this repository
cd ~/core24 # or wherever you checked out this repository
spread qemu-nested
```

Expand All @@ -74,18 +74,18 @@ and yq (needed for yaml manipulation), download the newest image and import it i
```
sudo snap install lxd
sudo snap install yq
curl -o lxd-core22-img.tar.gz https://storage.googleapis.com/snapd-spread-core/lxd/lxd-spread-core22-img.tar.gz
lxc image import lxd-core22-img.tar.gz --alias ucspread22
curl -o lxd-core24-img.tar.gz https://storage.googleapis.com/snapd-spread-core/lxd/lxd-spread-core24-img.tar.gz
lxc image import lxd-core24-img.tar.gz --alias ucspread22
lxc image show ucspread22 > temp.profile
yq e '.properties.aliases = "ucspread22,amd64"' -i ./temp.profile
yq e '.properties.remote = "images"' -i ./temp.profile
cat ./temp.profile | lxc image edit ucspread22
rm ./temp.profile ./lxd-core22-img.tar.gz
rm ./temp.profile ./lxd-core24-img.tar.gz
```
2. Import the LXD core22 test profile. Make sure your working directory is the root of this repository.
2. Import the LXD core24 test profile. Make sure your working directory is the root of this repository.
```
lxc profile create core22
cat tests/spread/core22.lxdprofile | lxc profile edit core22
lxc profile create core24
cat tests/spread/core24.lxdprofile | lxc profile edit core24
```
3. Set environment variable to enable KVM acceleration for the nested qemu instance
```
Expand Down
4 changes: 2 additions & 2 deletions hook-tests/600-no-debian.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ then
else
echo "Error! PPA section of dpkg.yaml not as expected."
echo "If that is intentional, please update the ppa_section content in the"
echo "test file: core22/hook-tests/600-no-debian.test."
echo "test file: hook-tests/600-no-debian.test."
exit 1
fi

Expand All @@ -25,7 +25,7 @@ do
echo "Couldn't find package: $pkg in $FILE."
echo "If that is intentional, please update the packages_section "
echo "content in the "
echo "test file: core22/hook-tests/600-no-debian.test."
echo "test file: hook-tests/600-no-debian.test."
exit 1
fi
done
Expand Down
6 changes: 0 additions & 6 deletions hooks/000-provide-uids-gids.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
EOF
Expand Down Expand Up @@ -65,7 +64,6 @@ operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
Expand Down Expand Up @@ -105,7 +103,6 @@ www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
messagebus:x:100:103::/var/run/dbus:/bin/false
snappypkg:x:101:104:Reserved:/nonexistent:/bin/false
Expand Down Expand Up @@ -139,7 +136,6 @@ www-data:*:16329:0:99999:7:::
backup:*:16329:0:99999:7:::
list:*:16329:0:99999:7:::
irc:*:16329:0:99999:7:::
gnats:*:16329:0:99999:7:::
nobody:*:16329:0:99999:7:::
messagebus:*:16413:0:99999:7:::
snappypkg:*:16413:0:99999:7:::
Expand Down Expand Up @@ -186,7 +182,6 @@ operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
Expand Down Expand Up @@ -248,7 +243,6 @@ operator:*::
list:*::
irc:*::
src:*::
gnats:*::
shadow:*::
utmp:*::
video:*::
Expand Down
18 changes: 11 additions & 7 deletions hooks/001-extra-packages.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ mkdir -p /var/log/journal
apt update
apt install --no-install-recommends -y ca-certificates

# shellcheck disable=SC1091
CODENAME=$(. /etc/os-release; echo "$UBUNTU_CODENAME")
# enable the ucdev PPA with additional packages to build bases
echo "deb https://ppa.launchpadcontent.net/ucdev/base-ppa/ubuntu/ $CODENAME main" \
> /etc/apt/sources.list.d/ubuntu-image.list

cat >/etc/apt/trusted.gpg.d/ucdev-base-ppa.asc <<'EOF'
# TODO: There is no PPA for kinetic yet.
if false; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are not we doing this anymore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PPA does not exist yet. It would fail.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it exists, but maybe is it failing because there is no kinetic package in the PPA? Please add some TODO it that is the case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to open a PR readding this so it's visible

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, re-adding. Well it will be needed once we need to backport some packages. Which is probably not going to happen until we get close to or passed 24.04. It does not need to be re-added if we do not have any package.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, excuse my lack of hyphen, that definitely reads wrong. I just wanted to make sure that it's added again if neccessary, but then a TODO is probably good enough,

# shellcheck disable=SC1091
CODENAME=$(. /etc/os-release; echo "$UBUNTU_CODENAME")
# enable the ucdev PPA with additional packages to build bases
echo "deb https://ppa.launchpadcontent.net/ucdev/base-ppa/ubuntu/ $CODENAME main" \
> /etc/apt/sources.list.d/ubuntu-image.list

cat >/etc/apt/trusted.gpg.d/ucdev-base-ppa.asc <<'EOF'
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGLW9dwBEAC7UJatAWOrUgfJlElkTUfmjL6JCTONYGy1Qzrw65YgzjdJGvXQ
Expand Down Expand Up @@ -59,6 +61,7 @@ jdVw2j6diVag+TBwXXX/pBCBMFvUHJph5afKSfnrIuDk6yzCV8TaGAer
=L0hK
-----END PGP PUBLIC KEY BLOCK-----
EOF
fi

cat <<EOF >/etc/apt/sources.list.d/local-packages.list
deb [trusted=yes] file:/install-data/local-debs ./
Expand Down Expand Up @@ -113,6 +116,7 @@ PACKAGES=(
systemd
systemd-sysv
systemd-timesyncd
systemd-resolved
tzdata
udev
vim-tiny
Expand Down
6 changes: 3 additions & 3 deletions hooks/018-set-os-release.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

cat >/usr/lib/os-release<<EOF
NAME="Ubuntu Core"
VERSION="22"
VERSION="24"
ID=ubuntu-core
PRETTY_NAME="Ubuntu Core 22"
VERSION_ID="22"
PRETTY_NAME="Ubuntu Core 24"
VERSION_ID="24"
HOME_URL="https://snapcraft.io/"
BUG_REPORT_URL="https://bugs.launchpad.net/snappy/"
EOF
2 changes: 1 addition & 1 deletion hooks/024-configure-bootchart.chroot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh -ex

if [ "$(dpkg --print-architecture)" = "riscv64" ]; then
echo "core22 riscv64 does not support this functionality"
echo "core riscv64 does not support this functionality"
exit 0
fi

Expand Down
4 changes: 2 additions & 2 deletions hooks/900-cleanup-etc-var.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ rmdir /var/log/private
# clean leftovers from the build
rm /var/log/*

# no "local" on core22
# no "local" on core
# shellcheck disable=SC2114
rm -rf -- /var/local /usr/local
# we need this for the core22 base snap when using with classic snaps
# we need this for the core base snap when using with classic snaps
# for the "interfaces-desktop-host-fonts"
mkdir -p /usr/local/share/fonts

Expand Down
2 changes: 1 addition & 1 deletion hooks/901-cleanup-timesyncd.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# With newer systemd, systemd-timesyncd switched from a regular user usage to
# dynamic users. In cases of upgrades from an older core22 system or in some
# dynamic users. In cases of upgrades from an older core system or in some
# other weird situations the old timesync directory needs removal as otherwise
# systemd will fail creating dynamic user symlink and fail to start timesyncd.
# XXX: This might not be needed in the end, but certainly useful now
Expand Down
17 changes: 9 additions & 8 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: core22
# version: "22"
name: core24
# version: "24"
adopt-info: bootstrap
summary: Runtime environment based on Ubuntu 22.04
summary: Runtime environment based on Ubuntu 22.11
description: |
The base snap based on the Ubuntu 22.04 release.
The base snap based on the Ubuntu 22.11 release.
confinement: strict
type: base
# This one is to trick snapcraft to not use legacy code
build-base: core22
grade: stable
grade: devel
assumes: [snapd2.55.5]

parts:
Expand Down Expand Up @@ -53,9 +54,9 @@ parts:
build-packages:
- wget
build-environment:
- LTS: jammy
- BASE: ${LTS}-base-${CRAFT_TARGET_ARCH}.tar.gz
- DIR_URL: https://cdimage.ubuntu.com/ubuntu-base/${LTS}/daily/current
- RELEASE: "22.10"
- BASE: ubuntu-base-${RELEASE}-base-${CRAFT_TARGET_ARCH}.tar.gz
- DIR_URL: https://cdimage.ubuntu.com/ubuntu-base/releases/${RELEASE}/release
- URL: ${DIR_URL}/${BASE}
- SHA256: ${DIR_URL}/SHA256SUMS
- SIG: ${SHA256}.gpg
Expand Down
14 changes: 7 additions & 7 deletions spread.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project: core22
project: core24

environment:
SETUPDIR: /home/core22
SETUPDIR: /home/core24
PROJECT_PATH: $SETUPDIR
PATH: $PATH:$PROJECT_PATH/tests/bin
TESTSLIB: $PROJECT_PATH/tests/lib
Expand All @@ -19,7 +19,7 @@ backends:
plan: n2-standard-2
halt-timeout: 2h
systems:
- ubuntu-22.04-64:
- ubuntu-22.10-64:
image: ubuntu-2204-64-virt-enabled
storage: 20G

Expand All @@ -30,18 +30,18 @@ backends:
# uc22 with less RAM
memory: 4G
systems:
- ubuntu-22.04-64:
- ubuntu-22.10-64:
username: ubuntu
password: ubuntu

lxd-nested:
type: lxd
container-profiles: core22
container-profiles: core24
systems:
- ubuntu-22.04:
- ubuntu-22.10:
image: ucspread22

path: /home/core22
path: /home/core24

exclude:
- .git
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/prepare-uc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ set -x
. "$TESTSLIB/prepare-utils.sh"

# install dependencies
install_core22_deps
install_base_deps

# download snaps required for us to build the image
download_core22_snaps "$SNAP_BRANCH"
download_core24_snaps "$SNAP_BRANCH"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download_base_snaps or similar

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, given the implementation is only for core24, I am not sure I want to change that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that's fine


# create test user for spread to use
groupadd --gid 12345 test
Expand Down Expand Up @@ -115,17 +115,17 @@ rm upstream-snapd.snap
snap pack --filename=upstream-snapd.snap "$snapddir"
rm -r $snapddir

# build the core22 snap if it has not been provided to us by CI
# build the core24 snap if it has not been provided to us by CI
uc_snap="$(get_core_snap_name)"
if [ ! -f "$PROJECT_PATH/core${UC_VERSION}.artifact" ]; then
build_core22_snap "$PROJECT_PATH"
build_base_snap "$PROJECT_PATH"
else
# use provided core22 snap
# use provided core24 snap
cp "$PROJECT_PATH/core${UC_VERSION}.artifact" "$uc_snap"
fi

# finally build the uc image
build_core22_image
build_base_image

# setup some data we will inject into ubuntu-seed partition of the image above
# that snapd.spread-tests-run-mode-tweaks.service will ingest
Expand Down
Loading