CI: default to sqlite
Followup to #20318: now that sqlite is the podman default, enforce that in CI as well. Test boltdb only in Prior Fedora. In the process, discovered & cleaned up some duplication and unused YAML anchors. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
parent
0b6abfe1e2
commit
2a17baa29d
23
.cirrus.yml
23
.cirrus.yml
|
|
@ -58,7 +58,7 @@ env:
|
||||||
DISTRO_NV: # any {PRIOR_,}{FEDORA,DEBIAN}_NAME value
|
DISTRO_NV: # any {PRIOR_,}{FEDORA,DEBIAN}_NAME value
|
||||||
VM_IMAGE_NAME: # One of the "Google-cloud VM Images" (above)
|
VM_IMAGE_NAME: # One of the "Google-cloud VM Images" (above)
|
||||||
CTR_FQIN: # One of the "Container FQIN's" (above)
|
CTR_FQIN: # One of the "Container FQIN's" (above)
|
||||||
CI_DESIRED_DATABASE: boltdb # One of "", "sqlite", "boltdb"
|
CI_DESIRED_DATABASE: sqlite # 'sqlite' or 'boltdb'
|
||||||
|
|
||||||
# Curl-command prefix for downloading task artifacts, simply add the
|
# Curl-command prefix for downloading task artifacts, simply add the
|
||||||
# the url-encoded task name, artifact name, and path as a suffix.
|
# the url-encoded task name, artifact name, and path as a suffix.
|
||||||
|
|
@ -104,30 +104,21 @@ build_task:
|
||||||
# ID for re-use of build output
|
# ID for re-use of build output
|
||||||
CI_DESIRED_RUNTIME: crun
|
CI_DESIRED_RUNTIME: crun
|
||||||
CI_DESIRED_NETWORK: netavark
|
CI_DESIRED_NETWORK: netavark
|
||||||
CI_DESIRED_DATABASE: boltdb
|
- env:
|
||||||
- env: &sqliteenvvars
|
|
||||||
DISTRO_NV: ${FEDORA_NAME}
|
|
||||||
# Not used here, is used in other tasks
|
|
||||||
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
|
|
||||||
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
|
|
||||||
# ID for re-use of build output
|
|
||||||
CI_DESIRED_RUNTIME: crun
|
|
||||||
CI_DESIRED_NETWORK: netavark
|
|
||||||
CI_DESIRED_DATABASE: sqlite
|
|
||||||
- env: &priorfedora_envvars
|
|
||||||
DISTRO_NV: ${PRIOR_FEDORA_NAME}
|
DISTRO_NV: ${PRIOR_FEDORA_NAME}
|
||||||
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
|
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
|
||||||
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
|
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
|
||||||
CI_DESIRED_RUNTIME: crun
|
CI_DESIRED_RUNTIME: crun
|
||||||
CI_DESIRED_NETWORK: cni
|
CI_DESIRED_NETWORK: cni
|
||||||
|
CI_DESIRED_DATABASE: boltdb
|
||||||
# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
|
# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
|
||||||
TMPDIR: /var/tmp
|
TMPDIR: /var/tmp
|
||||||
- env:
|
- env:
|
||||||
<<: *sqliteenvvars
|
<<: *stdenvars
|
||||||
DISTRO_NV: ${RAWHIDE_NAME}
|
DISTRO_NV: ${RAWHIDE_NAME}
|
||||||
VM_IMAGE_NAME: ${RAWHIDE_CACHE_IMAGE_NAME}
|
VM_IMAGE_NAME: ${RAWHIDE_CACHE_IMAGE_NAME}
|
||||||
CTR_FQIN: ""
|
CTR_FQIN: ""
|
||||||
- env: &debian_envvars
|
- env:
|
||||||
DISTRO_NV: ${DEBIAN_NAME}
|
DISTRO_NV: ${DEBIAN_NAME}
|
||||||
VM_IMAGE_NAME: ${DEBIAN_CACHE_IMAGE_NAME}
|
VM_IMAGE_NAME: ${DEBIAN_CACHE_IMAGE_NAME}
|
||||||
CI_DESIRED_RUNTIME: runc
|
CI_DESIRED_RUNTIME: runc
|
||||||
|
|
@ -409,7 +400,6 @@ win_installer_task:
|
||||||
CIRRUS_WORKING_DIR: &wincwd "${LOCALAPPDATA}\\cirrus-ci-build"
|
CIRRUS_WORKING_DIR: &wincwd "${LOCALAPPDATA}\\cirrus-ci-build"
|
||||||
CIRRUS_SHELL: powershell
|
CIRRUS_SHELL: powershell
|
||||||
PATH: "${PATH};C:\\ProgramData\\chocolatey\\bin"
|
PATH: "${PATH};C:\\ProgramData\\chocolatey\\bin"
|
||||||
CI_DESIRED_DATABASE: ""
|
|
||||||
DISTRO_NV: "windows"
|
DISTRO_NV: "windows"
|
||||||
PRIV_NAME: "rootless"
|
PRIV_NAME: "rootless"
|
||||||
# Fake version, we are only testing the installer functions, so version doesn't matter
|
# Fake version, we are only testing the installer functions, so version doesn't matter
|
||||||
|
|
@ -680,6 +670,7 @@ container_integration_test_task:
|
||||||
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
|
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
|
||||||
CI_DESIRED_RUNTIME: crun
|
CI_DESIRED_RUNTIME: crun
|
||||||
CI_DESIRED_NETWORK: cni
|
CI_DESIRED_NETWORK: cni
|
||||||
|
CI_DESIRED_DATABASE: boltdb
|
||||||
gce_instance: *standardvm
|
gce_instance: *standardvm
|
||||||
timeout_in: 50m
|
timeout_in: 50m
|
||||||
env:
|
env:
|
||||||
|
|
@ -999,6 +990,8 @@ upgrade_test_task:
|
||||||
TEST_FLAVOR: upgrade_test
|
TEST_FLAVOR: upgrade_test
|
||||||
DISTRO_NV: ${FEDORA_NAME}
|
DISTRO_NV: ${FEDORA_NAME}
|
||||||
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
|
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
|
||||||
|
# FIXME: remove this once we have VMs with podman >= 4.8
|
||||||
|
CI_DESIRED_DATABASE: boltdb
|
||||||
clone_script: *get_gosrc
|
clone_script: *get_gosrc
|
||||||
setup_script: *setup
|
setup_script: *setup
|
||||||
main_script: *main
|
main_script: *main
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,10 @@ remove_packaged_podman_files() {
|
||||||
LISTING_CMD="rpm -ql podman"
|
LISTING_CMD="rpm -ql podman"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# delete the podman socket in case it has been created previously
|
# delete the podman socket in case it has been created previously.
|
||||||
|
# Do so without running podman, lest that invocation initialize unwanted state.
|
||||||
|
rm -f /run/podman/podman.sock /run/user/$(id -u)/podman/podman.sock || true
|
||||||
|
|
||||||
rm -f $(podman info --format "{{.Host.RemoteSocket.Path}}")
|
rm -f $(podman info --format "{{.Host.RemoteSocket.Path}}")
|
||||||
|
|
||||||
# yum/dnf/dpkg may list system directories, only remove files
|
# yum/dnf/dpkg may list system directories, only remove files
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,13 @@ case "$CG_FS_TYPE" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Force the requested database backend without having to use command-line args
|
# Force the requested database backend without having to use command-line args
|
||||||
|
# As of #20318 (2023-10-10) sqlite is the default, but for complicated reasons
|
||||||
|
# we still (2023-11-01) have to explicitly create a containers.conf. See
|
||||||
|
# comments in #20559.
|
||||||
|
# FIXME: some day, when new CI VMs are in place with podman >= 4.8 installed
|
||||||
|
# from RPM, un-comment the 'if' below. That will confirm that sqlite is default.
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
|
#if [[ "${CI_DESIRED_DATABASE:-sqlite}" != "sqlite" ]]; then
|
||||||
printf "[engine]\ndatabase_backend=\"$CI_DESIRED_DATABASE\"\n" > /etc/containers/containers.conf.d/92-db.conf
|
printf "[engine]\ndatabase_backend=\"$CI_DESIRED_DATABASE\"\n" > /etc/containers/containers.conf.d/92-db.conf
|
||||||
|
|
||||||
# For debian envs pre-configure storage driver as overlay.
|
# For debian envs pre-configure storage driver as overlay.
|
||||||
|
|
@ -179,7 +185,7 @@ case "$CI_DESIRED_NETWORK" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Database: force SQLite or BoltDB as requested in .cirrus.yml.
|
# Database: force SQLite or BoltDB as requested in .cirrus.yml.
|
||||||
# If unset, will default to BoltDB.
|
# If unset, will default to SQLite.
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
showrun echo "about to set up for CI_DESIRED_DATABASE [=$CI_DESIRED_DATABASE]"
|
showrun echo "about to set up for CI_DESIRED_DATABASE [=$CI_DESIRED_DATABASE]"
|
||||||
case "$CI_DESIRED_DATABASE" in
|
case "$CI_DESIRED_DATABASE" in
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ The following environment variables are supported by the test setup:
|
||||||
- `CONMON_BINARY`: path to th conmon binary, defaults to `/usr/libexec/podman/conmon`.
|
- `CONMON_BINARY`: path to th conmon binary, defaults to `/usr/libexec/podman/conmon`.
|
||||||
- `OCI_RUNTIME`: which oci runtime to use, defaults to `crun`.
|
- `OCI_RUNTIME`: which oci runtime to use, defaults to `crun`.
|
||||||
- `NETWORK_BACKEND`: the network backend, either `netavark` (default) or `cni`.
|
- `NETWORK_BACKEND`: the network backend, either `netavark` (default) or `cni`.
|
||||||
- `PODMAN_DB`: the database backend `boltdb` (default) or `sqlite`.
|
- `PODMAN_DB`: the database backend `sqlite` (default) or `boltdb`.
|
||||||
- `PODMAN_TEST_IMAGE_CACHE_DIR`: path were the container images should be cached, defaults to `/tmp`.
|
- `PODMAN_TEST_IMAGE_CACHE_DIR`: path were the container images should be cached, defaults to `/tmp`.
|
||||||
|
|
||||||
### Running a single file of integration tests
|
### Running a single file of integration tests
|
||||||
|
|
|
||||||
|
|
@ -286,9 +286,9 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
|
||||||
}
|
}
|
||||||
os.Setenv("DISABLE_HC_SYSTEMD", "true")
|
os.Setenv("DISABLE_HC_SYSTEMD", "true")
|
||||||
|
|
||||||
dbBackend := "boltdb"
|
dbBackend := "sqlite"
|
||||||
if os.Getenv("PODMAN_DB") == "sqlite" {
|
if os.Getenv("PODMAN_DB") == "boltdb" {
|
||||||
dbBackend = "sqlite"
|
dbBackend = "boltdb"
|
||||||
}
|
}
|
||||||
|
|
||||||
networkBackend := Netavark
|
networkBackend := Netavark
|
||||||
|
|
|
||||||
|
|
@ -176,25 +176,39 @@ host.slirp4netns.executable | $expr_path
|
||||||
|
|
||||||
containersConf=$PODMAN_TMPDIR/containers.conf
|
containersConf=$PODMAN_TMPDIR/containers.conf
|
||||||
cat >$containersConf <<EOF
|
cat >$containersConf <<EOF
|
||||||
[engine]
|
[containers]
|
||||||
database_backend = "boltdb"
|
env = [ "CONF1=conf1" ]
|
||||||
|
|
||||||
|
[engine.volume_plugins]
|
||||||
|
volplugin1 = "This is not actually used or seen anywhere"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
overrideConf=$PODMAN_TMPDIR/override.conf
|
overrideConf=$PODMAN_TMPDIR/override.conf
|
||||||
cat >$overrideConf <<EOF
|
cat >$overrideConf <<EOF
|
||||||
[engine]
|
[containers]
|
||||||
database_backend = "sqlite"
|
env = [ "CONF2=conf2" ]
|
||||||
|
|
||||||
|
[engine.volume_plugins]
|
||||||
|
volplugin2 = "This is not actually used or seen anywhere, either"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
CONTAINERS_CONF="$containersConf" run_podman info --format "{{ .Host.DatabaseBackend }}"
|
CONTAINERS_CONF="$containersConf" run_podman 1 run --rm $IMAGE printenv CONF1 CONF2
|
||||||
is "$output" "boltdb"
|
is "$output" "conf1" "with CONTAINERS_CONF only"
|
||||||
|
|
||||||
CONTAINERS_CONF_OVERRIDE=$overrideConf run_podman info --format "{{ .Host.DatabaseBackend }}"
|
CONTAINERS_CONF_OVERRIDE=$overrideConf run_podman 1 run --rm $IMAGE printenv CONF1 CONF2
|
||||||
is "$output" "sqlite"
|
is "$output" "conf2" "with CONTAINERS_CONF_OVERRIDE only"
|
||||||
|
|
||||||
|
# CONTAINERS_CONF will be overridden by _OVERRIDE. env is overridden, not merged.
|
||||||
|
CONTAINERS_CONF=$containersConf CONTAINERS_CONF_OVERRIDE=$overrideConf run_podman 1 run --rm $IMAGE printenv CONF1 CONF2
|
||||||
|
is "$output" "conf2" "with both CONTAINERS_CONF and CONTAINERS_CONF_OVERRIDE"
|
||||||
|
|
||||||
|
# Merge test: each of those conf files defines a distinct volume plugin.
|
||||||
|
# Confirm that we see both. 'info' outputs in random order, so we need to
|
||||||
|
# do two tests.
|
||||||
|
CONTAINERS_CONF=$containersConf CONTAINERS_CONF_OVERRIDE=$overrideConf run_podman info --format '{{.Plugins.Volume}}'
|
||||||
|
assert "$output" =~ "volplugin1" "CONTAINERS_CONF_OVERRIDE does not clobber volume_plugins from CONTAINERS_CONF"
|
||||||
|
assert "$output" =~ "volplugin2" "volume_plugins seen from CONTAINERS_CONF_OVERRIDE"
|
||||||
|
|
||||||
# CONTAINERS_CONF will be overridden by _OVERRIDE
|
|
||||||
CONTAINERS_CONF=$containersConf CONTAINERS_CONF_OVERRIDE=$overrideConf run_podman info --format "{{ .Host.DatabaseBackend }}"
|
|
||||||
is "$output" "sqlite"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue