From f01a82221cf2672507ffbbec5fc4c772e74532c6 Mon Sep 17 00:00:00 2001 From: Haytham Abuelfutuh Date: Tue, 29 Mar 2022 16:48:16 -0700 Subject: [PATCH] Missed PR Comments (#381) Signed-off-by: Haytham Abuelfutuh --- dataproxy/service.go | 7 +++---- pkg/rpc/adminservice/base.go | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dataproxy/service.go b/dataproxy/service.go index 6586995fd..49477eb85 100644 --- a/dataproxy/service.go +++ b/dataproxy/service.go @@ -23,7 +23,6 @@ import ( type Service struct { service.DataProxyServer - *service.UnimplementedDataProxyServer cfg config.DataProxyConfig dataStore *storage.DataStore @@ -77,6 +76,8 @@ func (s Service) CreateUploadLocation(ctx context.Context, req *service.CreateUp }, nil } +// createShardedStorageLocation creates a location in storage destination to maximize read/write performance in most +// block stores. The final location should look something like: s3://// func createShardedStorageLocation(ctx context.Context, req *service.CreateUploadLocationRequest, shardSelector ioutils.ShardSelector, store *storage.DataStore, cfg config.DataProxyUploadConfig) (storage.DataReference, error) { keySuffixArr := make([]string, 0, 4) @@ -90,10 +91,8 @@ func createShardedStorageLocation(ctx context.Context, req *service.CreateUpload return "", err } - keySuffixArr = append([]string{prefix}, keySuffixArr...) - storagePath, err := store.ConstructReference(ctx, store.GetBaseContainerFQN(ctx), - keySuffixArr...) + append([]string{prefix}, keySuffixArr...)...) if err != nil { return "", fmt.Errorf("failed to construct datastore reference. Error: %w", err) } diff --git a/pkg/rpc/adminservice/base.go b/pkg/rpc/adminservice/base.go index feca32fca..c9dcc4ee7 100644 --- a/pkg/rpc/adminservice/base.go +++ b/pkg/rpc/adminservice/base.go @@ -7,7 +7,7 @@ import ( "github.com/flyteorg/flyteadmin/plugins" - interfaces2 "github.com/flyteorg/flyteadmin/pkg/runtime/interfaces" + runtimeIfaces "github.com/flyteorg/flyteadmin/pkg/runtime/interfaces" "github.com/flyteorg/flyteadmin/pkg/repositories/errors" @@ -59,7 +59,7 @@ func (m *AdminService) interceptPanic(ctx context.Context, request proto.Message const defaultRetries = 3 -func NewAdminServer(ctx context.Context, pluginRegistry *plugins.Registry, configuration interfaces2.Configuration, +func NewAdminServer(ctx context.Context, pluginRegistry *plugins.Registry, configuration runtimeIfaces.Configuration, kubeConfig, master string, dataStorageClient *storage.DataStore, adminScope promutils.Scope) *AdminService { applicationConfiguration := configuration.ApplicationConfiguration().GetTopLevelConfig()