Skip to content

Commit

Permalink
refactor: rename ApplicationInstanceSpec -> ShellSpec
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Mitchell <[email protected]>
  • Loading branch information
starpit committed Aug 20, 2024
1 parent e610ba6 commit f802462
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/dispatch/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// HLIR -> LLIR for []hlir.ParameterSweep, ...
func Lower(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
func Lower(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ShellSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
components := []llir.Component{}

for _, r := range model.ParameterSweeps {
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/dispatch/parametersweep/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"lunchpail.io/pkg/ir/llir"
)

func Lower(compilationName, runname, namespace string, sweep hlir.ParameterSweep, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, sweep hlir.ParameterSweep, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
app, err := transpile(sweep)
if err != nil {
return llir.Component{}, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/dispatch/s3/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"lunchpail.io/pkg/ir/llir"
)

func Lower(compilationName, runname, namespace string, s3 hlir.ProcessS3Objects, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, s3 hlir.ProcessS3Objects, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
app, err := transpile(s3)
if err != nil {
return llir.Component{}, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/minio/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"lunchpail.io/pkg/lunchpail"
)

func Lower(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
app, err := transpile(runname, spec)
if err != nil {
return llir.Component{}, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/minio/transpile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// Transpile minio to hlir.Application
func transpile(runname string, spec llir.ApplicationInstanceSpec) (hlir.Application, error) {
func transpile(runname string, spec llir.ShellSpec) (hlir.Application, error) {
app := hlir.NewApplication(runname + "-minio")

app.Spec.Image = "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z"
Expand Down
4 changes: 2 additions & 2 deletions pkg/fe/transformer/api/shell/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"lunchpail.io/pkg/util"
)

func Lower(compilationName, runname, namespace string, app hlir.Application, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, app hlir.Application, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
var component lunchpail.Component
switch app.Spec.Role {
case "worker":
Expand All @@ -26,7 +26,7 @@ func Lower(compilationName, runname, namespace string, app hlir.Application, spe
return LowerAsComponent(compilationName, runname, namespace, app, spec, opts, verbose, component)
}

func LowerAsComponent(compilationName, runname, namespace string, app hlir.Application, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool, component lunchpail.Component) (llir.Component, error) {
func LowerAsComponent(compilationName, runname, namespace string, app hlir.Application, spec llir.ShellSpec, opts compilation.Options, verbose bool, component lunchpail.Component) (llir.Component, error) {
sizing := spec.Sizing
if sizing.Workers == 0 {
sizing = api.ApplicationSizing(app, opts)
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/workerpool/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"lunchpail.io/pkg/lunchpail"
)

func Lower(compilationName, runname, namespace string, app hlir.Application, pool hlir.WorkerPool, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, app hlir.Application, pool hlir.WorkerPool, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
spec.RunAsJob = true
spec.Sizing = api.WorkerpoolSizing(pool, app, opts)
spec.InstanceName = pool.Metadata.Name
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/workerpool/lowerall.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// HLIR -> LLIR for []hlir.WorkerPool
func LowerAll(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
func LowerAll(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ShellSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
components := []llir.Component{}

app, found := model.GetApplicationByRole(hlir.WorkerRole)
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/api/workstealer/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"lunchpail.io/pkg/lunchpail"
)

func Lower(compilationName, runname, namespace string, app hlir.Application, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
func Lower(compilationName, runname, namespace string, app hlir.Application, spec llir.ShellSpec, opts compilation.Options, verbose bool) (llir.Component, error) {
app, err := transpile(runname)
if err != nil {
return llir.Component{}, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// HLIR -> LLIR for []hlir.Application
func lowerApplications(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ApplicationInstanceSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
func lowerApplications(compilationName, runname, namespace string, model hlir.AppModel, spec llir.ShellSpec, opts compilation.Options, verbose bool) ([]llir.Component, error) {
components := []llir.Component{}

for _, r := range model.Applications {
Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/transformer/lower.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// HLIR -> LLIR
func Lower(compilationName, runname, namespace string, model hlir.AppModel, queueSpec queue.Spec, yamlValues string, opts compilation.Options, verbose bool) (llir.LLIR, error) {
spec := llir.ApplicationInstanceSpec{Queue: queueSpec, Values: llir.Values{Yaml: yamlValues}}
spec := llir.ShellSpec{Queue: queueSpec, Values: llir.Values{Yaml: yamlValues}}

minio, err := minio.Lower(compilationName, runname, namespace, model, spec, opts, verbose)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Values struct {
Yaml string
}

type ApplicationInstanceSpec struct {
type ShellSpec struct {
// Use a Job-style (versus Pod-style) of deployment?
RunAsJob bool

Expand Down

0 comments on commit f802462

Please sign in to comment.