Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Updated Sandbox config, with automated data configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
  • Loading branch information
kumare3 committed Oct 31, 2023
1 parent 293cda1 commit c176c3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
25 changes: 18 additions & 7 deletions pkg/configutil/configutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,32 @@ const (
AdminConfigTemplate = `admin:
# For GRPC endpoints you might want to use dns:///flyte.myexample.com
endpoint: {{.Host}}
authType: Pkce
insecure: {{.Insecure}}
{{- if .Console}}
console:
endpoint: {{.Console}}
{{- end}}
logger:
show-source: true
level: 0`
{{- if .DataConfig}}
storage:
connection:
endpoint: {{.DataConfig.Endpoint}}
access-key: {{.DataConfig.AccessKey}}
secret-key: {{.DataConfig.SecretKey}}
{{- end}}
`
)

type DataConfig struct {
Endpoint string
AccessKey string
SecretKey string
}

type ConfigTemplateSpec struct {
Host string
Insecure bool
Console string
Host string
Insecure bool
Console string
DataConfig *DataConfig
}

var (
Expand Down
6 changes: 5 additions & 1 deletion pkg/sandbox/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func startSandbox(ctx context.Context, cli docker.Docker, g github.GHRepoService
templateValues := configutil.ConfigTemplateSpec{
Host: "localhost:30080",
Insecure: true,
Console: fmt.Sprintf("http://localhost:%d", consolePort),
DataConfig: &configutil.DataConfig{
Endpoint: "http://localhost:30002",
AccessKey: "miniostorage",
SecretKey: "minio",
},
}
if err := configutil.SetupConfig(configutil.FlytectlConfig, configutil.GetTemplate(), templateValues); err != nil {
return nil, err
Expand Down

0 comments on commit c176c3e

Please sign in to comment.