Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Jun 10, 2024
1 parent 30108cc commit 9710584
Show file tree
Hide file tree
Showing 36 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion flyteadmin/auth/authzserver/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func RegisterHandlers(handler interfaces.HandlerRegisterer, authCtx interfaces.AuthenticationContext) {
// If using flyte self auth server, OAuth2Provider != nil
if authCtx.OAuth2Provider() != nil {
// SetSupportedTaskType up oauthserver endpoints. You could also use gorilla/mux or any other router.
// Set up oauthserver endpoints. You could also use gorilla/mux or any other router.
handler.HandleFunc(authorizeRelativeURL.String(), getAuthEndpoint(authCtx))
handler.HandleFunc(authorizeCallbackRelativeURL.String(), getAuthCallbackEndpoint(authCtx))
handler.HandleFunc(tokenRelativeURL.String(), getTokenEndpointHandler(authCtx))
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/auth/identity_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ type IdentityContext struct {
appID string
authenticatedAt time.Time
userInfo *service.UserInfoResponse
// SetSupportedTaskType to pointer just to keep this struct go-simple to support equal operator
// Set to pointer just to keep this struct go-simple to support equal operator
scopes *sets.String
// Raw JWT token from the IDP. SetSupportedTaskType to a pointer to support the equal operator for this struct.
// Raw JWT token from the IDP. Set to a pointer to support the equal operator for this struct.
claims *claimsType
// executionIdentity stores a unique string that can be used to identify the user associated with a given task.
// This identifier is passed down to the ExecutionSpec and can be used for various purposes, such as setting the user identifier on a pod label.
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/pkg/common/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (
valueNotInQuery = "%s not in (?)"
)

// SetSupportedTaskType of available filters which exclusively accept a single argument value.
// Set of available filters which exclusively accept a single argument value.
var singleValueFilters = map[FilterExpression]bool{
Contains: true,
GreaterThan: true,
Expand All @@ -58,7 +58,7 @@ var singleValueFilters = map[FilterExpression]bool{
NotEqual: true,
}

// SetSupportedTaskType of available filters which exclusively accept repeated argument values.
// Set of available filters which exclusively accept repeated argument values.
var repeatedValueFilters = map[FilterExpression]bool{
ValueIn: true,
ValueNotIn: true,
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ func resolveAuthRole(request *admin.ExecutionCreateRequest, launchPlan *admin.La
return &admin.AuthRole{}
}

// SetSupportedTaskType role permissions based on launch plan Auth values.
// Set role permissions based on launch plan Auth values.
// The branched-ness of this check is due to the presence numerous deprecated fields
if launchPlan.Spec.GetAuthRole() != nil {
return launchPlan.Spec.GetAuthRole()
Expand Down
26 changes: 13 additions & 13 deletions flyteadmin/pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ func makeExecutionWithEnvs(
}

func TestRelaunchExecution(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1487,7 +1487,7 @@ func TestRelaunchExecution(t *testing.T) {
}

func TestRelaunchExecution_GetExistingFailure(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)

Expand Down Expand Up @@ -1524,7 +1524,7 @@ func TestRelaunchExecution_GetExistingFailure(t *testing.T) {
}

func TestRelaunchExecution_CreateFailure(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1564,7 +1564,7 @@ func TestRelaunchExecution_CreateFailure(t *testing.T) {
}

func TestRelaunchExecutionInterruptibleOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1615,7 +1615,7 @@ func TestRelaunchExecutionInterruptibleOverride(t *testing.T) {
}

func TestRelaunchExecutionOverwriteCacheOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1738,7 +1738,7 @@ func TestRelaunchExecutionOverwriteCacheOverride(t *testing.T) {
}

func TestRelaunchExecutionEnvsOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1790,7 +1790,7 @@ func TestRelaunchExecutionEnvsOverride(t *testing.T) {
}

func TestRecoverExecution(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -1953,7 +1953,7 @@ func TestRecoverExecution_RecoveredChildNode(t *testing.T) {
}

func TestRecoverExecution_GetExistingFailure(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
r := plugins.NewRegistry()
Expand Down Expand Up @@ -1989,7 +1989,7 @@ func TestRecoverExecution_GetExistingFailure(t *testing.T) {
}

func TestRecoverExecution_GetExistingInputsFailure(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)

Expand Down Expand Up @@ -2027,7 +2027,7 @@ func TestRecoverExecution_GetExistingInputsFailure(t *testing.T) {
}

func TestRecoverExecutionInterruptibleOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -2090,7 +2090,7 @@ func TestRecoverExecutionInterruptibleOverride(t *testing.T) {
}

func TestRecoverExecutionOverwriteCacheOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -2151,7 +2151,7 @@ func TestRecoverExecutionOverwriteCacheOverride(t *testing.T) {
}

func TestRecoverExecutionEnvsOverride(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
mockExecutor := workflowengineMocks.WorkflowExecutor{}
Expand Down Expand Up @@ -3896,7 +3896,7 @@ func TestCreateExecution_LegacyClient(t *testing.T) {
}

func TestRelaunchExecution_LegacyModel(t *testing.T) {
// SetSupportedTaskType up mocks.
// Set up mocks.
repository := getMockRepositoryForExecTest()
setDefaultLpCallbackForExecTest(repository)
storageClient := getMockStorageForExecTest(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/pkg/manager/impl/launch_plan_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (m *LaunchPlanManager) enableLaunchPlan(ctx context.Context, request admin.
logger.Debugf(ctx, "Failed to find launch plan to enable with id [%+v] and err %v", request.Id, err)
return nil, err
}
// SetSupportedTaskType desired launch plan version to active:
// Set desired launch plan version to active:
err = m.updateLaunchPlanModelState(&newlyActiveLaunchPlanModel, admin.LaunchPlanState_ACTIVE)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/pkg/repositories/config/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var LegacyMigrations = []*gormigrate.Migration{
return tx.Table("named_entity_metadata").Migrator().DropColumn(&models.NamedEntityMetadata{}, "state")
},
},
// SetSupportedTaskType default state value for workflow model
// Set default state value for workflow model
{
ID: "2020-04-03-named-entity-state-default",
Migrate: func(tx *gorm.DB) error {
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/pkg/repositories/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ func setupDbConnectionPool(ctx context.Context, gormDb *gorm.DB, dbConfig *datab
genericDb.SetConnMaxLifetime(dbConfig.ConnMaxLifeTime.Duration)
genericDb.SetMaxIdleConns(dbConfig.MaxIdleConnections)
genericDb.SetMaxOpenConns(dbConfig.MaxOpenConnections)
logger.Infof(ctx, "SetSupportedTaskType connection pool values to [%+v]", genericDb.Stats())
logger.Infof(ctx, "Set connection pool values to [%+v]", genericDb.Stats())
return nil
}
2 changes: 1 addition & 1 deletion flytectl/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Config struct {
Project string `json:"project" pflag:",Specifies the project to work on."`
Domain string `json:"domain" pflag:",Specifies the domain to work on."`
Output string `json:"output" pflag:",Specifies the output type."`
Interactive bool `json:"interactive" pflag:",SetSupportedTaskType this to trigger bubbletea interface."`
Interactive bool `json:"interactive" pflag:",Set this to trigger bubbletea interface."`
}

// OutputFormat will return output format
Expand Down
4 changes: 2 additions & 2 deletions flytectl/cmd/create/execution_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func createExecutionRequestForWorkflow(ctx context.Context, workflowName, projec

envs := makeEnvs(executionConfig)

// SetSupportedTaskType both deprecated field and new field for security identity passing
// Set both deprecated field and new field for security identity passing
var securityContext *core.SecurityContext
var authRole *admin.AuthRole

Expand Down Expand Up @@ -77,7 +77,7 @@ func createExecutionRequestForTask(ctx context.Context, taskName string, project

envs := makeEnvs(executionConfig)

// SetSupportedTaskType both deprecated field and new field for security identity passing
// Set both deprecated field and new field for security identity passing
var securityContext *core.SecurityContext
var authRole *admin.AuthRole

Expand Down
2 changes: 1 addition & 1 deletion flytectl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newRootCmd() *cobra.Command {
rootCmd.PersistentFlags().StringVarP(&(config.GetConfig().Project), "project", "p", "", "Specifies the Flyte project.")
rootCmd.PersistentFlags().StringVarP(&(config.GetConfig().Domain), "domain", "d", "", "Specifies the Flyte project's domain.")
rootCmd.PersistentFlags().StringVarP(&(config.GetConfig().Output), "output", "o", printer.OutputFormatTABLE.String(), fmt.Sprintf("Specifies the output type - supported formats %s. NOTE: dot, doturl are only supported for Workflow", printer.OutputFormats()))
rootCmd.PersistentFlags().BoolVarP(&(config.GetConfig().Interactive), "interactive", "i", false, "SetSupportedTaskType this flag to use an interactive CLI")
rootCmd.PersistentFlags().BoolVarP(&(config.GetConfig().Interactive), "interactive", "i", false, "Set this flag to use an interactive CLI")

rootCmd.AddCommand(get.CreateGetCommand())
compileCmd := compile.CreateCompileCommand()
Expand Down
2 changes: 1 addition & 1 deletion flyteidl/clients/go/admin/auth_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *proxyAuthTransport) RoundTrip(req *http.Request) (*http.Response, error
return c.transport.RoundTrip(req)
}

// SetSupportedTaskType up http client used in oauth2
// Set up http client used in oauth2
func setHTTPClientContext(ctx context.Context, cfg *Config, proxyCredentialsFuture *PerRPCCredentialsFuture) context.Context {
httpClient := &http.Client{}
transport := &http.Transport{}
Expand Down
4 changes: 2 additions & 2 deletions flyteidl/clients/go/admin/auth_interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *authMetadataServer) Start(_ context.Context) error {
s.lck.Lock()
defer s.lck.Unlock()

/***** SetSupportedTaskType up the server serving channelz service. *****/
/***** Set up the server serving channelz service. *****/

lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", s.grpcPort))
if err != nil {
Expand Down Expand Up @@ -404,7 +404,7 @@ func TestSetHTTPClientContext(t *testing.T) {
t.Run("proxy url", func(t *testing.T) {
cfg := &Config{
HTTPProxyURL: config.
URL{URL: url.URL{
URL{URL: url.URL{
Scheme: "http",
Host: "localhost:8080",
}},
Expand Down
2 changes: 1 addition & 1 deletion flyteidl/clients/go/coreutils/literals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ func TestMakeLiteralForType(t *testing.T) {
assert.Equal(t, "", l.GetScalar().GetPrimitive().GetStringValue())
})

t.Run("Structured Data SetSupportedTaskType", func(t *testing.T) {
t.Run("Structured Data Set", func(t *testing.T) {
var dataSetColumns []*core.StructuredDatasetType_DatasetColumn
dataSetColumns = append(dataSetColumns, &core.StructuredDatasetType_DatasetColumn{
Name: "Price",
Expand Down
2 changes: 1 addition & 1 deletion flyteidl/gen/pb-go/flyteidl/service/auth.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/array/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func DetermineDiscoverability(ctx context.Context, tCtx core.TaskExecutionContex
// If the task is not discoverable, then skip data catalog work and move directly to launch
if taskTemplate.Metadata == nil || !taskTemplate.Metadata.Discoverable {
logger.Infof(ctx, "Task is not discoverable, moving to launch phase...")
// SetSupportedTaskType an all set indexes to cache. This task won't try to write to catalog anyway.
// Set an all set indexes to cache. This task won't try to write to catalog anyway.
state = state.SetIndexesToCache(arrayCore.InvertBitSet(bitarray.NewBitSet(uint(arrayJobSize)), uint(arrayJobSize)))
state = state.SetPhase(arrayCore.PhasePreLaunch, core.DefaultPhaseVersion).SetReason("Task is not discoverable.")

Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/array/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func buildFinalPhases(executedTasks bitarray.CompactArray, indexes *bitarray.Bit
res.SetItem(arrayCore.CalculateOriginalIndex(i, indexes), phaseIdx)
}

// SetSupportedTaskType phases os already discovered tasks to success
// Set phases os already discovered tasks to success
for i := uint(0); i < totalSize; i++ {
if !indexes.IsSet(i) {
res.SetItem(int(i), bitarray.Item(pluginCore.PhaseSuccess))
Expand Down
8 changes: 4 additions & 4 deletions flyteplugins/go/tasks/plugins/k8s/dask/dask.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ func createWorkerSpec(cluster plugins.DaskWorkerGroup, podSpec *v1.PodSpec, prim
}
primaryContainer.Name = "dask-worker"

// SetSupportedTaskType custom image if present
// Set custom image if present
if cluster.GetImage() != "" {
primaryContainer.Image = cluster.GetImage()
}

// SetSupportedTaskType custom resources
// Set custom resources
resources := &primaryContainer.Resources
clusterResources := cluster.GetResources()
if len(clusterResources.Requests) >= 1 || len(clusterResources.Limits) >= 1 {
Expand All @@ -139,7 +139,7 @@ func createWorkerSpec(cluster plugins.DaskWorkerGroup, podSpec *v1.PodSpec, prim
}
primaryContainer.Resources = *resources

// SetSupportedTaskType custom args
// Set custom args
workerArgs := []string{
"dask-worker",
"--name",
Expand Down Expand Up @@ -217,7 +217,7 @@ func createSchedulerSpec(scheduler plugins.DaskScheduler, clusterName string, po

schedulerPodSpec.RestartPolicy = v1.RestartPolicyAlways

// SetSupportedTaskType primary container
// Set primary container
err = replacePrimaryContainer(schedulerPodSpec, primaryContainerName, *primaryContainer)
if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (pytorchOperatorResourceHandler) BuildResource(ctx context.Context, taskCtx
workerReplicas := pytorchTaskExtraArgs.GetWorkers()
workerReplicaSpec.Replicas = &workerReplicas

// SetSupportedTaskType elastic config
// Set elastic config
elasticConfig := pytorchTaskExtraArgs.GetElasticConfig()
if elasticConfig != nil {
elasticPolicy = ParseElasticConfig(elasticConfig)
Expand All @@ -102,7 +102,7 @@ func (pytorchOperatorResourceHandler) BuildResource(ctx context.Context, taskCtx
if kfPytorchTaskExtraArgs.GetRunPolicy() != nil {
runPolicy = common.ParseRunPolicy(*kfPytorchTaskExtraArgs.GetRunPolicy())
}
// SetSupportedTaskType elastic config
// Set elastic config
elasticConfig := kfPytorchTaskExtraArgs.GetElasticConfig()
if elasticConfig != nil {
elasticPolicy = ParseElasticConfig(elasticConfig)
Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/k8s/spark/spark.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func getSparkConfig(taskCtx pluginsCore.TaskExecutionContext, sparkJob *plugins.
}
}

// SetSupportedTaskType pod limits.
// Set pod limits.
if len(sparkConfig[sparkOpConfig.SparkDriverCoreLimitKey]) == 0 {
// spark.kubernetes.driver.request.cores takes precedence over spark.driver.cores
if len(sparkConfig[sparkOpConfig.SparkDriverCoreRequestKey]) != 0 {
Expand Down
6 changes: 3 additions & 3 deletions flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ func dummySparkTaskContext(taskTemplate *core.TaskTemplate, interruptible bool)
}

func defaultPluginConfig() *config.K8sPluginConfig {
// SetSupportedTaskType Interruptible Config
// Set Interruptible Config
runAsUser := int64(1000)
dnsOptVal1 := "1"
dnsOptVal2 := "1"
dnsOptVal3 := "3"

// SetSupportedTaskType scheduler
// Set scheduler
schedulerName := "custom-scheduler"

// Node selectors
Expand Down Expand Up @@ -541,7 +541,7 @@ func TestBuildResourceContainer(t *testing.T) {
// Case1: Valid Spark Task-Template
taskTemplate := dummySparkTaskTemplateContainer("blah-1", dummySparkConf)

// SetSupportedTaskType spark custom feature config.
// Set spark custom feature config.
assert.NoError(t, setSparkConfig(&Config{
Features: []Feature{
{
Expand Down
4 changes: 2 additions & 2 deletions flytepropeller/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func New(ctx context.Context, cfg *config.Config, kubeClientset kubernetes.Inter

// WE are disabling this as the metrics have high cardinality. Metrics seem to be emitted per pod and this has problems
// when we create new pods
// SetSupportedTaskType Client Metrics Provider
// Set Client Metrics Provider
// setClientMetricsProvider(scope.NewSubScope("k8s_client"))

// obtain references to shared index informers for FlyteWorkflow.
Expand Down Expand Up @@ -465,7 +465,7 @@ func New(ctx context.Context, cfg *config.Config, kubeClientset kubernetes.Inter
}

logger.Info(ctx, "Setting up event handlers")
// SetSupportedTaskType up an event handler for when FlyteWorkflow resources change
// Set up an event handler for when FlyteWorkflow resources change
_, err = flyteworkflowInformer.Informer().AddEventHandler(controller.getWorkflowUpdatesHandler())
if err != nil {
return nil, fmt.Errorf("failed to register event handler for FlyteWorkflow resource changes: %w", err)
Expand Down
Loading

0 comments on commit 9710584

Please sign in to comment.