forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip Signed-off-by: Ketan Umare <[email protected]> * WIP, almost there Signed-off-by: Ketan Umare <[email protected]> * wip Signed-off-by: Ketan Umare <[email protected]> * working Signed-off-by: Ketan Umare <[email protected]> * Using go:embed to embed console into the go binary Signed-off-by: Ketan Umare <[email protected]> * updated Signed-off-by: Ketan Umare <[email protected]> * Not working (added datacatalog) Signed-off-by: Ketan Umare <[email protected]> * Updated console.go Signed-off-by: Kevin Su <[email protected]> * working Signed-off-by: Ketan Umare <[email protected]> * updated Signed-off-by: Ketan Umare <[email protected]> * working /console/ Signed-off-by: Ketan Umare <[email protected]> * Updated console - this time working Signed-off-by: Ketan Umare <[email protected]> * Add dockerfile to build sandbox-lite Signed-off-by: Kevin Su <[email protected]> * Updated dockerfile Signed-off-by: Kevin Su <[email protected]> * added unit test Signed-off-by: Ketan Umare <[email protected]> * Updated dockerfile Signed-off-by: Kevin Su <[email protected]> * Updated helm chart Signed-off-by: Kevin Su <[email protected]> * Updated grpc port Signed-off-by: Kevin Su <[email protected]> * Updated helm docs Signed-off-by: Kevin Su <[email protected]> * updated config Signed-off-by: Kevin Su <[email protected]> * updated datacatalog Signed-off-by: Kevin Su <[email protected]> * updated admin Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Updated dependencies Signed-off-by: Kevin Su <[email protected]> * Push sandbox-lite in github action Signed-off-by: Kevin Su <[email protected]> * Ability to disable certain things in single binary mode Signed-off-by: Ketan Umare <[email protected]> * Updated dockerfile Signed-off-by: Kevin Su <[email protected]> * helm chart and updated docker file Signed-off-by: Kevin Su <[email protected]> * Webhook Signed-off-by: Kevin Su <[email protected]> * webhook config Signed-off-by: Kevin Su <[email protected]> * remove metricsBindAddress Signed-off-by: Kevin Su <[email protected]> * fix helm tests Signed-off-by: Kevin Su <[email protected]> * Updated propeller Signed-off-by: Kevin Su <[email protected]> * Configure serviceHttpEndpoint Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update flyte components versions Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * update datacatalog version Signed-off-by: Katrina Rogan <[email protected]> * set go version for generating flyte manifest Signed-off-by: Katrina Rogan <[email protected]> * debug Signed-off-by: Katrina Rogan <[email protected]> * Fix error Signed-off-by: Kevin Su <[email protected]> * Update propeller Signed-off-by: Kevin Su <[email protected]> * Update propeller Signed-off-by: Kevin Su <[email protected]> * revert Signed-off-by: Katrina Rogan <[email protected]> * update GA Signed-off-by: Kevin Su <[email protected]> * Removed storage chart Signed-off-by: Yuvraj <[email protected]> * Refactor dockerfile Signed-off-by: Yuvraj <[email protected]> * Added postgres port in docker file Signed-off-by: Yuvraj <[email protected]> * more changes Signed-off-by: Yuvraj <[email protected]> * fix docker restart Signed-off-by: Yuvraj <[email protected]> * added namespace template in helm deps chart Signed-off-by: Yuvraj <[email protected]> * Disable contour and make helm Signed-off-by: Kevin Su <[email protected]> * Disable contour and make helm Signed-off-by: Kevin Su <[email protected]> * Updated flyteconsole Signed-off-by: Kevin Su <[email protected]> * Updated flyteadmin Signed-off-by: Kevin Su <[email protected]> * typo Signed-off-by: Kevin Su <[email protected]> * Added template and make helm Signed-off-by: Kevin Su <[email protected]> * Updated template Signed-off-by: Kevin Su <[email protected]> * Updated alpine Signed-off-by: Kevin Su <[email protected]> Co-authored-by: Kevin Su <[email protected]> Co-authored-by: Haytham Abuelfutuh <[email protected]> Co-authored-by: Katrina Rogan <[email protected]> Co-authored-by: Yuvraj <[email protected]>
- Loading branch information
1 parent
2a46122
commit 0bb8568
Showing
26 changed files
with
3,526 additions
and
3,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/flyteorg/flyte/cmd/single" | ||
_ "github.com/flyteorg/flytepropeller/plugins" | ||
"github.com/golang/glog" | ||
) | ||
|
||
func main() { | ||
glog.V(2).Info("Starting Flyte") | ||
err := single.Execute() | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package single | ||
|
||
import "github.com/flyteorg/flytestdlib/config" | ||
|
||
//go:generate pflags Config --default-var=DefaultConfig | ||
|
||
var ( | ||
DefaultConfig = &Config{} | ||
configSection = config.MustRegisterSection("flyte", DefaultConfig) | ||
) | ||
|
||
type Config struct { | ||
Propeller Propeller `json:"propeller" pflag:",Configuration to disable propeller or any of its components."` | ||
Admin Admin `json:"admin" pflag:",Configuration to disable FlyteAdmin or any of its components"` | ||
DataCatalog DataCatalog `json:"data_catalog" pflag:",Configuration to disable DataCatalog or any of its components"` | ||
} | ||
|
||
type Propeller struct { | ||
Disabled bool `json:"disabled" pflag:",Disables flytepropeller in the single binary mode"` | ||
DisableWebhook bool `json:"disable_webhook" pflag:",Disables webhook only"` | ||
} | ||
|
||
type Admin struct { | ||
Disabled bool `json:"disabled" pflag:",Disables flyteadmin in the single binary mode"` | ||
DisableScheduler bool `json:"disable_scheduler" pflag:",Disables Native scheduler in the single binary mode"` | ||
DisableClusterResourceManager bool `json:"disable_cluster_resource_manager" pflag:",Disables Cluster resource manager"` | ||
} | ||
|
||
type DataCatalog struct { | ||
Disabled bool `json:"disabled" pflag:",Disables datacatalog in the single binary mode"` | ||
} | ||
|
||
// GetConfig returns a handle to the configuration for Flyte Single Binary | ||
func GetConfig() *Config { | ||
return configSection.GetConfig().(*Config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package single | ||
|
||
import ( | ||
"embed" | ||
"net/http" | ||
"strings" | ||
) | ||
|
||
//go:embed dist/* | ||
var console embed.FS | ||
|
||
const consoleRoot = "/console" | ||
const assetsDir = "assets" | ||
const packageDir = "dist" | ||
const indexHTML = "/index.html" | ||
|
||
// GetConsoleFile returns the console file that should be used for the given path. | ||
// Every path has a '/console' as the prefix. After dropping this prefix, the following 3 rules are checked | ||
// Rule 1: If path is now "" or "/" then return index.html | ||
// Rule 2: If path contains no "assets" sub-string and has an additional substring "/", then return "index.html". | ||
// This is to allow vanity urls in React | ||
// Rule 3: Finally return every file path as is | ||
// For every file add a "dist" as the prefix, as every file is assumed to be packaged in "dist" folder fv | ||
func GetConsoleFile(name string) string { | ||
name = strings.TrimPrefix(name, consoleRoot) | ||
name = strings.TrimPrefix(name, "/"+assetsDir) | ||
if name == "" || name == "/" { | ||
name = indexHTML | ||
} else if !strings.Contains(name, assetsDir) { | ||
if strings.Contains(name[1:], "/") { | ||
name = indexHTML | ||
} | ||
} | ||
return packageDir + name | ||
} | ||
|
||
type consoleFS struct { | ||
fs http.FileSystem | ||
} | ||
|
||
// Open Implements a specific handler for Console - SinglePage React App | ||
// the path re-writing is critical | ||
func (f consoleFS) Open(name string) (http.File, error) { | ||
return f.fs.Open(GetConsoleFile(name)) | ||
} | ||
|
||
// GetConsoleHandlers returns a set of handlers that can be added to the Server mux and can handle all console related | ||
// requests | ||
func GetConsoleHandlers() map[string]func(http.ResponseWriter, *http.Request) { | ||
handlers := make(map[string]func(http.ResponseWriter, *http.Request)) | ||
// Serves console | ||
consoleHandler := http.FileServer(consoleFS{fs: http.FS(console)}) | ||
|
||
// This is the base handle for "/console" | ||
handlers[consoleRoot] = func(writer http.ResponseWriter, request *http.Request) { | ||
consoleHandler.ServeHTTP(writer, request) | ||
} | ||
|
||
// this is the root handler for any pattern that matches "/console/ | ||
// http.mux needs a trailing "/" to allow longest pattern matching. | ||
// For the previous handler "/console" the mux will only consider exact match | ||
handlers[consoleRoot+"/"] = func(writer http.ResponseWriter, request *http.Request) { | ||
consoleHandler.ServeHTTP(writer, request) | ||
} | ||
return handlers | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package single | ||
|
||
import "testing" | ||
|
||
func TestGetConsoleFile(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
want string | ||
}{ | ||
{"/console", "dist/index.html"}, | ||
{"/console/", "dist/index.html"}, | ||
{"/console/main.js", "dist/main.js"}, | ||
{"/console/assets/xyz.png", "dist/assets/xyz.png"}, | ||
{"/console/assets/dir/xyz.png", "dist/assets/dir/xyz.png"}, | ||
{"console/projects/flytesnacks/workflows?domain=development", "dist/index.html"}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := GetConsoleFile(tt.name); got != tt.want { | ||
t.Errorf("GetConsoleFile() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.