Skip to content

Commit f5bc2ab

Browse files
committed
Remove BoltDB state support
This also includes a number of significant changes to the SQLite state made possible by removal of the legacy DB. 1. Enable database unit tests for SQLite state, with numerous tweaks to get tests passing. Most notable changes are to container removal - where we previously didn't return an error if there was no container to remove - and RemovePodContainers, which I don't think ever worked properly from my reading of the failures. 2. Removal of AddContainerToPod/RemoveContainerToPod. On SQLite, these functions are identical to AddContainer/RemoveContainer and there is no reason to retain duplicates. 3. Removal of SafeRewriteContainerConfig - it's identical to RewriteContainerConfig in SQLite, no reason to have duplicate entrypoints. As an exciting side-note, this removes Podman's requirement that containers and pods cannot share a name, which was a BoltDB restriction only. Signed-off-by: Matt Heon <[email protected]>
1 parent 1ac43d6 commit f5bc2ab

31 files changed

+270
-5695
lines changed

.cirrus.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ env:
5757
VM_IMAGE_NAME: # One of the "Google-cloud VM Images" (above)
5858
CTR_FQIN: # One of the "Container FQIN's" (above)
5959
CI_DESIRED_RUNTIME: crun # As of 2024-05-28 there are no other supported runtimes
60-
CI_DESIRED_DATABASE: sqlite # 'sqlite' or 'boltdb'
6160
CI_DESIRED_STORAGE: overlay # overlay, vfs, or composefs (which is actually overlay)
6261

6362
# Curl-command prefix for downloading task artifacts, simply add the
@@ -161,7 +160,6 @@ build_task:
161160
TEST_BUILD_TAGS: ""
162161
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
163162
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
164-
CI_DESIRED_DATABASE: boltdb
165163
CI_DESIRED_STORAGE: vfs
166164
- env:
167165
<<: *stdenvars
@@ -684,7 +682,7 @@ compose_test_task:
684682
local_integration_test_task: &local_integration_test_task
685683
# Integration-test task name convention:
686684
# <int.|sys.> <podman|remote> <Distro NV> <root|rootless>
687-
name: &std_name_fmt "$TEST_FLAVOR $PODBIN_NAME $DISTRO_NV $PRIV_NAME $TEST_ENVIRON ${CI_DESIRED_DATABASE}"
685+
name: &std_name_fmt "$TEST_FLAVOR $PODBIN_NAME $DISTRO_NV $PRIV_NAME $TEST_ENVIRON"
688686
alias: local_integration_test
689687
# Docs: ./contrib/cirrus/CIModes.md (Cirrus Task contexts and runtime modes)
690688
# only when: - main rules (see doc above); or
@@ -737,11 +735,6 @@ container_integration_test_task:
737735
DISTRO_NV: ${FEDORA_NAME}
738736
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
739737
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
740-
- env:
741-
DISTRO_NV: ${PRIOR_FEDORA_NAME}
742-
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
743-
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
744-
CI_DESIRED_DATABASE: boltdb
745738
gce_instance: *fastvm
746739
env:
747740
TEST_FLAVOR: int
@@ -1095,12 +1088,6 @@ upgrade_test_task:
10951088
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
10961089
depends_on: *build
10971090
matrix:
1098-
- env:
1099-
# 2024-02: as long as possible/reasonable, try to keep
1100-
# one version < 4.8 so we can test boltdb. v4.3.1 is
1101-
# the lowest we can go right now, builds before that
1102-
# have netavark <1.4 which hangs on f39 kernel (#21863).
1103-
PODMAN_UPGRADE_FROM: v4.3.1
11041091
- env:
11051092
PODMAN_UPGRADE_FROM: v4.8.0
11061093
gce_instance: *standardvm
@@ -1109,8 +1096,6 @@ upgrade_test_task:
11091096
TEST_BUILD_TAGS: ""
11101097
DISTRO_NV: ${FEDORA_NAME}
11111098
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
1112-
# Never force a DB, let the old version decide its default
1113-
CI_DESIRED_DATABASE:
11141099
clone_script: *get_gosrc
11151100
setup_script: *setup
11161101
main_script: *main

cmd/podman/root.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
569569
lFlags.StringArray(moduleFlagName, nil, "Load the containers.conf(5) module")
570570
_ = cmd.RegisterFlagCompletionFunc(moduleFlagName, common.AutocompleteContainersConfModules)
571571

572-
// A *hidden* flag to change the database backend.
573-
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.DBBackend, "db-backend", podmanConfig.ContainersConfDefaultsRO.Engine.DBBackend, "Database backend to use")
574-
575572
cgroupManagerFlagName := "cgroup-manager"
576573
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.CgroupManager, cgroupManagerFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.CgroupManager, "Cgroup manager to use (\"cgroupfs\"|\"systemd\")")
577574
_ = cmd.RegisterFlagCompletionFunc(cgroupManagerFlagName, common.AutocompleteCgroupManager)
@@ -659,7 +656,6 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
659656
// Hide these flags for both ABI and Tunneling
660657
for _, f := range []string{
661658
"cpu-profile",
662-
"db-backend",
663659
"default-mounts-file",
664660
"max-workers",
665661
"memory-profile",

contrib/cirrus/setup_environment.sh

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ mkdir -p /etc/containers/containers.conf.d
9999
[[ "$CG_FS_TYPE" == "cgroup2fs" ]] || \
100100
die "Only cgroups v2 CI VMs are supported, not: '$CG_FS_TYPE'"
101101

102-
# For testing boltdb without having to use --db-backend.
103-
# As of #20318 (2023-10-10) sqlite is the default, so do not create
104-
# a containers.conf file in that condition.
105-
# shellcheck disable=SC2154
106-
if [[ "${CI_DESIRED_DATABASE:-sqlite}" != "sqlite" ]]; then
107-
printf "[engine]\ndatabase_backend=\"$CI_DESIRED_DATABASE\"\n" > /etc/containers/containers.conf.d/92-db.conf
108-
fi
109-
110102
if ((CONTAINER==0)); then # Not yet running inside a container
111103
showrun echo "conditional setup for CONTAINER == 0"
112104
# Discovered reemergence of BFQ scheduler bug in kernel 5.8.12-200
@@ -151,27 +143,6 @@ case "$OS_RELEASE_ID" in
151143
*) die_unknown OS_RELEASE_ID
152144
esac
153145

154-
# Database: force SQLite or BoltDB as requested in .cirrus.yml.
155-
# If unset, will default to SQLite.
156-
# shellcheck disable=SC2154
157-
showrun echo "about to set up for CI_DESIRED_DATABASE [=$CI_DESIRED_DATABASE]"
158-
case "$CI_DESIRED_DATABASE" in
159-
sqlite)
160-
warn "Forcing PODMAN_DB=sqlite"
161-
echo "PODMAN_DB=sqlite" >> /etc/ci_environment
162-
;;
163-
boltdb)
164-
warn "Forcing PODMAN_DB=boltdb"
165-
echo "PODMAN_DB=boltdb" >> /etc/ci_environment
166-
;;
167-
"")
168-
warn "Using default Podman database"
169-
;;
170-
*)
171-
die_unknown CI_DESIRED_DATABASE
172-
;;
173-
esac
174-
175146
# Force the requested storage driver for both system and e2e tests.
176147
# This is (sigh) different because e2e tests have their own special way
177148
# of ignoring system defaults.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ require (
6464
github.com/stretchr/testify v1.11.1
6565
github.com/vbauerster/mpb/v8 v8.10.2
6666
github.com/vishvananda/netlink v1.3.1
67-
go.etcd.io/bbolt v1.4.3
6867
go.podman.io/common v0.66.0
6968
go.podman.io/image/v5 v5.38.0
7069
go.podman.io/storage v1.61.0
@@ -173,6 +172,7 @@ require (
173172
github.com/vbatts/tar-split v0.12.1 // indirect
174173
github.com/vishvananda/netns v0.0.5 // indirect
175174
github.com/yusufpapurcu/wmi v1.2.4 // indirect
175+
go.etcd.io/bbolt v1.4.3 // indirect
176176
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
177177
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
178178
go.opentelemetry.io/otel v1.36.0 // indirect

0 commit comments

Comments
 (0)