From be69482952dc1e432a720ed9ce72c68513769df1 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:44:45 -0700 Subject: [PATCH] [Monorepo] - Fix single binary (#4015) * Fix single-binary Signed-off-by: Eduardo Apolinario * Fix flyteplugins references in single-binary Signed-off-by: Eduardo Apolinario * Point to local flyteidl in single-binary Signed-off-by: Eduardo Apolinario * Fix flytecopilot references Signed-off-by: Eduardo Apolinario --------- Signed-off-by: Eduardo Apolinario Co-authored-by: Eduardo Apolinario Signed-off-by: Eduardo Apolinario --- Dockerfile | 9 +++++++++ cmd/main.go | 2 +- cmd/single/config.go | 8 ++++---- cmd/single/root.go | 6 +++--- cmd/single/secret.go | 2 +- cmd/single/start.go | 44 ++++++++++++++++++++++---------------------- go.mod | 23 ++++++++++++++++------- go.sum | 12 ------------ 8 files changed, 56 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a6f9ae6842..ea5cba63f33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,15 @@ ENV GOARCH "${TARGETARCH}" ENV GOOS linux WORKDIR /flyteorg/build + +COPY datacatalog datacatalog +COPY flyteadmin flyteadmin +COPY flytecopilot flytecopilot +COPY flyteidl flyteidl +COPY flyteplugins flyteplugins +COPY flytepropeller flytepropeller +COPY flytestdlib flytestdlib + COPY go.mod go.sum ./ RUN go mod download COPY cmd cmd diff --git a/cmd/main.go b/cmd/main.go index da2fc15ad7c..0fca35ab7db 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -2,7 +2,7 @@ package main import ( "github.com/flyteorg/flyte/cmd/single" - _ "github.com/flyteorg/flytepropeller/plugins" + _ "github.com/flyteorg/flyte/flytepropeller/plugins" "github.com/golang/glog" ) diff --git a/cmd/single/config.go b/cmd/single/config.go index a936770824c..adbabe7ae58 100644 --- a/cmd/single/config.go +++ b/cmd/single/config.go @@ -1,6 +1,6 @@ package single -import "github.com/flyteorg/flytestdlib/config" +import "github.com/flyteorg/flyte/flytestdlib/config" //go:generate pflags Config --default-var=DefaultConfig @@ -21,9 +21,9 @@ type Propeller struct { } type Admin struct { - Disabled bool `json:"disabled" pflag:",Disables flyteadmin in the single binary mode"` - DisableScheduler bool `json:"disableScheduler" pflag:",Disables Native scheduler in the single binary mode"` - DisableClusterResourceManager bool `json:"disableClusterResourceManager" pflag:",Disables Cluster resource manager"` + Disabled bool `json:"disabled" pflag:",Disables flyteadmin in the single binary mode"` + DisableScheduler bool `json:"disableScheduler" pflag:",Disables Native scheduler in the single binary mode"` + DisableClusterResourceManager bool `json:"disableClusterResourceManager" pflag:",Disables Cluster resource manager"` SeedProjects []string `json:"seedProjects" pflag:",flyte projects to create by default."` } diff --git a/cmd/single/root.go b/cmd/single/root.go index ffc90b9066f..1665b1841ff 100644 --- a/cmd/single/root.go +++ b/cmd/single/root.go @@ -6,10 +6,10 @@ import ( "fmt" "os" - "github.com/flyteorg/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flytestdlib/config" - "github.com/flyteorg/flytestdlib/config/viper" + "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/cmd/single/secret.go b/cmd/single/secret.go index 3135a9188ef..b19cef4c4ab 100644 --- a/cmd/single/secret.go +++ b/cmd/single/secret.go @@ -1,7 +1,7 @@ package single import ( - "github.com/flyteorg/flyteadmin/auth" + "github.com/flyteorg/flyte/flyteadmin/auth" "github.com/spf13/cobra" ) diff --git a/cmd/single/start.go b/cmd/single/start.go index 6712e46892a..5fc20b18d57 100644 --- a/cmd/single/start.go +++ b/cmd/single/start.go @@ -4,27 +4,27 @@ import ( "context" "net/http" - datacatalogConfig "github.com/flyteorg/datacatalog/pkg/config" - datacatalogRepo "github.com/flyteorg/datacatalog/pkg/repositories" - datacatalog "github.com/flyteorg/datacatalog/pkg/rpc/datacatalogservice" - "github.com/flyteorg/flyteadmin/pkg/clusterresource" - "github.com/flyteorg/flyteadmin/pkg/common" - "github.com/flyteorg/flyteadmin/plugins" - "github.com/flyteorg/flyteadmin/pkg/runtime" - adminServer "github.com/flyteorg/flyteadmin/pkg/server" - adminScheduler "github.com/flyteorg/flyteadmin/scheduler" - propellerEntrypoint "github.com/flyteorg/flytepropeller/pkg/controller" - propellerConfig "github.com/flyteorg/flytepropeller/pkg/controller/config" - "github.com/flyteorg/flytepropeller/pkg/controller/executors" - "github.com/flyteorg/flytepropeller/pkg/signals" - webhookEntrypoint "github.com/flyteorg/flytepropeller/pkg/webhook" - webhookConfig "github.com/flyteorg/flytepropeller/pkg/webhook/config" - "github.com/flyteorg/flytestdlib/contextutils" - "github.com/flyteorg/flytestdlib/logger" - "github.com/flyteorg/flytestdlib/profutils" - "github.com/flyteorg/flytestdlib/promutils" - "github.com/flyteorg/flytestdlib/promutils/labeled" - "github.com/flyteorg/flytestdlib/storage" + datacatalogConfig "github.com/flyteorg/flyte/datacatalog/pkg/config" + datacatalogRepo "github.com/flyteorg/flyte/datacatalog/pkg/repositories" + datacatalog "github.com/flyteorg/flyte/datacatalog/pkg/rpc/datacatalogservice" + "github.com/flyteorg/flyte/flyteadmin/pkg/clusterresource" + "github.com/flyteorg/flyte/flyteadmin/pkg/common" + "github.com/flyteorg/flyte/flyteadmin/pkg/runtime" + adminServer "github.com/flyteorg/flyte/flyteadmin/pkg/server" + "github.com/flyteorg/flyte/flyteadmin/plugins" + adminScheduler "github.com/flyteorg/flyte/flyteadmin/scheduler" + propellerEntrypoint "github.com/flyteorg/flyte/flytepropeller/pkg/controller" + propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config" + "github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors" + "github.com/flyteorg/flyte/flytepropeller/pkg/signals" + webhookEntrypoint "github.com/flyteorg/flyte/flytepropeller/pkg/webhook" + webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/profutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" _ "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" @@ -70,7 +70,7 @@ func startAdmin(ctx context.Context, cfg Admin) error { if len(cfg.SeedProjects) != 0 { projects = cfg.SeedProjects } - logger.Infof(ctx, "Seeding default projects...",projects) + logger.Infof(ctx, "Seeding default projects...", projects) if err := adminServer.SeedProjects(ctx, projects); err != nil { return err } diff --git a/go.mod b/go.mod index a895e731b0d..f256bf66ccd 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/flyteorg/flyte go 1.19 require ( - github.com/flyteorg/datacatalog v1.0.53 - github.com/flyteorg/flyteadmin v1.1.118 - github.com/flyteorg/flytepropeller v1.1.116 - github.com/flyteorg/flytestdlib v1.0.22 + github.com/flyteorg/flyte/datacatalog v0.0.0-00010101000000-000000000000 + github.com/flyteorg/flyte/flyteadmin v0.0.0-00010101000000-000000000000 + github.com/flyteorg/flyte/flytepropeller v0.0.0-00010101000000-000000000000 + github.com/flyteorg/flyte/flytestdlib v0.0.0-00010101000000-000000000000 github.com/golang/glog v1.1.0 github.com/prometheus/client_golang v1.12.1 github.com/spf13/cobra v1.4.0 @@ -71,8 +71,8 @@ require ( github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/flyteorg/flyteidl v1.5.14 // indirect - github.com/flyteorg/flyteplugins v1.1.16 // indirect + github.com/flyteorg/flyte/flyteplugins v0.0.0-00010101000000-000000000000 // indirect + github.com/flyteorg/flyteidl v0.0.0-00010101000000-000000000000 // indirect github.com/flyteorg/stow v0.3.7 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect @@ -216,4 +216,13 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20220915080349-5790c370e63a +replace ( + github.com/flyteorg/flyte/datacatalog => ./datacatalog + github.com/flyteorg/flyte/flyteadmin => ./flyteadmin + github.com/flyteorg/flyte/flytecopilot => ./flytecopilot + github.com/flyteorg/flyte/flyteplugins => ./flyteplugins + github.com/flyteorg/flyte/flytepropeller => ./flytepropeller + github.com/flyteorg/flyte/flytestdlib => ./flytestdlib + github.com/flyteorg/flyteidl => ./flyteidl + github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20220915080349-5790c370e63a +) diff --git a/go.sum b/go.sum index bf25d02f3de..50cbd1a2028 100644 --- a/go.sum +++ b/go.sum @@ -343,18 +343,6 @@ github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flyteorg/datacatalog v1.0.53 h1:h06iGGTFFPGzMCowW+HHmYSYjOiSbv73quxoEFY7H1s= -github.com/flyteorg/datacatalog v1.0.53/go.mod h1:bTNS5x+IVNuwawEQMQCRsdnV2bt750nGq+dc6cmxF6w= -github.com/flyteorg/flyteadmin v1.1.118 h1:KBXC6DeDaTJze8aCu1CmFZmKMQOaXmLek43X09yg5sI= -github.com/flyteorg/flyteadmin v1.1.118/go.mod h1:FzjmBGA3Wc1X/l3sjHD6Kgy2LEe16KHm1Mx0JPqWdAg= -github.com/flyteorg/flyteidl v1.5.14 h1:+3ewipoOp82fPyIVgvvrMq1lorl5Kz3Lh6sh/a9+loI= -github.com/flyteorg/flyteidl v1.5.14/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og= -github.com/flyteorg/flyteplugins v1.1.16 h1:DIQxPERFMvTGnLTkkeG9R8STF3YMvxK1nPtFf+a6o5Q= -github.com/flyteorg/flyteplugins v1.1.16/go.mod h1:HEd4yf0H8XfxMcHFwrTdTIJ/9lEAz83OpgcFQe47L6I= -github.com/flyteorg/flytepropeller v1.1.116 h1:qe6wOfxceTN4eqmAAb1Pj8tTcFarTkBr0uphZPNF1aM= -github.com/flyteorg/flytepropeller v1.1.116/go.mod h1:qAzIN35Xihc2B9JoMukzIBID7ZDh8xgOf9aVe56mN8M= -github.com/flyteorg/flytestdlib v1.0.22 h1:8RAc+TmME54FInf4+t6+C7X8Z/dW6i6aTs6W8SEzpI8= -github.com/flyteorg/flytestdlib v1.0.22/go.mod h1:6nXa5g00qFIsgdvQ7jKQMJmDniqO0hG6Z5X5olfduqQ= github.com/flyteorg/stow v0.3.7 h1:Cx7j8/Ux6+toD5hp5fy++927V+yAcAttDeQAlUD/864= github.com/flyteorg/stow v0.3.7/go.mod h1:5dfBitPM004dwaZdoVylVjxFT4GWAgI0ghAndhNUzCo= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=