diff --git a/Makefile b/Makefile index bc2f0c58d..e09f59dd8 100644 --- a/Makefile +++ b/Makefile @@ -10,21 +10,25 @@ update_boilerplate: linux_compile: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flytepropeller ./cmd/controller/main.go GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/kubectl-flyte ./cmd/kubectl-flyte/main.go + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/build-tool ./cmd/build-tool/main.go .PHONY: compile compile: mkdir -p ./bin go build -o bin/flytepropeller ./cmd/controller/main.go go build -o bin/kubectl-flyte ./cmd/kubectl-flyte/main.go && cp bin/kubectl-flyte ${GOPATH}/bin + go build -o bin/build-tool ./cmd/build-tool/main.go && cp bin/build-tool ${GOPATH}/bin cross_compile: @glide install @mkdir -p ./bin/cross GOOS=linux GOARCH=amd64 go build -o bin/cross/flytepropeller ./cmd/controller/main.go GOOS=linux GOARCH=amd64 go build -o bin/cross/kubectl-flyte ./cmd/kubectl-flyte/main.go + GOOS=linux GOARCH=amd64 go build -o bin/cross/build-tool ./cmd/build-tool/main.go op_code_generate: @RESOURCE_NAME=flyteworkflow OPERATOR_PKG=github.com/lyft/flytepropeller ./hack/update-codegen.sh + @openapi-gen -i github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1 -p github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1 benchmark: mkdir -p ./bin/benchmark @@ -41,6 +45,7 @@ clean: # Generate golden files. Add test packages that generate golden files here. golden: go test ./cmd/kubectl-flyte/cmd -update + go test ./cmd/build-tool/cmd -update go test ./pkg/compiler/test -update .PHONY: test_unit_codecov diff --git a/cmd/build-tool/cmd/crd/flyteworkflow.go b/cmd/build-tool/cmd/crd/flyteworkflow.go new file mode 100644 index 000000000..bd34efc49 --- /dev/null +++ b/cmd/build-tool/cmd/crd/flyteworkflow.go @@ -0,0 +1,43 @@ +package crd + +import ( + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + "log" + + "github.com/kubeflow/crd-validation/pkg/crd/exporter" + "github.com/kubeflow/crd-validation/pkg/utils" +) + +const ( + // CRDName is the name for FlyteWorkflow. + CRDNameFlyteWorkflow = "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.FlyteWorkflow" + + generatedFileFlyteWorkflow = "flyteworkflow-crd-v1alpha1.yaml" +) + +// FlyteWorkflowGenerator is the type for FlyteWorkflow CRD generator. +type FlyteWorkflowGenerator struct { + *exporter.Exporter +} + +// Creates a new CRD generator which outputs to a file. +func NewFlyteWorkflowGenerator(outputDir string) *FlyteWorkflowGenerator { + return &FlyteWorkflowGenerator{ + Exporter: exporter.NewFileExporter(outputDir, generatedFileFlyteWorkflow), + } +} + +// Creates a new CRD generator which outputs to stdout. +func NewFlyteWorkflowGeneratorStdout() *FlyteWorkflowGenerator { + return &FlyteWorkflowGenerator{ + Exporter: exporter.NewStdoutExporter(), + } +} + +// Generate generates the crd. +func (t FlyteWorkflowGenerator) Generate(original *apiextensions.CustomResourceDefinition) *apiextensions.CustomResourceDefinition { + log.Println("Generating validation") + original.Spec.Validation = utils.GetCustomResourceValidation(CRDNameFlyteWorkflow, v1alpha1.GetOpenAPIDefinitions) + return original +} diff --git a/cmd/build-tool/cmd/crd_validation.go b/cmd/build-tool/cmd/crd_validation.go new file mode 100644 index 000000000..57ca5a788 --- /dev/null +++ b/cmd/build-tool/cmd/crd_validation.go @@ -0,0 +1,95 @@ +package cmd + +import ( + "github.com/spf13/viper" + "log" + + compilerErrors "github.com/lyft/flytepropeller/pkg/compiler/errors" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + + "github.com/kubeflow/crd-validation/pkg/config" + "github.com/lyft/flytepropeller/cmd/build-tool/cmd/crd" +) + +const ( + configKey = "config-file" + baseCrdKey = "base-crd" +) + + +const crdValidationCmdName = "crd-validation" + +type CrdValidationOpts struct { + *RootOptions + configFile string + baseCrdFile string + dryRun bool +} + +func NewCrdValidationCommand(opts *RootOptions) *cobra.Command { + + crdValidationOpts := &CrdValidationOpts{ + RootOptions: opts, + } + + crdValidationCmd := &cobra.Command{ + Use: crdValidationCmdName, + Aliases: []string{"validate"}, + Short: "Augment a CRD YAML file with validation section based on a base CRD file", + Long: ``, + RunE: func(cmd *cobra.Command, args []string) error { + if err := requiredFlags(cmd, baseCrdKey); err != nil { + return err + } + + compilerErrors.SetIncludeSource() + + return crdValidationOpts.generateValidation() + }, + } + + crdValidationCmd.Flags().StringVarP(&crdValidationOpts.configFile, configKey, "c", "", "Path of the config file for the execution of CRD validation") + crdValidationCmd.Flags().StringVarP(&crdValidationOpts.baseCrdFile, baseCrdKey, "b", "", "Path to base CRD file.") + crdValidationCmd.Flags().BoolVarP(&crdValidationOpts.dryRun, "dry-run", "d", false, "Compiles and transforms, but does not create a workflow. OutputsRef ts to STDOUT.") + + return crdValidationCmd +} + +func (c *CrdValidationOpts) initConfig() error { + if c.configFile != "" { // enable ability to specify config file via flag + viper.SetConfigFile(c.configFile) + log.Println("Using config file:", viper.ConfigFileUsed()) + } + + viper.SetConfigType("yaml") // Set config type to yaml + + // If a config file is found, read it in. + if err := viper.ReadInConfig(); err != nil { + return errors.Wrapf(err, "Failed to read config file.") + } else { + log.Println("Using config file:", viper.ConfigFileUsed()) + } + return nil +} + + +func (c *CrdValidationOpts) generateValidation() error { + + err := c.initConfig() + var generator *crd.FlyteWorkflowGenerator + if err != nil { + log.Println("Output will be written to Stdout") + generator = crd.NewFlyteWorkflowGeneratorStdout() + } else { + crdValidationConfig := config.GetCrdValidationConfig() + generator = crd.NewFlyteWorkflowGenerator(crdValidationConfig.OutputDir) + } + + original := config.NewCustomResourceDefinition(c.baseCrdFile) + final := generator.Generate(original) + generator.Export(final) + + return nil +} diff --git a/cmd/build-tool/cmd/root.go b/cmd/build-tool/cmd/root.go new file mode 100644 index 000000000..2f2bf688e --- /dev/null +++ b/cmd/build-tool/cmd/root.go @@ -0,0 +1,55 @@ +package cmd + +import ( + "context" + "flag" + "fmt" + "os" + "runtime" + + "github.com/lyft/flytestdlib/logger" + "github.com/lyft/flytestdlib/version" + "github.com/spf13/pflag" + + "github.com/spf13/cobra" +) + +func init() { + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + err := flag.CommandLine.Parse([]string{}) + if err != nil { + logger.Error(context.TODO(), "Error in initializing: %v", err) + os.Exit(-1) + } +} + +type RootOptions struct { + configFile string +} + +func (r *RootOptions) executeRootCmd() error { + ctx := context.TODO() + logger.Infof(ctx, "Go Version: %s", runtime.Version()) + logger.Infof(ctx, "Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH) + version.LogBuildInformation("build-tool") + return fmt.Errorf("use one of the sub-commands") +} + +// NewCommand returns a new instance of an argo command +func NewBuildToolCommand() *cobra.Command { + rootOpts := &RootOptions{} + command := &cobra.Command{ + Use: "build-tool", + Short: "build-tool are utility commands that help validating crds, etc.", + Long: `Flyte is a serverless workflow processing platform built for native execution on K8s. + It is extensible and flexible to allow adding new operators and comes with many operators built in`, + RunE: func(cmd *cobra.Command, args []string) error { + return rootOpts.executeRootCmd() + }, + } + + command.AddCommand(NewCrdValidationCommand(rootOpts)) + return command +} + + diff --git a/cmd/build-tool/cmd/utils.go b/cmd/build-tool/cmd/utils.go new file mode 100644 index 000000000..a2346ae9a --- /dev/null +++ b/cmd/build-tool/cmd/utils.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func requiredFlags(cmd *cobra.Command, flags ...string) error { + for _, flag := range flags { + f := cmd.Flag(flag) + if f == nil { + return fmt.Errorf("unable to find Key [%v]", flag) + } + } + + return nil +} diff --git a/cmd/build-tool/main.go b/cmd/build-tool/main.go new file mode 100644 index 000000000..caeae0f75 --- /dev/null +++ b/cmd/build-tool/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "os" + + "github.com/lyft/flytepropeller/cmd/build-tool/cmd" +) + +func main() { + rootCmd := cmd.NewBuildToolCommand() + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} diff --git a/pkg/apis/flyteworkflow/v1alpha1/branch.go b/pkg/apis/flyteworkflow/v1alpha1/branch.go index 692e73e0e..1357d8222 100644 --- a/pkg/apis/flyteworkflow/v1alpha1/branch.go +++ b/pkg/apis/flyteworkflow/v1alpha1/branch.go @@ -71,6 +71,7 @@ func (in *IfBlock) GetThenNode() *NodeID { type BranchNodeSpec struct { If IfBlock `json:"if"` + // +listType=atomic ElseIf []*IfBlock `json:"elseIf,omitempty"` Else *NodeID `json:"else,omitempty"` ElseFail *Error `json:"elseFail,omitempty"` diff --git a/pkg/apis/flyteworkflow/v1alpha1/doc.go b/pkg/apis/flyteworkflow/v1alpha1/doc.go index 37762e696..7ac2fcc58 100644 --- a/pkg/apis/flyteworkflow/v1alpha1/doc.go +++ b/pkg/apis/flyteworkflow/v1alpha1/doc.go @@ -1,4 +1,5 @@ // +k8s:deepcopy-gen=package +// +k8s:openapi-gen=true // Package v1alpha1 is the v1alpha1 version of the API. // +groupName=flyteworkflow.flyte.net diff --git a/pkg/apis/flyteworkflow/v1alpha1/nodes.go b/pkg/apis/flyteworkflow/v1alpha1/nodes.go index 1a4d2c049..557fab588 100644 --- a/pkg/apis/flyteworkflow/v1alpha1/nodes.go +++ b/pkg/apis/flyteworkflow/v1alpha1/nodes.go @@ -99,9 +99,11 @@ type NodeSpec struct { BranchNode *BranchNodeSpec `json:"branch,omitempty"` TaskRef *TaskID `json:"task,omitempty"` WorkflowNode *WorkflowNodeSpec `json:"workflow,omitempty"` + // +listType=atomic InputBindings []*Binding `json:"inputBindings,omitempty"` Config *typesv1.ConfigMap `json:"config,omitempty"` RetryStrategy *RetryStrategy `json:"retry,omitempty"` + // +listType=atomic OutputAliases []Alias `json:"outputAlias,omitempty"` // SecurityContext holds pod-level security attributes and common container settings. @@ -115,6 +117,7 @@ type NodeSpec struct { // +optional // +patchMergeKey=name // +patchStrategy=merge + // +listType=atomic ImagePullSecrets []typesv1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"` // Specifies the hostname of the Pod // If not specified, the pod's hostname will be set to a system-defined value. @@ -133,6 +136,7 @@ type NodeSpec struct { SchedulerName string `json:"schedulerName,omitempty" protobuf:"bytes,19,opt,name=schedulerName"` // If specified, the pod's tolerations. // +optional + // +listType=atomic Tolerations []typesv1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"` // Node execution timeout ExecutionDeadline *v1.Duration `json:"executionDeadline,omitempty"` diff --git a/pkg/apis/flyteworkflow/v1alpha1/openapi_generated.go b/pkg/apis/flyteworkflow/v1alpha1/openapi_generated.go new file mode 100644 index 000000000..5c3b2e432 --- /dev/null +++ b/pkg/apis/flyteworkflow/v1alpha1/openapi_generated.go @@ -0,0 +1,1162 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +// This file was autogenerated by openapi-gen. Do not edit it manually! + +package v1alpha1 + +import ( + spec "github.com/go-openapi/spec" + common "k8s.io/kube-openapi/pkg/common" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Alias": schema_pkg_apis_flyteworkflow_v1alpha1_Alias(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Binding": schema_pkg_apis_flyteworkflow_v1alpha1_Binding(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BooleanExpression": schema_pkg_apis_flyteworkflow_v1alpha1_BooleanExpression(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeSpec": schema_pkg_apis_flyteworkflow_v1alpha1_BranchNodeSpec(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_BranchNodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Connections": schema_pkg_apis_flyteworkflow_v1alpha1_Connections(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.DynamicNodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_DynamicNodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Error": schema_pkg_apis_flyteworkflow_v1alpha1_Error(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.FlyteWorkflow": schema_pkg_apis_flyteworkflow_v1alpha1_FlyteWorkflow(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.FlyteWorkflowList": schema_pkg_apis_flyteworkflow_v1alpha1_FlyteWorkflowList(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Identifier": schema_pkg_apis_flyteworkflow_v1alpha1_Identifier(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.IfBlock": schema_pkg_apis_flyteworkflow_v1alpha1_IfBlock(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Inputs": schema_pkg_apis_flyteworkflow_v1alpha1_Inputs(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeMetadata": schema_pkg_apis_flyteworkflow_v1alpha1_NodeMetadata(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeSpec": schema_pkg_apis_flyteworkflow_v1alpha1_NodeSpec(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_NodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.OutputVarMap": schema_pkg_apis_flyteworkflow_v1alpha1_OutputVarMap(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.RetryStrategy": schema_pkg_apis_flyteworkflow_v1alpha1_RetryStrategy(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.SubWorkflowNodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_SubWorkflowNodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskExecutionIdentifier": schema_pkg_apis_flyteworkflow_v1alpha1_TaskExecutionIdentifier(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskNodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_TaskNodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskSpec": schema_pkg_apis_flyteworkflow_v1alpha1_TaskSpec(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowExecutionIdentifier": schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowExecutionIdentifier(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeSpec": schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowNodeSpec(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeStatus": schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowNodeStatus(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowSpec": schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowSpec(ref), + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowStatus": schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowStatus(ref), + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Alias(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Alias": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Alias"), + }, + }, + }, + Required: []string{"Alias"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Alias"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Binding(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Binding": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Binding"), + }, + }, + }, + Required: []string{"Binding"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Binding"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_BooleanExpression(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "BooleanExpression": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.BooleanExpression"), + }, + }, + }, + Required: []string{"BooleanExpression"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.BooleanExpression"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_BranchNodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "if": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.IfBlock"), + }, + }, + "elseIf": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.IfBlock"), + }, + }, + }, + }, + }, + "else": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "elseFail": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Error"), + }, + }, + }, + Required: []string{"if"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Error", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.IfBlock"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_BranchNodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "finalNodeId": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"phase", "finalNodeId"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Connections(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "DownstreamEdges": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + "UpstreamEdges": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + }, + Required: []string{"DownstreamEdges", "UpstreamEdges"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_DynamicNodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"phase"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Error(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Error": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Error"), + }, + }, + }, + Required: []string{"Error"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Error"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_FlyteWorkflow(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FlyteWorkflow: represents one Execution Workflow object", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowSpec"), + }, + }, + "inputs": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Inputs"), + }, + }, + "executionId": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowExecutionIdentifier"), + }, + }, + "tasks": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskSpec"), + }, + }, + }, + }, + }, + "subWorkflows": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowSpec"), + }, + }, + }, + }, + }, + "activeDeadlineSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "acceptedAt": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the time when the workflow has been accepted into the system. (e.g. When Flyte Admin received the request to create an execution).", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "serviceAccountName": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status is the only mutable section in the workflow. It holds all the execution information", + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowStatus"), + }, + }, + }, + Required: []string{"spec", "executionId", "tasks"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Inputs", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskSpec", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowExecutionIdentifier", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowSpec", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_FlyteWorkflowList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FlyteWorkflowList is a list of Foo resources", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.FlyteWorkflow"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.FlyteWorkflow", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Identifier(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Identifier": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Identifier"), + }, + }, + }, + Required: []string{"Identifier"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.Identifier"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_IfBlock(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "condition": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BooleanExpression"), + }, + }, + "then": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"condition", "then"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BooleanExpression"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_Inputs(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "LiteralMap": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.LiteralMap"), + }, + }, + }, + Required: []string{"LiteralMap"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.LiteralMap"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_NodeMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "NodeMetadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.NodeMetadata"), + }, + }, + }, + Required: []string{"NodeMetadata"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.NodeMetadata"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_NodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "branch": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeSpec"), + }, + }, + "task": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "workflow": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeSpec"), + }, + }, + "inputBindings": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Binding"), + }, + }, + }, + }, + }, + "config": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.ConfigMap"), + }, + }, + "retry": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.RetryStrategy"), + }, + }, + "outputAlias": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Alias"), + }, + }, + }, + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", + Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), + }, + }, + "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + }, + }, + }, + "hostname": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", + Type: []string{"string"}, + Format: "", + }, + }, + "subdomain": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", + Type: []string{"string"}, + Format: "", + }, + }, + "affinity": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's scheduling constraints", + Ref: ref("k8s.io/api/core/v1.Affinity"), + }, + }, + "schedulerName": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", + Type: []string{"string"}, + Format: "", + }, + }, + "tolerations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "If specified, the pod's tolerations.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/api/core/v1.Toleration"), + }, + }, + }, + }, + }, + "activeDeadlineSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"id", "kind"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Alias", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Binding", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeSpec", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.RetryStrategy", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeSpec", "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.ConfigMap", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.Toleration"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_NodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "queuedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "startedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "stoppedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastUpdatedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "dataDir": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "attempts": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "cached": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "dirty": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "parentNode": { + SchemaProps: spec.SchemaProps{ + Description: "This is useful only for branch nodes. If this is set, then it can be used to determine if execution can proceed", + Type: []string{"string"}, + Format: "", + }, + }, + "parentTask": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskExecutionIdentifier"), + }, + }, + "branchStatus": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeStatus"), + }, + }, + "subNodeStatus": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeStatus"), + }, + }, + }, + }, + }, + "workflowNodeStatus": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeStatus"), + }, + }, + "subWorkflowStatus": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.SubWorkflowNodeStatus"), + }, + }, + "dynamicNodeStatus": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.DynamicNodeStatus"), + }, + }, + }, + Required: []string{"phase", "attempts", "cached", "dirty"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.BranchNodeStatus", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.DynamicNodeStatus", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeStatus", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.SubWorkflowNodeStatus", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.TaskExecutionIdentifier", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.WorkflowNodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_OutputVarMap(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "VariableMap": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.VariableMap"), + }, + }, + }, + Required: []string{"VariableMap"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.VariableMap"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_RetryStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Strategy to be used to Retry a node that is in RetryableFailure state", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "minAttempts": { + SchemaProps: spec.SchemaProps{ + Description: "MinAttempts implies the atleast n attempts to try this node before giving up. The atleast here is because we may fail to write the attempt information and end up retrying again. Also `0` and `1` both mean atleast one attempt will be done. 0 is a degenerate case.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"minAttempts"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_SubWorkflowNodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"phase"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_TaskExecutionIdentifier(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TaskExecutionIdentifier": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.TaskExecutionIdentifier"), + }, + }, + }, + Required: []string{"TaskExecutionIdentifier"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.TaskExecutionIdentifier"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_TaskNodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "phaseVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "custom": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_TaskSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TaskTemplate": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.TaskTemplate"), + }, + }, + }, + Required: []string{"TaskTemplate"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.TaskTemplate"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowExecutionIdentifier(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "WorkflowExecutionIdentifier": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.WorkflowExecutionIdentifier"), + }, + }, + }, + Required: []string{"WorkflowExecutionIdentifier"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core.WorkflowExecutionIdentifier"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowNodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "launchPlanRefId": { + SchemaProps: spec.SchemaProps{ + Description: "Either one of the two", + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Identifier"), + }, + }, + "subWorkflowRef": { + SchemaProps: spec.SchemaProps{ + Description: "We currently want the SubWorkflow to be completely contained in the node. this is because We use the node status to store the information of the execution. Important Note: This may cause a bloat in case we use the same SubWorkflow in multiple nodes. The recommended technique for that is to use launch plan refs. This is because we will end up executing the launch plan refs as disparate executions in Flyte propeller. This is potentially better as it prevents us from hitting the storage limit in etcd Workflow *WorkflowSpec `json:\"workflow,omitempty\"`", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Identifier"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowNodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkflowSpec is the spec for the actual Flyte Workflow (DAG)", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "nodes": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeSpec"), + }, + }, + }, + }, + }, + "connections": { + SchemaProps: spec.SchemaProps{ + Description: "Defines the set of connections (both data dependencies and execution dependencies) that the graph is formed of. The execution engine will respect and follow these connections as it determines which nodes can and should be executed.", + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Connections"), + }, + }, + "onFailure": { + SchemaProps: spec.SchemaProps{ + Description: "Defines a single node to execute in case the system determined the Workflow has failed.", + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeSpec"), + }, + }, + "outputs": { + SchemaProps: spec.SchemaProps{ + Description: "Defines the declaration of the outputs types and names this workflow is expected to generate.", + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.OutputVarMap"), + }, + }, + "outputBindings": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Defines the data links used to construct the final outputs of the workflow. Bindings will typically refer to specific outputs of a subset of the nodes executed in the Workflow. When executing the end-node, the execution engine will traverse these bindings and assemble the final set of outputs of the workflow.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Binding"), + }, + }, + }, + }, + }, + }, + Required: []string{"id", "nodes", "connections"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Binding", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.Connections", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeSpec", "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.OutputVarMap"}, + } +} + +func schema_pkg_apis_flyteworkflow_v1alpha1_WorkflowStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "startedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "stoppedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastUpdatedAt": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "dataDir": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "outputRef": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "nodeStatus": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeStatus"), + }, + }, + }, + }, + }, + "failedAttempts": { + SchemaProps: spec.SchemaProps{ + Description: "Number of Attempts completed with rounds resulting in error. this is used to cap out poison pill workflows that spin in an error loop. The value should be set at the global level and will be enforced. At the end of the retries the workflow will fail", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"phase"}, + }, + }, + Dependencies: []string{ + "github.com/lyft/flytepropeller/pkg/apis/flyteworkflow/v1alpha1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} diff --git a/pkg/apis/flyteworkflow/v1alpha1/workflow.go b/pkg/apis/flyteworkflow/v1alpha1/workflow.go index 2da5bd62a..67715a1ea 100644 --- a/pkg/apis/flyteworkflow/v1alpha1/workflow.go +++ b/pkg/apis/flyteworkflow/v1alpha1/workflow.go @@ -20,6 +20,7 @@ const EndNodeID = "end-node" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen=true // FlyteWorkflow: represents one Execution Workflow object type FlyteWorkflow struct { @@ -179,6 +180,7 @@ type WorkflowSpec struct { // Defines the data links used to construct the final outputs of the workflow. Bindings will typically // refer to specific outputs of a subset of the nodes executed in the Workflow. When executing the end-node, // the execution engine will traverse these bindings and assemble the final set of outputs of the workflow. + // +listType=atomic OutputBindings []*Binding `json:"outputBindings,omitempty"` } @@ -236,9 +238,11 @@ func (in *WorkflowSpec) GetNodes() []NodeID { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:openapi-gen:true // FlyteWorkflowList is a list of FlyteWorkflow resources type FlyteWorkflowList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` + // +listType=atomic Items []FlyteWorkflow `json:"items"` }