Skip to content

Commit

Permalink
now compiles
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Nov 27, 2023
1 parent 6cbd980 commit 7c2ad06
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/workflows/flyteidl-buf-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Publish flyteidl Buf Package
on:
push:
branches:
- artifacts-shell
- artifacts
- master
paths:
Expand Down
13 changes: 11 additions & 2 deletions flyteadmin/pkg/artifacts/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ func (a *ArtifactRegistry) GetClient() artifact.ArtifactRegistryClient {
return a.client
}

func NewArtifactRegistry(ctx context.Context, _ *Config, _ ...grpc.DialOption) *ArtifactRegistry {
cfg := admin2.GetConfig(ctx)
// NewArtifactRegistry todo: update this to return error, and proper cfg handling.
// if nil, should either call the default config or return an error
func NewArtifactRegistry(ctx context.Context, connCfg *admin2.Config, _ ...grpc.DialOption) *ArtifactRegistry {

var cfg = connCfg
if connCfg == nil {
//cfg = admin2.GetConfig(ctx)
return &ArtifactRegistry{
client: nil,
}
}
clients, err := admin2.NewClientsetBuilder().WithConfig(cfg).Build(ctx)
if err != nil {
logger.Errorf(ctx, "Failed to create Artifact client")
Expand Down
6 changes: 3 additions & 3 deletions flyteadmin/pkg/rpc/adminservice/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package adminservice
import (
"context"
"fmt"
admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin"
"runtime/debug"

"github.com/golang/protobuf/proto"
Expand Down Expand Up @@ -115,9 +116,8 @@ func NewAdminServer(ctx context.Context, pluginRegistry *plugins.Registry, confi

var artifactRegistry *artifacts.ArtifactRegistry
if configuration.ApplicationConfiguration().GetTopLevelConfig().FeatureGates.EnableArtifacts {
artifactRegistry = artifacts.NewArtifactRegistry(ctx, configuration.ApplicationConfiguration().GetArtifactsConfig())
} else {
artifactRegistry = nil
adminClientCfg := admin2.GetConfig(ctx)
artifactRegistry = artifacts.NewArtifactRegistry(ctx, adminClientCfg)
}

launchPlanManager := manager.NewLaunchPlanManager(
Expand Down
8 changes: 0 additions & 8 deletions flyteadmin/pkg/runtime/application_config_provider.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package runtime

import (
artifactsClient "github.com/flyteorg/flyte/flyteadmin/pkg/artifacts"
"github.com/flyteorg/flyte/flyteadmin/pkg/common"
"github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces"
"github.com/flyteorg/flyte/flytestdlib/config"
Expand All @@ -16,7 +15,6 @@ const notifications = "notifications"
const domains = "domains"
const externalEvents = "externalEvents"
const cloudEvents = "cloudEvents"
const artifact = "artifacts"
const metricPort = 10254

const KB = 1024
Expand Down Expand Up @@ -86,8 +84,6 @@ var cloudEventsConfig = config.MustRegisterSection(cloudEvents, &interfaces.Clou
Type: common.Local,
})

var artifactsConfig = config.MustRegisterSection(artifact, &artifactsClient.Config{})

// Implementation of an interfaces.ApplicationConfiguration
type ApplicationConfigurationProvider struct{}

Expand Down Expand Up @@ -123,10 +119,6 @@ func (p *ApplicationConfigurationProvider) GetCloudEventsConfig() *interfaces.Cl
return cloudEventsConfig.GetConfig().(*interfaces.CloudEventsConfig)
}

func (p *ApplicationConfigurationProvider) GetArtifactsConfig() *artifactsClient.Config {
return artifactsConfig.GetConfig().(*artifactsClient.Config)
}

func NewApplicationConfigurationProvider() interfaces.ApplicationConfiguration {
return &ApplicationConfigurationProvider{}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/golang/protobuf/ptypes/wrappers"
"golang.org/x/time/rate"

artifactsClient "github.com/flyteorg/flyte/flyteadmin/pkg/artifacts"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/config"
Expand Down Expand Up @@ -592,5 +591,4 @@ type ApplicationConfiguration interface {
GetDomainsConfig() *DomainsConfig
GetExternalEventsConfig() *ExternalEventsConfig
GetCloudEventsConfig() *CloudEventsConfig
GetArtifactsConfig() *artifactsClient.Config
}
6 changes: 0 additions & 6 deletions flyteadmin/pkg/runtime/mocks/mock_application_provider.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mocks

import (
artifactsClient "github.com/flyteorg/flyte/flyteadmin/pkg/artifacts"
"github.com/flyteorg/flyte/flyteadmin/pkg/runtime/interfaces"
"github.com/flyteorg/flyte/flytestdlib/database"
)
Expand All @@ -15,7 +14,6 @@ type MockApplicationProvider struct {
domainsConfig interfaces.DomainsConfig
externalEventsConfig interfaces.ExternalEventsConfig
cloudEventConfig interfaces.CloudEventsConfig
artifactsConfig artifactsClient.Config
}

func (p *MockApplicationProvider) GetDbConfig() *database.DbConfig {
Expand Down Expand Up @@ -81,7 +79,3 @@ func (p *MockApplicationProvider) SetCloudEventsConfig(cloudEventConfig interfac
func (p *MockApplicationProvider) GetCloudEventsConfig() *interfaces.CloudEventsConfig {
return &p.cloudEventConfig
}

func (p *MockApplicationProvider) GetArtifactsConfig() *artifactsClient.Config {
return &p.artifactsConfig
}
1 change: 0 additions & 1 deletion flyteidl/protos/flyteidl/artifact/artifacts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import "flyteidl/core/identifier.proto";
import "flyteidl/core/artifact_id.proto";
import "flyteidl/core/interface.proto";
import "flyteidl/event/cloudevents.proto";
// TODO remove me

message Artifact {
core.ArtifactID artifact_id = 1;
Expand Down

0 comments on commit 7c2ad06

Please sign in to comment.