Skip to content

Commit

Permalink
Merge pull request #631 from jhowardmsft/boltdb
Browse files Browse the repository at this point in the history
Revendoring to move boltdb to bbolt
  • Loading branch information
AkihiroSuda authored Sep 19, 2018
2 parents 49f65ed + 2de2c04 commit aa73951
Show file tree
Hide file tree
Showing 88 changed files with 2,432 additions and 657 deletions.
2 changes: 1 addition & 1 deletion cache/contenthash/checksum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func TestPersistence(t *testing.T) {

time.Sleep(100 * time.Millisecond) // saving happens on the background

// we can't close snapshotter and open it twice (especially, its internal boltdb store)
// we can't close snapshotter and open it twice (especially, its internal bbolt store)
cm.Close()
getDefaultManager().lru.Purge()
cm = setupCacheManager(t, tmpdir, snapshotter)
Expand Down
2 changes: 1 addition & 1 deletion cache/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func TestLazyCommit(t *testing.T) {
err = cm.Close()
require.NoError(t, err)

// we can't close snapshotter and open it twice (especially, its internal boltdb store)
// we can't close snapshotter and open it twice (especially, its internal bbolt store)
cm = getCacheManager(t, tmpdir, snapshotter)

snap2, err = cm.Get(ctx, snap.ID())
Expand Down
2 changes: 1 addition & 1 deletion cache/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cache
import (
"time"

"github.com/boltdb/bolt"
"github.com/moby/buildkit/cache/metadata"
"github.com/moby/buildkit/client"
"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)

const sizeUnknown int64 = -1
Expand Down
2 changes: 1 addition & 1 deletion cache/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
"sync"

"github.com/boltdb/bolt"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cache/metadata/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"
"testing"

"github.com/boltdb/bolt"
"github.com/stretchr/testify/require"
bolt "go.etcd.io/bbolt"
)

func TestGetSetSearch(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildctl/debug/dumpmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"path/filepath"
"time"

"github.com/boltdb/bolt"
"github.com/moby/buildkit/util/appdefaults"
"github.com/urfave/cli"
bolt "go.etcd.io/bbolt"
)

var DumpMetadataCommand = cli.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/buildkitd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/moby/buildkit/frontend/gateway"
"github.com/moby/buildkit/frontend/gateway/forwarder"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/solver/boltdbcachestorage"
"github.com/moby/buildkit/solver/bboltcachestorage"
"github.com/moby/buildkit/util/apicaps"
"github.com/moby/buildkit/util/appcontext"
"github.com/moby/buildkit/util/appdefaults"
Expand Down Expand Up @@ -500,7 +500,7 @@ func newController(c *cli.Context, cfg *config.Config) (*control.Controller, err
frontends["dockerfile.v0"] = forwarder.NewGatewayForwarder(wc, dockerfile.Build)
frontends["gateway.v0"] = gateway.NewGatewayFrontend(wc)

cacheStorage, err := boltdbcachestorage.NewStore(filepath.Join(cfg.Root, "cache.db"))
cacheStorage, err := bboltcachestorage.NewStore(filepath.Join(cfg.Root, "cache.db"))
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion docs/solver.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Edge state is cleaned up when a final job that loaded the vertexes that they are

Cache providers determine if there is a result that matches the cache keys generated during the build that could be reused instead of fully reevaluating the vertex and its inputs. There can be multiple cache providers, and specific providers can be defined per vertex using the vertex options.

There are multiple backend implementations for cache providers, in-memory one used in unit tests, the default local one using boltdb and one based on cache manifests in a remote registry.
There are multiple backend implementations for cache providers, in-memory one used in unit tests, the default local one using bbolt and one based on cache manifests in a remote registry.

Simplified cache provider has following methods:

Expand Down
2 changes: 1 addition & 1 deletion snapshot/blobmapping/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package blobmapping
import (
"context"

"github.com/boltdb/bolt"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/snapshots"
"github.com/moby/buildkit/cache/metadata"
"github.com/moby/buildkit/snapshot"
digest "github.com/opencontainers/go-digest"
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"
)

const blobKey = "blobmapping.blob"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package boltdbcachestorage
package bboltcachestorage

import (
"bytes"
"encoding/json"
"fmt"

"github.com/boltdb/bolt"
"github.com/moby/buildkit/solver"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)

const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package boltdbcachestorage
package bboltcachestorage

import (
"io/ioutil"
Expand Down
2 changes: 1 addition & 1 deletion solver/llbsolver/ops/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"sync"
"time"

"github.com/boltdb/bolt"
"github.com/containerd/containerd/mount"
"github.com/docker/docker/pkg/locker"
"github.com/moby/buildkit/cache"
Expand All @@ -37,6 +36,7 @@ import (
"github.com/opencontainers/runc/libcontainer/system"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion source/git/gitsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"regexp"
"strings"

"github.com/boltdb/bolt"
"github.com/docker/docker/pkg/locker"
"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/cache/metadata"
Expand All @@ -22,6 +21,7 @@ import (
"github.com/moby/buildkit/util/progress/logs"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
bolt "go.etcd.io/bbolt"
)

var validHex = regexp.MustCompile(`^[a-f0-9]{40}$`)
Expand Down
2 changes: 1 addition & 1 deletion source/http/httpsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"strings"
"time"

"github.com/boltdb/bolt"
"github.com/docker/docker/pkg/locker"
"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/cache/metadata"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/moby/buildkit/util/tracing"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
bolt "go.etcd.io/bbolt"
)

type Opt struct {
Expand Down
2 changes: 1 addition & 1 deletion source/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"time"

"github.com/boltdb/bolt"
"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/cache/contenthash"
"github.com/moby/buildkit/cache/metadata"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/tonistiigi/fsutil"
bolt "go.etcd.io/bbolt"
"golang.org/x/time/rate"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
15 changes: 8 additions & 7 deletions vendor.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
github.com/pkg/errors v0.8.0
go.etcd.io/bbolt v1.3.1-etcd.8

github.com/stretchr/testify v1.1.4
github.com/davecgh/go-spew v1.1.0
github.com/pmezard/go-difflib v1.0.0
golang.org/x/sys 1b2967e3c290b7c545b3db0deeda16e9be4f98a2

github.com/containerd/containerd 1597270d0468ccebd29b78164c2e902514f426fd
github.com/containerd/containerd d97a907f7f781c0ab8340877d8e6b53cc7f1c2f6
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
github.com/sirupsen/logrus v1.0.0
Expand All @@ -19,16 +19,16 @@ github.com/golang/protobuf v1.1.0
github.com/containerd/continuity f44b615e492bdfb371aae2f76ec694d9da1db537
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc 20aff4f0488c6d4b8df4d85b4f63f1f704c11abd
github.com/Microsoft/go-winio v0.4.10
github.com/Microsoft/go-winio v0.4.11
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
github.com/opencontainers/runtime-spec d810dbc60d8c5aeeb3d054bd1132fab2121968ce # v1.0.1-43-gd810dbc
github.com/containerd/go-runc acb7c88cac264acca9b5eae187a117f4d77a1292
github.com/opencontainers/runtime-spec eba862dc2470385a233c7507392675cbeadf7353 # v1.0.1-45-geba862d
github.com/containerd/go-runc 5a6d9f37cfa36b15efba46dc7ea349fa9b7143c3
github.com/containerd/console c12b1e7919c14469339a5d38f2f8ed9b64a9de23
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
github.com/Microsoft/hcsshim 44c060121b68e8bdc40b411beba551f3b4ee9e55
github.com/Microsoft/hcsshim v0.7.3
golang.org/x/crypto 0709b304e793a5edb4a2c0145f281ecdc20838a4

github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
Expand All @@ -50,8 +50,9 @@ github.com/docker/distribution 30578ca32960a4d368bf6db67b0a33c2a1f3dc6f
github.com/tonistiigi/units 6950e57a87eaf136bbe44ef2ec8e75b9e3569de2
github.com/docker/cli 99576756eb3303b7af8102c502f21a912e3c1af6 https://github.com/tonistiigi/docker-cli.git
github.com/docker/docker-credential-helpers d68f9aeca33f5fd3f08eeae5e9d175edf4e731d1
github.com/docker/libnetwork 822e5b59d346b7ad0735df2c8e445e9787320e67
github.com/docker/libnetwork 36d3bed0e9f4b3c8c66df9bd45278bb90b33e911
github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005
github.com/ishidawataru/sctp 07191f837fedd2f13d1ec7b5f885f0f3ec54b1cb

github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7
Expand Down
Loading

0 comments on commit aa73951

Please sign in to comment.