Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-storage-id-to-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
itaigilo committed Jan 17, 2025
2 parents 3dbd9d1 + 14afd5d commit 1ced59b
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
enforce-label:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 #tag 2.2.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
stale:
name: Close stale issues and PRs
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Close stale issues and PRs
uses: actions/stale@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/compatibility-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ jobs:
- 1.47.0
# Do *not* test 1.48.0, we withdrew it.
- 1.48.1
- 1.48.2
runs-on: ubuntu-22.04
env:
TAG: ${{ matrix.lakefs_version }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/esti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
name: Build and push Docker image
needs: [ check-secrets, gen-code ]
if: needs.check-secrets.outputs.secretsavailable == 'true'
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-22.04-16-cores
outputs:
tag: ${{ needs.gen-code.outputs.tag }}
steps:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
type=s3,region=us-east-1,bucket=lakefs-docker-cache,name=lakefs,mode=max
login-to-amazon-ecr:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [ check-secrets ]
if: needs.check-secrets.outputs.secretsavailable == 'true'
steps:
Expand All @@ -147,7 +147,7 @@ jobs:
unified-gc-test:
name: Test unified gc
needs: [deploy-image, login-to-amazon-ecr, build-spark3-metadata-client]
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-22.04-8-cores
services:
lakefs:
image: ${{ needs.login-to-amazon-ecr.outputs.registry }}/lakefs:${{ needs.deploy-image.outputs.tag }}
Expand Down Expand Up @@ -650,7 +650,7 @@ jobs:

build-spark3-metadata-client:
name: Build metadata client for Spark 3.x
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-22.04-8-cores
needs: [check-secrets, deploy-image, login-to-amazon-ecr]
env:
TAG: ${{ needs.deploy-image.outputs.tag }}
Expand Down Expand Up @@ -1159,7 +1159,7 @@ jobs:
needs:
- deploy-image
- login-to-amazon-ecr
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-22.04-8-cores
timeout-minutes: 20
services:
dynamodb:
Expand Down Expand Up @@ -1278,7 +1278,7 @@ jobs:
needs:
- deploy-image
- login-to-amazon-ecr
runs-on: ubuntu-latest-8-cores
runs-on: ubuntu-22.04-8-cores
timeout-minutes: 20
services:
dynamodb:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link-issue-to-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
check_pull_requests:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Check linked issues
steps:
- uses: nearform/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-wrapper-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
paths-filter:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
client-change: ${{ steps.filter.outputs.client == 'true' }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# v1.48.2

:bug: Bugs fixed:
- added storage namespace validation on non-readonly bare repo creation (#8364)

# v1.48.1

:bug: Bugs fixed:
Expand Down
4 changes: 2 additions & 2 deletions cmd/lakefs/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/go-co-op/gocron"
"github.com/spf13/cobra"
"github.com/spf13/viper"
blockfactory "github.com/treeverse/lakefs/modules/block/factory"
"github.com/treeverse/lakefs/pkg/actions"
"github.com/treeverse/lakefs/pkg/api"
"github.com/treeverse/lakefs/pkg/auth"
Expand All @@ -26,7 +27,6 @@ import (
authremote "github.com/treeverse/lakefs/pkg/auth/remoteauthenticator"
"github.com/treeverse/lakefs/pkg/authentication"
"github.com/treeverse/lakefs/pkg/block"
"github.com/treeverse/lakefs/pkg/block/factory"
"github.com/treeverse/lakefs/pkg/catalog"
"github.com/treeverse/lakefs/pkg/config"
"github.com/treeverse/lakefs/pkg/gateway"
Expand Down Expand Up @@ -201,7 +201,7 @@ var runCmd = &cobra.Command{
stats.WithLogger(logger.WithField("service", "stats_collector")))

// init block store
blockStore, err := factory.BuildBlockAdapter(ctx, bufferedCollector, cfg)
blockStore, err := blockfactory.BuildBlockAdapter(ctx, bufferedCollector, cfg)
if err != nil {
logger.WithError(err).Fatal("Failed to create block adapter")
}
Expand Down
1 change: 1 addition & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ go 1.23

use (
.
./modules/block/factory
./webui
)
19 changes: 19 additions & 0 deletions modules/block/factory/build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package factory

import (
"context"

"github.com/treeverse/lakefs/pkg/block"
"github.com/treeverse/lakefs/pkg/block/factory"
"github.com/treeverse/lakefs/pkg/block/params"
"github.com/treeverse/lakefs/pkg/stats"
)

func BuildBlockAdapter(ctx context.Context, statsCollector stats.Collector, c params.AdapterConfig) (block.Adapter, error) {
adapter, err := factory.BuildBlockAdapter(ctx, statsCollector, c)
if err != nil {
return nil, err
}

return block.NewMetricsAdapter(adapter), nil
}
5 changes: 5 additions & 0 deletions modules/block/factory/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/treeverse/lakefs/modules/block/factory

go 1.23

// This module uses the go.work file to get all package dependencies from lakefs
6 changes: 6 additions & 0 deletions modules/block/factory/go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
go 1.23

use (
.
../../..
)
9 changes: 0 additions & 9 deletions pkg/block/factory/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ const (
)

func BuildBlockAdapter(ctx context.Context, statsCollector stats.Collector, c params.AdapterConfig) (block.Adapter, error) {
adapter, err := buildBlockAdapter(ctx, statsCollector, c)
if err != nil {
return nil, err
}

return block.NewMetricsAdapter(adapter), nil
}

func buildBlockAdapter(ctx context.Context, statsCollector stats.Collector, c params.AdapterConfig) (block.Adapter, error) {
blockstore := strings.ToLower(c.BlockstoreType())
logging.FromContext(ctx).
WithField("type", blockstore).
Expand Down
4 changes: 2 additions & 2 deletions pkg/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/rs/xid"
"github.com/treeverse/lakefs/pkg/batch"
"github.com/treeverse/lakefs/pkg/block"
"github.com/treeverse/lakefs/pkg/block/factory"
blockfactory "github.com/treeverse/lakefs/pkg/block/factory"
"github.com/treeverse/lakefs/pkg/config"
"github.com/treeverse/lakefs/pkg/graveler"
"github.com/treeverse/lakefs/pkg/graveler/branch"
Expand Down Expand Up @@ -307,7 +307,7 @@ func makeBranchApproximateOwnershipParams(cfg config.ApproximatelyCorrectOwnersh

func New(ctx context.Context, cfg Config) (*Catalog, error) {
ctx, cancelFn := context.WithCancel(ctx)
adapter, err := factory.BuildBlockAdapter(ctx, nil, cfg.Config)
adapter, err := blockfactory.BuildBlockAdapter(ctx, nil, cfg.Config)
if err != nil {
cancelFn()
return nil, fmt.Errorf("build block adapter: %w", err)
Expand Down
8 changes: 4 additions & 4 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
awsconfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/go-test/deep"
"github.com/spf13/viper"
blockfactory "github.com/treeverse/lakefs/modules/block/factory"
"github.com/treeverse/lakefs/pkg/block"
"github.com/treeverse/lakefs/pkg/block/factory"
"github.com/treeverse/lakefs/pkg/block/gs"
"github.com/treeverse/lakefs/pkg/block/local"
"github.com/treeverse/lakefs/pkg/config"
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestConfig_BuildBlockAdapter(t *testing.T) {
t.Run("local block adapter", func(t *testing.T) {
c, err := newConfigFromFile("testdata/valid_config.yaml")
testutil.Must(t, err)
adapter, err := factory.BuildBlockAdapter(ctx, nil, c)
adapter, err := blockfactory.BuildBlockAdapter(ctx, nil, c)
testutil.Must(t, err)
metricsAdapter, ok := adapter.(*block.MetricsAdapter)
if !ok {
Expand All @@ -127,7 +127,7 @@ func TestConfig_BuildBlockAdapter(t *testing.T) {
c, err := newConfigFromFile("testdata/valid_s3_adapter_config.yaml")
testutil.Must(t, err)

_, err = factory.BuildBlockAdapter(ctx, nil, c)
_, err = blockfactory.BuildBlockAdapter(ctx, nil, c)
var errProfileNotExists awsconfig.SharedConfigProfileNotExistError
if !errors.As(err, &errProfileNotExists) {
t.Fatalf("expected a config.SharedConfigProfileNotExistError, got '%v'", err)
Expand All @@ -137,7 +137,7 @@ func TestConfig_BuildBlockAdapter(t *testing.T) {
t.Run("gs block adapter", func(t *testing.T) {
c, err := newConfigFromFile("testdata/valid_gs_adapter_config.yaml")
testutil.Must(t, err)
adapter, err := factory.BuildBlockAdapter(ctx, nil, c)
adapter, err := blockfactory.BuildBlockAdapter(ctx, nil, c)
testutil.Must(t, err)

metricsAdapter, ok := adapter.(*block.MetricsAdapter)
Expand Down

0 comments on commit 1ced59b

Please sign in to comment.