Skip to content

Commit 1178e39

Browse files
joelanfordtmshort
authored andcommitted
pkg/cache: add preferred pogreb database cache impl (#1278)
* declcfg: concurrently load and process files in WalkMetasFS Signed-off-by: Joe Lanford <[email protected]> * pkg/cache: add preferred pogreb database cache impl * refactoring to avoid code duplication Signed-off-by: Joe Lanford <[email protected]> * pkg/cache: memory efficient cache building Signed-off-by: Joe Lanford <[email protected]> * cmd/opm/serve: improve logging related to caches Signed-off-by: Joe Lanford <[email protected]> --------- Signed-off-by: Joe Lanford <[email protected]> Upstream-repository: operator-registry Upstream-commit: 5b5181b46f0ef7e7d8c4ed4c64db3fdd4f5db373
1 parent 60eb2b1 commit 1178e39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+9183
-1077
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ require (
4848
github.com/Microsoft/go-winio v0.6.1 // indirect
4949
github.com/Microsoft/hcsshim v0.12.0-rc.3 // indirect
5050
github.com/NYTimes/gziphandler v1.1.1 // indirect
51+
github.com/akrylysov/pogreb v0.10.2 // indirect
5152
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
5253
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
5354
github.com/beorn7/perks v1.0.1 // indirect
@@ -187,6 +188,7 @@ require (
187188
github.com/spiffe/go-spiffe/v2 v2.2.0 // indirect
188189
github.com/stoewer/go-strcase v1.3.0 // indirect
189190
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
191+
github.com/tidwall/btree v1.7.0 // indirect
190192
github.com/ulikunitz/xz v0.5.11 // indirect
191193
github.com/vbatts/tar-split v0.11.5 // indirect
192194
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt
4747
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
4848
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
4949
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
50+
github.com/akrylysov/pogreb v0.10.2 h1:e6PxmeyEhWyi2AKOBIJzAEi4HkiC+lKyCocRGlnDi78=
51+
github.com/akrylysov/pogreb v0.10.2/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI=
5052
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
5153
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
5254
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
@@ -662,6 +664,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
662664
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
663665
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI=
664666
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
667+
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
668+
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
665669
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
666670
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
667671
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=

staging/operator-registry/alpha/action/render.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9-
"io"
109
"os"
1110
"path/filepath"
1211
"sort"
@@ -17,7 +16,6 @@ import (
1716
"github.com/h2non/filetype"
1817
"github.com/h2non/filetype/matchers"
1918
"github.com/operator-framework/api/pkg/operators/v1alpha1"
20-
"github.com/sirupsen/logrus"
2119
"k8s.io/apimachinery/pkg/util/sets"
2220

2321
"github.com/operator-framework/operator-registry/alpha/declcfg"
@@ -26,6 +24,7 @@ import (
2624
"github.com/operator-framework/operator-registry/pkg/image"
2725
"github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
2826
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
27+
"github.com/operator-framework/operator-registry/pkg/lib/log"
2928
"github.com/operator-framework/operator-registry/pkg/registry"
3029
"github.com/operator-framework/operator-registry/pkg/sqlite"
3130
)
@@ -61,12 +60,6 @@ type Render struct {
6160
skipSqliteDeprecationLog bool
6261
}
6362

64-
func nullLogger() *logrus.Entry {
65-
logger := logrus.New()
66-
logger.SetOutput(io.Discard)
67-
return logrus.NewEntry(logger)
68-
}
69-
7063
func (r Render) Run(ctx context.Context) (*declcfg.DeclarativeConfig, error) {
7164
if r.skipSqliteDeprecationLog {
7265
// exhaust once with a no-op function.
@@ -119,7 +112,7 @@ func (r Render) createRegistry() (*containerdregistry.Registry, error) {
119112
// The containerd registry impl is somewhat verbose, even on the happy path,
120113
// so discard all logger logs. Any important failures will be returned from
121114
// registry methods and eventually logged as fatal errors.
122-
containerdregistry.WithLog(nullLogger()),
115+
containerdregistry.WithLog(log.Null()),
123116
)
124117
if err != nil {
125118
return nil, err

0 commit comments

Comments
 (0)