From e80a1fed3fcf8d29816a171c72b15c33a93939e3 Mon Sep 17 00:00:00 2001 From: faddat Date: Sat, 7 May 2022 17:08:01 +0000 Subject: [PATCH 01/12] Begin tidwall/btree --- README.md | 2 +- go.mod | 4 ++-- go.sum | 7 ++----- memdb.go | 8 ++------ memdb_iterator.go | 2 +- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2aa6efb53..ef061eb87 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Go 1.13+ - **[GoLevelDB](https://github.com/syndtr/goleveldb) [stable]**: A pure Go implementation of [LevelDB](https://github.com/google/leveldb) (see below). Currently the default on-disk database used in the Cosmos SDK. -- **MemDB [stable]:** An in-memory database using [Google's B-tree package](https://github.com/google/btree). Has very high performance both for reads, writes, and range scans, but is not durable and will lose all data on process exit. Does not support transactions. Suitable for e.g. caches, working sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working sets when the pruning strategy allows it. +- **MemDB [stable]:** An in-memory database using [Google's B-tree package](https://github.com/tidwall/btree). Has very high performance both for reads, writes, and range scans, but is not durable and will lose all data on process exit. Does not support transactions. Suitable for e.g. caches, working sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working sets when the pruning strategy allows it. - **[LevelDB](https://github.com/google/leveldb) [experimental]:** A [Go wrapper](https://github.com/jmhodges/levigo) around [LevelDB](https://github.com/google/leveldb). Uses LSM-trees for on-disk storage, which have good performance for write-heavy workloads, particularly on spinning disks, but requires periodic compaction to maintain decent read performance and reclaim disk space. Does not support transactions. diff --git a/go.mod b/go.mod index 0acf4a760..64827ba87 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/tendermint/tm-db -go 1.17 +go 1.18 require ( github.com/cosmos/gorocksdb v1.2.0 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 // indirect - github.com/google/btree v1.0.0 github.com/jmhodges/levigo v1.0.0 github.com/stretchr/testify v1.7.1 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca + github.com/tidwall/btree v1.3.1 go.etcd.io/bbolt v1.3.6 google.golang.org/grpc v1.46.0 ) diff --git a/go.sum b/go.sum index d40507b71..32ebd5a5d 100644 --- a/go.sum +++ b/go.sum @@ -41,11 +41,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -75,8 +72,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -142,6 +137,8 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tidwall/btree v1.3.1 h1:636+tdVDs8Hjcf35Di260W2xCW4KuoXOKyk9QWOvCpA= +github.com/tidwall/btree v1.3.1/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/memdb.go b/memdb.go index d019af230..c63b643ff 100644 --- a/memdb.go +++ b/memdb.go @@ -5,13 +5,9 @@ import ( "fmt" "sync" - "github.com/google/btree" + "github.com/tidwall/btree" ) -const ( - // The approximate number of items and children per B-tree node. Tuned with benchmarks. - bTreeDegree = 32 -) func init() { registerDBCreator(MemDBBackend, func(name, dir string) (DB, error) { @@ -58,7 +54,7 @@ var _ DB = (*MemDB)(nil) // NewMemDB creates a new in-memory database. func NewMemDB() *MemDB { database := &MemDB{ - btree: btree.New(bTreeDegree), + btree: btree.New(), } return database } diff --git a/memdb_iterator.go b/memdb_iterator.go index ebd104f67..279abeb51 100644 --- a/memdb_iterator.go +++ b/memdb_iterator.go @@ -4,7 +4,7 @@ import ( "bytes" "context" - "github.com/google/btree" + "github.com/tidwall/btree" ) const ( From 746f76c25dccb5a88d348d39123ec95aed729d6b Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 8 May 2022 01:57:21 +0700 Subject: [PATCH 02/12] has implemented --- memdb.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/memdb.go b/memdb.go index c63b643ff..21d773ab1 100644 --- a/memdb.go +++ b/memdb.go @@ -8,7 +8,6 @@ import ( "github.com/tidwall/btree" ) - func init() { registerDBCreator(MemDBBackend, func(name, dir string) (DB, error) { return NewMemDB(), nil @@ -22,7 +21,7 @@ type item struct { } // Less implements btree.Item. -func (i *item) Less(other btree.Item) bool { +func Less(other btree.Item) bool { // this considers nil == []byte{}, but that's ok since we handle nil endpoints // in iterators specially anyway return bytes.Compare(i.key, other.(*item).key) == -1 @@ -54,7 +53,7 @@ var _ DB = (*MemDB)(nil) // NewMemDB creates a new in-memory database. func NewMemDB() *MemDB { database := &MemDB{ - btree: btree.New(), + btree: btree.NewGeneric[item](), } return database } @@ -79,10 +78,15 @@ func (db *MemDB) Has(key []byte) (bool, error) { if len(key) == 0 { return false, errKeyEmpty } - db.mtx.RLock() - defer db.mtx.RUnlock() + if db.btree.Get(key) != nil { + return true, nil + } + + if db.btree.Get(key) == nil { + return false, nil + } - return db.btree.Has(newKey(key)), nil + return false, nil } // Set implements DB. @@ -102,7 +106,7 @@ func (db *MemDB) Set(key []byte, value []byte) error { // set sets a value without locking the mutex. func (db *MemDB) set(key []byte, value []byte) { - db.btree.ReplaceOrInsert(newPair(key, value)) + db.btree.Set(newPair(key, value)) } // SetSync implements DB. From 564bc1e90432476ce15fe7bb635b84a01ad50708 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 8 May 2022 04:13:24 +0700 Subject: [PATCH 03/12] The linux kernel is harder-- but that's about it. --- memdb.go | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/memdb.go b/memdb.go index 21d773ab1..64d86dca7 100644 --- a/memdb.go +++ b/memdb.go @@ -21,12 +21,16 @@ type item struct { } // Less implements btree.Item. -func Less(other btree.Item) bool { +func Less(other item) bool { // this considers nil == []byte{}, but that's ok since we handle nil endpoints // in iterators specially anyway return bytes.Compare(i.key, other.(*item).key) == -1 } +func comparator(a, b item) bool { + return bytes.Compare((a.key), b.key) == -1 +} + // newKey creates a new key item. func newKey(key []byte) *item { return &item{key: key} @@ -45,7 +49,7 @@ func newPair(key, value []byte) *item { // important with MemDB. type MemDB struct { mtx sync.RWMutex - btree *btree.BTree + btree *btree.Generic[item] } var _ DB = (*MemDB)(nil) @@ -53,8 +57,9 @@ var _ DB = (*MemDB)(nil) // NewMemDB creates a new in-memory database. func NewMemDB() *MemDB { database := &MemDB{ - btree: btree.NewGeneric[item](), + btree: btree.NewGeneric[item](comparator), } + return database } @@ -63,8 +68,6 @@ func (db *MemDB) Get(key []byte) ([]byte, error) { if len(key) == 0 { return nil, errKeyEmpty } - db.mtx.RLock() - defer db.mtx.RUnlock() i := db.btree.Get(newKey(key)) if i != nil { @@ -97,8 +100,6 @@ func (db *MemDB) Set(key []byte, value []byte) error { if value == nil { return errValueNil } - db.mtx.Lock() - defer db.mtx.Unlock() db.set(key, value) return nil @@ -146,12 +147,9 @@ func (db *MemDB) Close() error { // Print implements DB. func (db *MemDB) Print() error { - db.mtx.RLock() - defer db.mtx.RUnlock() - - db.btree.Ascend(func(i btree.Item) bool { - item := i.(*item) - fmt.Printf("[%X]:\t[%X]\n", item.key, item.value) + db.btree.Ascend(nil, func(i item) bool { + pitem := i + fmt.Printf("[%X]:\t[%X]\n", pitem.key, pitem.value) return true }) return nil @@ -159,9 +157,6 @@ func (db *MemDB) Print() error { // Stats implements DB. func (db *MemDB) Stats() map[string]string { - db.mtx.RLock() - defer db.mtx.RUnlock() - stats := make(map[string]string) stats["database.type"] = "memDB" stats["database.size"] = fmt.Sprintf("%d", db.btree.Len()) From 277a7bd5e4713655bd6f3f191c059e2b251abb91 Mon Sep 17 00:00:00 2001 From: romelukaku Date: Mon, 9 May 2022 21:38:38 +0700 Subject: [PATCH 04/12] using itemRef for MemDB.btree --- memdb.go | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/memdb.go b/memdb.go index 64d86dca7..cb36c0156 100644 --- a/memdb.go +++ b/memdb.go @@ -20,24 +20,19 @@ type item struct { value []byte } -// Less implements btree.Item. -func Less(other item) bool { - // this considers nil == []byte{}, but that's ok since we handle nil endpoints - // in iterators specially anyway - return bytes.Compare(i.key, other.(*item).key) == -1 -} +type itemRef *item -func comparator(a, b item) bool { +func less(a, b itemRef) bool { return bytes.Compare((a.key), b.key) == -1 } // newKey creates a new key item. -func newKey(key []byte) *item { +func newKey(key []byte) itemRef { return &item{key: key} } // newPair creates a new pair item. -func newPair(key, value []byte) *item { +func newPair(key, value []byte) itemRef { return &item{key: key, value: value} } @@ -49,7 +44,7 @@ func newPair(key, value []byte) *item { // important with MemDB. type MemDB struct { mtx sync.RWMutex - btree *btree.Generic[item] + btree *btree.Generic[itemRef] } var _ DB = (*MemDB)(nil) @@ -57,7 +52,7 @@ var _ DB = (*MemDB)(nil) // NewMemDB creates a new in-memory database. func NewMemDB() *MemDB { database := &MemDB{ - btree: btree.NewGeneric[item](comparator), + btree: btree.NewGeneric[itemRef](less), } return database @@ -69,9 +64,9 @@ func (db *MemDB) Get(key []byte) ([]byte, error) { return nil, errKeyEmpty } - i := db.btree.Get(newKey(key)) - if i != nil { - return i.(*item).value, nil + i, found := db.btree.Get(newKey(key)) + if found { + return i.value, nil } return nil, nil } @@ -81,15 +76,10 @@ func (db *MemDB) Has(key []byte) (bool, error) { if len(key) == 0 { return false, errKeyEmpty } - if db.btree.Get(key) != nil { - return true, nil - } - if db.btree.Get(key) == nil { - return false, nil - } + _, found := db.btree.Get(newKey(key)) - return false, nil + return found, nil } // Set implements DB. @@ -147,7 +137,7 @@ func (db *MemDB) Close() error { // Print implements DB. func (db *MemDB) Print() error { - db.btree.Ascend(nil, func(i item) bool { + db.btree.Ascend(nil, func(i itemRef) bool { pitem := i fmt.Printf("[%X]:\t[%X]\n", pitem.key, pitem.value) return true From 1152957adce4083eb9396ca28d46c0b53f61cc24 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 20 May 2022 15:22:12 +0700 Subject: [PATCH 05/12] Create .gitpod.yml --- .gitpod.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..4b56b6b70 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,7 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. + +image: tendermintdev/docker-tm-db-testing + +# this means that there's a one-click known good environment available to developers. From 8e228b0a37cccad52772f8875b7ca7d539ab2ea3 Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:26:12 +0000 Subject: [PATCH 06/12] fmt --- boltdb.go | 1 + boltdb_batch.go | 1 + boltdb_iterator.go | 1 + boltdb_test.go | 1 + cleveldb.go | 1 + cleveldb_batch.go | 1 + cleveldb_iterator.go | 1 + cleveldb_test.go | 1 + rocksdb.go | 1 + rocksdb_batch.go | 1 + rocksdb_iterator.go | 1 + rocksdb_test.go | 1 + 12 files changed, 12 insertions(+) diff --git a/boltdb.go b/boltdb.go index 398c401a4..ffebbca0c 100644 --- a/boltdb.go +++ b/boltdb.go @@ -1,3 +1,4 @@ +//go:build boltdb // +build boltdb package db diff --git a/boltdb_batch.go b/boltdb_batch.go index 390bc309b..cd22c6741 100644 --- a/boltdb_batch.go +++ b/boltdb_batch.go @@ -1,3 +1,4 @@ +//go:build boltdb // +build boltdb package db diff --git a/boltdb_iterator.go b/boltdb_iterator.go index 74212c5ca..a62e2abb8 100644 --- a/boltdb_iterator.go +++ b/boltdb_iterator.go @@ -1,3 +1,4 @@ +//go:build boltdb // +build boltdb package db diff --git a/boltdb_test.go b/boltdb_test.go index 0fd12bbe2..e68c85b0d 100644 --- a/boltdb_test.go +++ b/boltdb_test.go @@ -1,3 +1,4 @@ +//go:build boltdb // +build boltdb package db diff --git a/cleveldb.go b/cleveldb.go index 377956deb..789673011 100644 --- a/cleveldb.go +++ b/cleveldb.go @@ -1,3 +1,4 @@ +//go:build cleveldb // +build cleveldb package db diff --git a/cleveldb_batch.go b/cleveldb_batch.go index 132a521cb..b77bd523d 100644 --- a/cleveldb_batch.go +++ b/cleveldb_batch.go @@ -1,3 +1,4 @@ +//go:build cleveldb // +build cleveldb package db diff --git a/cleveldb_iterator.go b/cleveldb_iterator.go index 04375d565..e56c35e1a 100644 --- a/cleveldb_iterator.go +++ b/cleveldb_iterator.go @@ -1,3 +1,4 @@ +//go:build cleveldb // +build cleveldb package db diff --git a/cleveldb_test.go b/cleveldb_test.go index 61e2fb6ef..9d918f36e 100644 --- a/cleveldb_test.go +++ b/cleveldb_test.go @@ -1,3 +1,4 @@ +//go:build cleveldb // +build cleveldb package db diff --git a/rocksdb.go b/rocksdb.go index dd9be2a36..06d056dd8 100644 --- a/rocksdb.go +++ b/rocksdb.go @@ -1,3 +1,4 @@ +//go:build rocksdb // +build rocksdb package db diff --git a/rocksdb_batch.go b/rocksdb_batch.go index af7e65c60..b2557ac45 100644 --- a/rocksdb_batch.go +++ b/rocksdb_batch.go @@ -1,3 +1,4 @@ +//go:build rocksdb // +build rocksdb package db diff --git a/rocksdb_iterator.go b/rocksdb_iterator.go index 9970c169e..bbecbdb94 100644 --- a/rocksdb_iterator.go +++ b/rocksdb_iterator.go @@ -1,3 +1,4 @@ +//go:build rocksdb // +build rocksdb package db diff --git a/rocksdb_test.go b/rocksdb_test.go index 6bbe51133..4eddbc56b 100644 --- a/rocksdb_test.go +++ b/rocksdb_test.go @@ -1,3 +1,4 @@ +//go:build rocksdb // +build rocksdb package db From 941bcd1a2d60198175439fd53cf60a33931e67c7 Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:33:50 +0000 Subject: [PATCH 07/12] make a notional labs docker iamge --- .github/workflows/docker.yml | 12 +++++++----- .gitpod.yml | 2 +- tools/Dockerfile | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1d8a560b3..0cf52058a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,7 +25,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=tendermintdev/docker-tm-db-testing + DOCKER_IMAGE=ghcr.io/notional-labs/tm-db VERSION=noop if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/} @@ -41,16 +41,18 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub + - + name: Login to GitHub Container Registry uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Publish to Docker Hub uses: docker/build-push-action@v3 with: context: ./tools file: ./tools/Dockerfile - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.prep.outputs.tags }} diff --git a/.gitpod.yml b/.gitpod.yml index 4b56b6b70..7b97eeb77 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,6 +2,6 @@ # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) # and commit this file to your remote git repository to share the goodness with others. -image: tendermintdev/docker-tm-db-testing +image: ghcr.io/notional-labs/tm-db # this means that there's a one-click known good environment available to developers. diff --git a/tools/Dockerfile b/tools/Dockerfile index 855414aab..3c5ba5237 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -7,7 +7,7 @@ # updates here, merge the changes here first and let the image get updated (or # push a new version manually) before PRs that depend on them. -FROM golang:1.17-bullseye AS build +FROM golang:1.18-bullseye AS build ENV LD_LIBRARY_PATH=/usr/local/lib @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ make tar wget FROM build AS install -ARG LEVELDB=1.20 +ARG LEVELDB=1.23 ARG ROCKSDB=6.24.2 # Install cleveldb From a5015d96563800ed793211282f903b7f564886ce Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:36:04 +0000 Subject: [PATCH 08/12] add workflow dispatch for docker --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0cf52058a..cd99c174e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,7 @@ name: Build & Push TM-DB-Testing on: + workflow_dispatch: pull_request: paths: - "tools/*" From 19747f9dda958ee3a0b4768842f634102641069a Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:37:04 +0000 Subject: [PATCH 09/12] add workflow dispatch for docker --- tools/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Dockerfile b/tools/Dockerfile index 3c5ba5237..04016402a 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ FROM build AS install ARG LEVELDB=1.23 -ARG ROCKSDB=6.24.2 +ARG ROCKSDB=6.29.5 # Install cleveldb RUN \ From 10c77b7f43a25a693d4ddea30adc2591a6614e0d Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:39:36 +0000 Subject: [PATCH 10/12] add workflow dispatch for docker --- .github/workflows/docker.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cd99c174e..e933d1b76 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,10 +13,6 @@ on: paths: - "tools/*" push: - branches: - - master - paths: - - "tools/*" jobs: build: From 6e78f69d90fac866df616c53d94515744bbbe6a4 Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:48:37 +0000 Subject: [PATCH 11/12] revert --- tools/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Dockerfile b/tools/Dockerfile index 04016402a..f5f46a4f6 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -16,8 +16,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ make tar wget FROM build AS install -ARG LEVELDB=1.23 -ARG ROCKSDB=6.29.5 +ARG LEVELDB=1.20 +ARG ROCKSDB=6.24.2 # Install cleveldb RUN \ From ada60b18953880798b197ddb567b3898c282872e Mon Sep 17 00:00:00 2001 From: faddat Date: Fri, 20 May 2022 08:50:07 +0000 Subject: [PATCH 12/12] ghcr --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e933d1b76..42c2752ff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -46,10 +46,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to Docker Hub + - name: Publish to Github Container registry uses: docker/build-push-action@v3 with: context: ./tools + registry: ghcr.io file: ./tools/Dockerfile push: true tags: ${{ steps.prep.outputs.tags }}