Skip to content

Commit

Permalink
Merge pull request #439 from giuseppe/drop-ostree
Browse files Browse the repository at this point in the history
storage: drop ostree deduplication
  • Loading branch information
rhatdan authored Oct 7, 2019
2 parents fb8e928 + 3793082 commit 5dbd1c4
Show file tree
Hide file tree
Showing 40 changed files with 7 additions and 2,421 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ lint_task:
build_script: |
echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list
apt-get update
apt-get install -y libbtrfs-dev libostree-dev libdevmapper-dev
apt-get install -y libbtrfs-dev libdevmapper-dev
test_script: make lint

# Update metadata on VM images referenced by this repository state
Expand Down
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
run:
build-tags:
- ostree
concurrency: 6
deadline: 5m
linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
EPOCH_TEST_COMMIT := 0418ebf59f9e1f564831c0ba9378b7f8e40a1c73
NATIVETAGS :=
AUTOTAGS := $(shell ./hack/btrfs_tag.sh) $(shell ./hack/libdm_tag.sh) $(shell ./hack/ostree_tag.sh)
AUTOTAGS := $(shell ./hack/btrfs_tag.sh) $(shell ./hack/libdm_tag.sh)
BUILDFLAGS := -tags "$(AUTOTAGS) $(TAGS)" $(FLAGS)
GO ?= go

Expand Down
4 changes: 2 additions & 2 deletions contrib/cirrus/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ show_env_vars

cd $GOSRC

export RPMBuildRequires="podman autoconf automake gcc golang go-md2man gpgme-devel device-mapper-devel btrfs-progs-devel libassuan-devel libseccomp-devel glib2-devel ostree-devel make bats fuse3-devel fuse3"
export RPMBuildRequires="podman autoconf automake gcc golang go-md2man gpgme-devel device-mapper-devel btrfs-progs-devel libassuan-devel libseccomp-devel glib2-devel make bats fuse3-devel fuse3"
export RPMBuildConflicts="gcc-go"
export AptBuildRequires="autoconf automake gcc golang go-md2man libgpgme11-dev libdevmapper-dev libseccomp-dev libglib2.0-dev libostree-dev make bats aufs-tools fuse3 libfuse3-dev libbtrfs-dev"
export AptBuildRequires="autoconf automake gcc golang go-md2man libgpgme11-dev libdevmapper-dev libseccomp-dev libglib2.0-dev make bats aufs-tools fuse3 libfuse3-dev libbtrfs-dev"
export AptBuildConflicts="cryptsetup-initramfs"

case "$OS_REL_VER" in
Expand Down
7 changes: 0 additions & 7 deletions docs/containers-storage.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ The `storage.options` table supports the following options:

Comma separated list of default options to be used to mount container images. Suggested value "nodev".

**ostree_repo** = ""
If specified, use OSTree to deduplicate files with the overlay or vfs backends.

**size**=""
Maximum size of a container image. This flag can be used to set quota on the size of container images. (default: 10GB)

**skip_mount_home** = "false"
Set to skip a PRIVATE bind mount on the storage home directory.
Only supported by certain container storage drivers (overlay).

**remap-uids=**""
**remap-gids=**""

Expand Down
3 changes: 0 additions & 3 deletions docs/containers-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ configuration data which is recommended for use in *containers* which derive
from the *image*. It is also expected that a *container*'s run-time
configuration will be stored as data items.

Files belonging to a *readonly* *layer* will become deduplicated with *OSTree* if the configuration option *storage.ostree_repo* for saving the corresponding OSTree repository is provided.
This option won't work if *containers-storage* gets built without support for OSTree.

## SUB-COMMANDS
The *containers-storage* command's features are broken down into several subcommands:
**containers-storage add-names(1)** Add layer, image, or container name or names
Expand Down
38 changes: 0 additions & 38 deletions drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/containers/storage/pkg/idtools"
"github.com/containers/storage/pkg/locker"
"github.com/containers/storage/pkg/mount"
"github.com/containers/storage/pkg/ostree"
"github.com/containers/storage/pkg/parsers"
"github.com/containers/storage/pkg/system"
units "github.com/docker/go-units"
Expand Down Expand Up @@ -88,7 +87,6 @@ type overlayOptions struct {
imageStores []string
quota quota.Quota
mountProgram string
ostreeRepo string
skipMountHome bool
mountOptions string
ignoreChownErrors bool
Expand All @@ -108,7 +106,6 @@ type Driver struct {
supportsDType bool
usingMetacopy bool
locker *locker.Locker
convert map[string]bool
}

var (
Expand Down Expand Up @@ -234,12 +231,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
}
}

if opts.ostreeRepo != "" {
if err := ostree.CreateOSTreeRepository(opts.ostreeRepo, rootUID, rootGID); err != nil {
return nil, err
}
}

d := &Driver{
name: "overlay",
home: home,
Expand All @@ -251,7 +242,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
usingMetacopy: usingMetacopy,
locker: locker.New(),
options: *opts,
convert: make(map[string]bool),
}

d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, graphdriver.NewNaiveLayerIDMapUpdater(d))
Expand Down Expand Up @@ -316,24 +306,12 @@ func parseOptions(options []string) (*overlayOptions, error) {
return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err)
}
o.mountProgram = val
case "overlay2.ostree_repo", "overlay.ostree_repo", ".ostree_repo":
logrus.Debugf("overlay: ostree_repo=%s", val)
if !ostree.OstreeSupport() {
return nil, fmt.Errorf("overlay: ostree_repo specified but support for ostree is missing")
}
o.ostreeRepo = val
case ".ignore_chown_errors", "overlay2.ignore_chown_errors", "overlay.ignore_chown_errors":
logrus.Debugf("overlay: ignore_chown_errors=%s", val)
o.ignoreChownErrors, err = strconv.ParseBool(val)
if err != nil {
return nil, err
}
case "overlay2.skip_mount_home", "overlay.skip_mount_home", ".skip_mount_home":
logrus.Debugf("overlay: skip_mount_home=%s", val)
o.skipMountHome, err = strconv.ParseBool(val)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("overlay: Unknown option %s", key)
}
Expand Down Expand Up @@ -556,10 +534,6 @@ func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr
}
}

if d.options.ostreeRepo != "" {
d.convert[id] = true
}

return d.create(id, parent, opts)
}

Expand Down Expand Up @@ -766,11 +740,6 @@ func (d *Driver) Remove(id string) error {
d.locker.Lock(id)
defer d.locker.Unlock(id)

// Ignore errors, we don't want to fail if the ostree branch doesn't exist,
if d.options.ostreeRepo != "" {
ostree.DeleteOSTree(d.options.ostreeRepo, id)
}

dir := d.dir(id)
lid, err := ioutil.ReadFile(path.Join(dir, "link"))
if err == nil {
Expand Down Expand Up @@ -1125,13 +1094,6 @@ func (d *Driver) ApplyDiff(id, parent string, options graphdriver.ApplyDiffOpts)
return 0, err
}

_, convert := d.convert[id]
if convert {
if err := ostree.ConvertToOSTree(d.options.ostreeRepo, applyDir, id); err != nil {
return 0, err
}
}

return directory.Size(applyDir)
}

Expand Down
25 changes: 0 additions & 25 deletions drivers/vfs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/containers/storage/drivers"
"github.com/containers/storage/pkg/archive"
"github.com/containers/storage/pkg/idtools"
"github.com/containers/storage/pkg/ostree"
"github.com/containers/storage/pkg/parsers"
"github.com/containers/storage/pkg/system"
"github.com/opencontainers/selinux/go-selinux/label"
Expand Down Expand Up @@ -51,11 +50,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
case "vfs.imagestore", ".imagestore":
d.homes = append(d.homes, strings.Split(val, ",")...)
continue
case "vfs.ostree_repo", ".ostree_repo":
if !ostree.OstreeSupport() {
return nil, fmt.Errorf("vfs: ostree_repo specified but support for ostree is missing")
}
d.ostreeRepo = val
case "vfs.mountopt":
return nil, fmt.Errorf("vfs driver does not support mount options")
case ".ignore_chown_errors", "vfs.ignore_chown_errors":
Expand All @@ -69,15 +63,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
return nil, fmt.Errorf("vfs driver does not support %s options", key)
}
}
if d.ostreeRepo != "" {
rootUID, rootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps)
if err != nil {
return nil, err
}
if err := ostree.CreateOSTreeRepository(d.ostreeRepo, rootUID, rootGID); err != nil {
return nil, err
}
}
d.updater = graphdriver.NewNaiveLayerIDMapUpdater(d)
d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, d.updater)

Expand All @@ -92,7 +77,6 @@ type Driver struct {
name string
homes []string
idMappings *idtools.IDMappings
ostreeRepo string
ignoreChownErrors bool
naiveDiff graphdriver.DiffDriver
updater graphdriver.LayerIDMapUpdater
Expand Down Expand Up @@ -191,11 +175,6 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, ro bool
}
}

if ro && d.ostreeRepo != "" {
if err := ostree.ConvertToOSTree(d.ostreeRepo, dir, id); err != nil {
return err
}
}
return nil

}
Expand All @@ -216,10 +195,6 @@ func (d *Driver) dir(id string) string {

// Remove deletes the content from the directory for a given id.
func (d *Driver) Remove(id string) error {
if d.ostreeRepo != "" {
// Ignore errors, we don't want to fail if the ostree branch doesn't exist,
ostree.DeleteOSTree(d.ostreeRepo, id)
}
return system.EnsureRemoveAll(d.dir(id))
}

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/runc v1.0.0-rc8
github.com/opencontainers/selinux v1.2.2
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913
github.com/pkg/errors v0.8.1
github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7
github.com/sirupsen/logrus v1.4.2
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ github.com/opencontainers/runc v1.0.0-rc8 h1:dDCFes8Hj1r/i5qnypONo5jdOme/8HWZC/a
github.com/opencontainers/runc v1.0.0-rc8/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/selinux v1.2.2 h1:Kx9J6eDG5/24A6DtUquGSpJQ+m2MUTahn4FtGEe8bFg=
github.com/opencontainers/selinux v1.2.2/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs=
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 h1:TnbXhKzrTOyuvWrjI8W6pcoI9XPbLHFXCdN2dtUw7Rw=
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
10 changes: 0 additions & 10 deletions hack/ostree_tag.sh

This file was deleted.

6 changes: 3 additions & 3 deletions hack/spc_ci_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export UPDATE_CMD="true"
case "$DISTRO" in
*ubuntu*)
export UPDATE_CMD="apt-get update"
export INSTALL_CMD="apt-get -qq install bats btrfs-tools libdevmapper-dev ostree libostree-dev"
export INSTALL_CMD="apt-get -qq install bats btrfs-tools libdevmapper-dev"
;;
*fedora*)
export INSTALL_CMD="dnf -y install bats btrfs-progs btrfs-progs-devel
e2fsprogs xfsprogs device-mapper-devel ostree ostree-devel"
e2fsprogs xfsprogs device-mapper-devel"
;;
*centos*)
export INSTALL_CMD="yum install -y bats btrfs-progs btrfs-progs-devel
e2fsprogs xfsprogs device-mapper-devel ostree ostree-devel"
e2fsprogs xfsprogs device-mapper-devel"
;;
*)
echo "Unknown/unsupported \$DISTRO=$DISTRO"
Expand Down
5 changes: 0 additions & 5 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ type OptionsConfig struct {
RemapGroup string `toml:"remap-group"`
// Thinpool container options to be handed to thinpool drivers
Thinpool struct{ ThinpoolOptionsConfig } `toml:"thinpool"`
// OSTree repository
OstreeRepo string `toml:"ostree_repo"`

// Do not create a bind mount on the storage home
SkipMountHome string `toml:"skip_mount_home"`

// Alternative program to use for the mount of the file system
MountProgram string `toml:"mount_program"`
Expand Down
19 changes: 0 additions & 19 deletions pkg/ostree/no_ostree.go

This file was deleted.

Loading

0 comments on commit 5dbd1c4

Please sign in to comment.