diff --git a/flyteplugins/boilerplate/flyte/docker_build/docker_build.sh b/flyteplugins/boilerplate/flyte/docker_build/docker_build.sh index 817189aee17..a77f8a2d77c 100755 --- a/flyteplugins/boilerplate/flyte/docker_build/docker_build.sh +++ b/flyteplugins/boilerplate/flyte/docker_build/docker_build.sh @@ -43,7 +43,7 @@ fi docker build -t "$IMAGE_TAG_WITH_SHA" --target=${BUILD_PHASE} . echo "${IMAGE_TAG_WITH_SHA} built locally." -# if REGISTRY specified, push the images to the remote registry +# if REGISTRY specified, push the images to the remote registy if [ -n "$REGISTRY" ]; then if [ -n "${DOCKER_REGISTRY_PASSWORD}" ]; then diff --git a/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go b/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go index a78b61162aa..6c3da04107b 100644 --- a/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go +++ b/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go @@ -6,7 +6,8 @@ package tools import ( _ "github.com/EngHabu/mockery/cmd/mockery" _ "github.com/alvaroloes/enumer" - _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" + + _ "github.com/flyteorg/flyte/flytestdlib/cli/pflags" ) diff --git a/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh b/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh index c7e5577ef39..9cd49959f46 100755 --- a/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/flyteplugins/boilerplate/flyte/golang_test_targets/download_tooling.sh @@ -19,6 +19,7 @@ tools=( "github.com/EngHabu/mockery/cmd/mockery" "github.com/flyteorg/flytestdlib/cli/pflags@latest" "github.com/golangci/golangci-lint/cmd/golangci-lint" + "github.com/daixiang0/gci" "github.com/alvaroloes/enumer" "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" ) diff --git a/flyteplugins/boilerplate/flyte/golang_test_targets/go-gen.sh b/flyteplugins/boilerplate/flyte/golang_test_targets/go-gen.sh index 5ac17fa40ae..54bd6af61b1 100755 --- a/flyteplugins/boilerplate/flyte/golang_test_targets/go-gen.sh +++ b/flyteplugins/boilerplate/flyte/golang_test_targets/go-gen.sh @@ -9,7 +9,7 @@ go generate ./... if [ -n "$DELTA_CHECK" ]; then DIRTY=$(git status --porcelain) if [ -n "$DIRTY" ]; then - echo "FAILED: Go code updated without committing generated code." + echo "FAILED: Go code updated without commiting generated code." echo "Ensure make generate has run and all changes are committed." DIFF=$(git diff) echo "diff detected: $DIFF" diff --git a/flyteplugins/boilerplate/flyte/golang_test_targets/goimports b/flyteplugins/boilerplate/flyte/golang_test_targets/goimports index af1829036cf..40f50d106e1 100755 --- a/flyteplugins/boilerplate/flyte/golang_test_targets/goimports +++ b/flyteplugins/boilerplate/flyte/golang_test_targets/goimports @@ -6,3 +6,4 @@ # TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*") +gci write -s standard -s default -s "prefix(github.com/flyteorg)" --custom-order --skip-generated . diff --git a/flyteplugins/go/tasks/aws/client.go b/flyteplugins/go/tasks/aws/client.go index cc0d606c9ad..7d6d47d655d 100644 --- a/flyteplugins/go/tasks/aws/client.go +++ b/flyteplugins/go/tasks/aws/client.go @@ -6,18 +6,16 @@ package aws import ( + "context" "fmt" "os" - - "github.com/flyteorg/flyte/flytestdlib/errors" - - "context" - "sync" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" + + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteplugins/go/tasks/aws/config.go b/flyteplugins/go/tasks/aws/config.go index 9f614bef299..387305ebecb 100644 --- a/flyteplugins/go/tasks/aws/config.go +++ b/flyteplugins/go/tasks/aws/config.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/retry" awsConfig "github.com/aws/aws-sdk-go-v2/config" - "github.com/flyteorg/flyte/flytestdlib/config" pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags Config --default-var defaultConfig diff --git a/flyteplugins/go/tasks/logs/logging_utils.go b/flyteplugins/go/tasks/logs/logging_utils.go index 5fc636e7e09..0ca515d7c87 100644 --- a/flyteplugins/go/tasks/logs/logging_utils.go +++ b/flyteplugins/go/tasks/logs/logging_utils.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + v1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flytestdlib/logger" - v1 "k8s.io/api/core/v1" ) type logPlugin struct { diff --git a/flyteplugins/go/tasks/logs/logging_utils_test.go b/flyteplugins/go/tasks/logs/logging_utils_test.go index 42e6fdd83b3..fbf86b99337 100644 --- a/flyteplugins/go/tasks/logs/logging_utils_test.go +++ b/flyteplugins/go/tasks/logs/logging_utils_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/go-test/deep" - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" + v12 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" ) const podName = "PodName" diff --git a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go index 04ba00528d0..a36edf20ea1 100644 --- a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go +++ b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go @@ -6,9 +6,7 @@ import ( "time" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go index 956e38a9225..c302db8c325 100644 --- a/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast_test.go @@ -4,13 +4,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) var testHandler = failFastHandler{} diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go index 91470f79941..7e309396fc9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client.go @@ -3,11 +3,9 @@ package catalog import ( "context" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) type ResponseStatus uint8 diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go index b1acc2c9534..4b8e2efb37a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/async_client_impl_test.go @@ -5,12 +5,13 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/stretchr/testify/mock" ) var exampleInterface = &core.TypedInterface{ diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/client.go b/flyteplugins/go/tasks/pluginmachinery/catalog/client.go index 4a9b804492d..aedc2795dde 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/client.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/client.go @@ -10,7 +10,6 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go b/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go index 070e023e940..43b6754c025 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/hashing_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" ) func TestHashLiteralMap_LiteralsWithHashSet(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go b/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go index 29ee207487b..a7038b8bf31 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/reader_processor.go @@ -6,14 +6,10 @@ import ( "reflect" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type ReaderWorkItem struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go b/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go index 835e5a4f0de..4d5d84c33c8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go +++ b/flyteplugins/go/tasks/pluginmachinery/catalog/writer_processor.go @@ -6,11 +6,10 @@ import ( "reflect" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type WriterWorkItem struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go index 7dc5ece5df3..8517b9c3853 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go @@ -1,10 +1,11 @@ package core import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) // TaskOverrides interface to expose any overrides that have been set for this task (like resource overrides etc) diff --git a/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go b/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go index 420fc7f60ad..1237220374c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/mocks/fake_k8s_cache.go @@ -6,15 +6,13 @@ import ( "reflect" "sync" - "sigs.k8s.io/controller-runtime/pkg/cache" - - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go b/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go index d2538f4032e..ba6edc4f373 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "gotest.tools/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "gotest.tools/assert" ) func TestLoadPlugin(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go b/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go index bb241596819..9b5dec96de4 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/setup_context.go @@ -1,8 +1,9 @@ package core import ( - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/types" + + "github.com/flyteorg/flyte/flytestdlib/promutils" ) // When a change is observed, the owning entity with id types.NamespacedName can be triggered for re-validation diff --git a/flyteplugins/go/tasks/pluginmachinery/core/template/template.go b/flyteplugins/go/tasks/pluginmachinery/core/template/template.go index 567c8ab68aa..385abf09f4a 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/template/template.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/template/template.go @@ -25,12 +25,13 @@ import ( "regexp" "strings" + "github.com/golang/protobuf/ptypes" + "github.com/pkg/errors" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/golang/protobuf/ptypes" - "github.com/pkg/errors" ) var alphaNumericOnly = regexp.MustCompile("[^a-zA-Z0-9_]+") diff --git a/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go b/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go index a7f6c974773..ba2f5f6ae9d 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/template/template_test.go @@ -7,13 +7,12 @@ import ( "testing" "time" - pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) type dummyInputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go index a58fbfe55c9..4c32d290f89 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/config/config.go @@ -8,12 +8,11 @@ package config import ( "time" - "k8s.io/apimachinery/pkg/api/resource" - - config2 "github.com/flyteorg/flyte/flytestdlib/config" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + config2 "github.com/flyteorg/flyte/flytestdlib/config" ) //go:generate pflags K8sPluginConfig --default-var=defaultK8sConfig diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go index dbba1f3b68a..b2ed99fbdb5 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper.go @@ -3,17 +3,16 @@ package flytek8s import ( "context" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginscore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/apimachinery/pkg/util/validation" ) const resourceGPU = "gpu" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go index d4a04ec1c59..4515d6311cb 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/container_helper_test.go @@ -4,19 +4,18 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/validation" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/util/validation" ) var zeroQuantity = resource.MustParse("0") diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go index bec39010beb..ca6d3be42f5 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go @@ -6,17 +6,17 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go index f41262771f0..09a9fbf52b6 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot_test.go @@ -7,9 +7,6 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - config2 "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" @@ -17,9 +14,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + config2 "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/storage" ) var resourceRequirements = &v1.ResourceRequirements{ diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go index 645e9e2233f..c2d868c0392 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go @@ -5,14 +5,12 @@ import ( "os" "strconv" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + "github.com/flyteorg/flyte/flytestdlib/contextutils" ) func GetContextEnvVars(ownerCtx context.Context) []v1.EnvVar { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go index db2cece6499..5703b88d81e 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go @@ -6,15 +6,14 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" v12 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + "github.com/flyteorg/flyte/flytestdlib/contextutils" ) func TestGetExecutionEnvVars(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go index 6c80fbd09d8..8d33305806d 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go @@ -7,21 +7,18 @@ import ( "strings" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/golang/protobuf/proto" + "github.com/imdario/mergo" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginserrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/golang/protobuf/proto" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/imdario/mergo" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const PodKind = "pod" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go index 5c503239d0f..0c3f8d90f20 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go @@ -9,24 +9,21 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - config1 "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func dummyTaskExecutionMetadata(resources *v1.ResourceRequirements, extendedResources *core.ExtendedResources) pluginsCore.TaskExecutionMetadata { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go index 9c8c1d25af9..64ac86129fb 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store.go @@ -4,10 +4,10 @@ import ( "context" "sync" - "github.com/flyteorg/flyte/flytestdlib/logger" - v1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/cache" + + "github.com/flyteorg/flyte/flytestdlib/logger" ) var DefaultPodTemplateStore PodTemplateStore = NewPodTemplateStore() diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go index 1b1a163b24b..d963c1817a5 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_template_store_test.go @@ -7,7 +7,6 @@ import ( "time" "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go index d8a2a086647..fe626764a25 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils.go @@ -1,11 +1,12 @@ package flytek8s import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginmachinery_core "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginmachinery_core "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar { diff --git a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go index 661d24b14c2..8c75f00a908 100644 --- a/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/flytek8s/utils_test.go @@ -3,12 +3,12 @@ package flytek8s import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func TestToK8sEnvVar(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go b/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go index 0a136edfefa..7e530f42db1 100644 --- a/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go +++ b/flyteplugins/go/tasks/pluginmachinery/google/gke_task_workload_identity_token_source_factory.go @@ -3,7 +3,6 @@ package google import ( "context" - pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/pkg/errors" "golang.org/x/oauth2" "google.golang.org/api/impersonate" @@ -11,6 +10,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + + pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go index d31f5a0955f..a20ef4a1abf 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token.go @@ -6,11 +6,9 @@ import ( "k8s.io/utils/clock" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/logger" ) type tokenAllocator struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go index 18fe498e201..881e7a888d8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/allocation_token_test.go @@ -5,23 +5,18 @@ import ( "testing" "time" + "github.com/go-test/deep" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + testing2 "k8s.io/utils/clock/testing" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" - - "github.com/stretchr/testify/assert" - - testing2 "k8s.io/utils/clock/testing" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go index 128a8126575..a305323dca8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache.go @@ -3,19 +3,15 @@ package webapi import ( "context" - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/client-go/util/workqueue" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/cache" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go index a341b9172f9..53e80cd391b 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/cache_test.go @@ -5,17 +5,16 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/cache" cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func TestNewResourceCache(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go index 91a171bbecc..d5e04f7347f 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go @@ -8,15 +8,12 @@ import ( "k8s.io/utils/clock" - stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrs "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go index d7db79495cb..65d90a6c7e5 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go @@ -5,10 +5,9 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/config" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go index 3ee99b2f4b4..bf6ef791ac5 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher.go @@ -4,11 +4,10 @@ import ( "context" "time" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func launch(ctx context.Context, p webapi.AsyncPlugin, tCtx core.TaskExecutionContext, cache cache.AutoRefresh, diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go index 40f9999ff8c..85ba42d0c60 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/launcher_test.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" ) func Test_launch(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go index b014f8df762..f2fa03104c7 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/metrics.go @@ -3,9 +3,10 @@ package webapi import ( "time" + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/prometheus/client_golang/prometheus" ) type Metrics struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go index 4876ec2724d..c68634d0e04 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor.go @@ -4,10 +4,9 @@ import ( "context" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) func monitor(ctx context.Context, tCtx core.TaskExecutionContext, p Client, cache cache.AutoRefresh, state *State) ( diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go index bb6f0b089c6..c47d77ae769 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/monitor_test.go @@ -6,21 +6,17 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/util/workqueue" - core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/stretchr/testify/assert" - + core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" internalMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) func Test_monitor(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go index ae64646e8aa..c46a75f05f0 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/cached_input_reader.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go index bd0c7b2c247..a9001f20f89 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader.go @@ -4,10 +4,9 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type InMemoryOutputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go index e786365a3bc..ad82fca8a3d 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/in_memory_output_reader_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestInMemoryOutputReader(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go index eb7224800aa..28bacceaed9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths.go @@ -4,7 +4,6 @@ import ( "context" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go index 1b768578d4a..afd884ca024 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/paths_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestConstructCheckpointPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go index 1a4a818bdab..896cd2d6487 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path.go @@ -7,9 +7,8 @@ import ( "strconv" core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type precomputedRawOutputPaths struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go index c7bb704da8d..6071c40d74d 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/raw_output_path_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestNewOutputSandbox(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go index 241f2e553d5..5a6f4dd5229 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader.go @@ -3,12 +3,10 @@ package ioutils import ( "context" - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go index e20e0e18c02..70304597a2b 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_input_reader_test.go @@ -3,8 +3,9 @@ package ioutils import ( "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestSimpleInputFilePath_GetInputPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go index 49b499e114b..152644d8285 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go @@ -7,9 +7,8 @@ import ( "github.com/pkg/errors" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) type RemoteFileOutputReader struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go index 8865e757830..0e7ae179d92 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" storageMocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) type MemoryMetadata struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go index 80cb54ce43e..a1ed90934eb 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go index 0d58a46cc24..1ca51eb1ad7 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_writer_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" ) func TestRemoteFileOutputWriter(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go index a7eb38c8eb9..9854a3156f9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader.go @@ -3,12 +3,12 @@ package ioutils import ( "context" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/pkg/errors" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/atomic" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/pkg/errors" ) var ( diff --git a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go index 3e15231e00c..175060f2ce7 100644 --- a/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/ioutils/task_reader_test.go @@ -5,14 +5,15 @@ import ( "fmt" "testing" + "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/assert" ) const dummyPath = storage.DataReference("test") diff --git a/flyteplugins/go/tasks/pluginmachinery/k8s/client.go b/flyteplugins/go/tasks/pluginmachinery/k8s/client.go index fa6ec67d211..97abfefd8a7 100644 --- a/flyteplugins/go/tasks/pluginmachinery/k8s/client.go +++ b/flyteplugins/go/tasks/pluginmachinery/k8s/client.go @@ -5,14 +5,13 @@ package k8s import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "k8s.io/apimachinery/pkg/api/meta" "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) type kubeClient struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go b/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go index 0bb3774dcd9..8b56f7dd5ec 100644 --- a/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/k8s/plugin.go @@ -5,11 +5,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/storage" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/registry.go b/flyteplugins/go/tasks/pluginmachinery/registry.go index b792ce80cea..39a241a50ef 100644 --- a/flyteplugins/go/tasks/pluginmachinery/registry.go +++ b/flyteplugins/go/tasks/pluginmachinery/registry.go @@ -4,13 +4,11 @@ import ( "context" "sync" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" internalRemote "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/internal/webapi" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) type taskPluginRegistry struct { diff --git a/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go b/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go index 50c9213afb2..e3f03047aa0 100644 --- a/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go @@ -3,12 +3,12 @@ package tasklog import ( "reflect" "regexp" - "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/go-test/deep" "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestTemplateLog(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/dns.go b/flyteplugins/go/tasks/pluginmachinery/utils/dns.go index 5f5a911ccf5..e9a4317e17c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/dns.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/dns.go @@ -4,8 +4,9 @@ import ( "regexp" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" "k8s.io/apimachinery/pkg/util/validation" + + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) var dns1123InvalidRegex = regexp.MustCompile("[^-.a-z0-9]") diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go index 9b51db0b821..b6ea59020b9 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler.go @@ -5,11 +5,10 @@ import ( "strconv" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" - "github.com/golang/protobuf/proto" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go index c2a3f17e800..de5265fda64 100644 --- a/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/utils/secrets/marshaler_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestEncodeSecretGroup(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go b/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go index ffd462d76c7..95b5c7881f8 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/example/config_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - "github.com/stretchr/testify/assert" ) func TestGetConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go index bcb34eace76..0ec6c2066e4 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/example/plugin.go @@ -5,13 +5,11 @@ import ( "time" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go b/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go index f6d99065944..37be2c1e400 100644 --- a/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go +++ b/flyteplugins/go/tasks/pluginmachinery/webapi/plugin.go @@ -10,12 +10,10 @@ package webapi import ( "context" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go index 09d75bc493d..fce1acde899 100644 --- a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go +++ b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue.go @@ -5,18 +5,14 @@ import ( "fmt" "sync" - "github.com/flyteorg/flyte/flytestdlib/errors" - + lru "github.com/hashicorp/golang-lru" "github.com/prometheus/client_golang/prometheus" + "k8s.io/client-go/util/workqueue" "github.com/flyteorg/flyte/flytestdlib/contextutils" - + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - lru "github.com/hashicorp/golang-lru" - - "k8s.io/client-go/util/workqueue" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go index 76fd52f7752..d2ded7d8e82 100644 --- a/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/workqueue/queue_test.go @@ -7,13 +7,11 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/go-test/deep" - lru "github.com/hashicorp/golang-lru" "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/array/array_tests_base.go b/flyteplugins/go/tasks/plugins/array/array_tests_base.go index 6d6bd897d02..701b4780aad 100644 --- a/flyteplugins/go/tasks/plugins/array/array_tests_base.go +++ b/flyteplugins/go/tasks/plugins/array/array_tests_base.go @@ -1,22 +1,17 @@ package array import ( + "context" "testing" - "github.com/flyteorg/flyte/flyteplugins/tests" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "context" - - "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/flyteorg/flyte/flyteplugins/tests" + "github.com/flyteorg/flyte/flytestdlib/utils" ) type AdvanceIteration func(ctx context.Context, tCtx core.TaskExecutionContext) error diff --git a/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go b/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go index 6b17f2c81ce..96aabcfcc64 100644 --- a/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go +++ b/flyteplugins/go/tasks/plugins/array/arraystatus/status_test.go @@ -7,11 +7,10 @@ package arraystatus import ( "testing" - types "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/stretchr/testify/assert" + types "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/stretchr/testify/assert" ) func TestArrayStatus_HashCode(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/client.go b/flyteplugins/go/tasks/plugins/array/awsbatch/client.go index 74ad8617c4f..1ff3a44affd 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/client.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/client.go @@ -12,6 +12,7 @@ import ( a "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/batch" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" definition2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" "github.com/flyteorg/flyte/flytestdlib/logger" diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go index efef99643c6..fe35f74e2a6 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/client_test.go @@ -6,20 +6,16 @@ package awsbatch import ( "context" + "testing" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "testing" - - "github.com/aws/aws-sdk-go/service/batch" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func newClientWithMockBatch() *client { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go b/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go index 5187ed70868..99688fe36db 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/executor.go @@ -3,25 +3,18 @@ package awsbatch import ( "context" - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" batchConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go index 120fe40d2d0..28d1eb84830 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/executor_test.go @@ -5,33 +5,25 @@ import ( "reflect" "testing" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/storage" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" v1 "k8s.io/api/core/v1" - - "github.com/flyteorg/flyte/flytestdlib/promutils" "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" queueMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" batchConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/flyteorg/flyte/flytestdlib/utils" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go index 9629b3d7716..1ca10cb39db 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_config.go @@ -5,8 +5,9 @@ package awsbatch import ( - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" v1 "k8s.io/api/core/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go index 22f39c200d5..1ef9e4ec5ba 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition.go @@ -6,14 +6,13 @@ import ( "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" ) const defaultComputeEngine = "EC2" diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go index 6568fecee39..61f9b137e7b 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/job_definition_test.go @@ -3,20 +3,18 @@ package awsbatch import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" v1 "k8s.io/api/core/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/stretchr/testify/mock" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/definition" batchMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/utils" - "golang.org/x/net/context" - - "github.com/stretchr/testify/assert" ) func TestContainerImageRepository(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go index ad51d2e7891..cd3bca93c4a 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store.go @@ -10,20 +10,15 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/service/batch" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "k8s.io/client-go/util/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "k8s.io/apimachinery/pkg/types" - - "github.com/aws/aws-sdk-go/service/batch" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" "github.com/flyteorg/flyte/flytestdlib/cache" - + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go index cc3c258e383..8196925e158 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/jobs_store_test.go @@ -11,20 +11,15 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + "github.com/flyteorg/flyte/flytestdlib/cache" mocks3 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - config2 "github.com/flyteorg/flyte/flytestdlib/config" - - "github.com/flyteorg/flyte/flytestdlib/cache" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func createJobWithID(id JobID) *Job { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go index 10752d6f3c6..609bab6cf79 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher.go @@ -5,15 +5,12 @@ import ( "fmt" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func LaunchSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, batchClient Client, pluginConfig *config.Config, diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go index 4b23c6dabb9..449280bdcfe 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/launcher_test.go @@ -3,34 +3,25 @@ package awsbatch import ( "testing" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/stretchr/testify/mock" - - "k8s.io/apimachinery/pkg/api/resource" - - core3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/go-test/deep" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" v1 "k8s.io/api/core/v1" - - core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "k8s.io/apimachinery/pkg/api/resource" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/stretchr/testify/assert" - + core3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/utils" - "golang.org/x/net/context" ) func TestLaunchSubTasks(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go b/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go index cf60cbc4911..592d602ff4b 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/mocks/batch.go @@ -11,7 +11,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/batch" ) diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go index 967639e6ed3..666b1e741af 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor.go @@ -4,23 +4,17 @@ import ( "context" core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func createSubJobList(count int) []*Job { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go index 9188ce02375..d40edd41dea 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/monitor_test.go @@ -3,34 +3,27 @@ package awsbatch import ( "testing" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/batch" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + "golang.org/x/net/context" + "k8s.io/apimachinery/pkg/types" flyteIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/batch" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" batchMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/stretchr/testify/assert" - "golang.org/x/net/context" - "k8s.io/apimachinery/pkg/types" - + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go b/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go index c3a05b0fcc2..caf2e51a38f 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/task_links.go @@ -3,16 +3,14 @@ package awsbatch import ( "fmt" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "golang.org/x/net/context" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "golang.org/x/net/context" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go index 521189cb673..8c252a7c061 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer.go @@ -5,21 +5,20 @@ import ( "sort" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - "github.com/aws/aws-sdk-go/service/batch" + "github.com/golang/protobuf/ptypes/duration" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" config2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - "github.com/golang/protobuf/ptypes/duration" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go index 27beea588e3..bbe8c88995e 100644 --- a/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go +++ b/flyteplugins/go/tasks/plugins/array/awsbatch/transformer_test.go @@ -10,28 +10,22 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/service/batch" "github.com/golang/protobuf/ptypes/duration" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v12 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" flyteK8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/awsbatch/config" - - v12 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/aws/aws-sdk-go/service/batch" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/stretchr/testify/assert" ) func createSampleContainerTask() *core.Container { diff --git a/flyteplugins/go/tasks/plugins/array/catalog.go b/flyteplugins/go/tasks/plugins/array/catalog.go index 0efbdc40883..8544555609d 100644 --- a/flyteplugins/go/tasks/plugins/array/catalog.go +++ b/flyteplugins/go/tasks/plugins/array/catalog.go @@ -8,18 +8,15 @@ import ( idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlPlugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/storage" ) const AwsBatchTaskType = "aws-batch" diff --git a/flyteplugins/go/tasks/plugins/array/catalog_test.go b/flyteplugins/go/tasks/plugins/array/catalog_test.go index fe52dc2ff6f..15a36a4dcf3 100644 --- a/flyteplugins/go/tasks/plugins/array/catalog_test.go +++ b/flyteplugins/go/tasks/plugins/array/catalog_test.go @@ -5,9 +5,13 @@ import ( "errors" "testing" + "github.com/go-test/deep" + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" @@ -17,18 +21,10 @@ import ( ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/bitarray" stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/go-test/deep" - - structpb "github.com/golang/protobuf/ptypes/struct" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) var ( diff --git a/flyteplugins/go/tasks/plugins/array/core/metadata.go b/flyteplugins/go/tasks/plugins/array/core/metadata.go index f7330d3b6f4..4ac7c71b4c5 100644 --- a/flyteplugins/go/tasks/plugins/array/core/metadata.go +++ b/flyteplugins/go/tasks/plugins/array/core/metadata.go @@ -4,7 +4,6 @@ import ( "context" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) diff --git a/flyteplugins/go/tasks/plugins/array/core/metadata_test.go b/flyteplugins/go/tasks/plugins/array/core/metadata_test.go index 90275fb844f..262bd3b822f 100644 --- a/flyteplugins/go/tasks/plugins/array/core/metadata_test.go +++ b/flyteplugins/go/tasks/plugins/array/core/metadata_test.go @@ -4,14 +4,12 @@ import ( "context" "testing" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/stretchr/testify/assert" ) func TestInitializeExternalResources(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/core/state.go b/flyteplugins/go/tasks/plugins/array/core/state.go index 80cfb1f7425..665eec309f5 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state.go +++ b/flyteplugins/go/tasks/plugins/array/core/state.go @@ -5,17 +5,16 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flytestdlib/errors" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - "github.com/flyteorg/flyte/flytestdlib/bitarray" + structpb "github.com/golang/protobuf/ptypes/struct" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" idlPlugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - structpb "github.com/golang/protobuf/ptypes/struct" ) //go:generate mockery -all -case=underscore diff --git a/flyteplugins/go/tasks/plugins/array/core/state_test.go b/flyteplugins/go/tasks/plugins/array/core/state_test.go index 51fe731de05..26a80531b5f 100644 --- a/flyteplugins/go/tasks/plugins/array/core/state_test.go +++ b/flyteplugins/go/tasks/plugins/array/core/state_test.go @@ -4,14 +4,13 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/golang/protobuf/proto" + "github.com/stretchr/testify/assert" - "github.com/flyteorg/flyte/flytestdlib/bitarray" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flytestdlib/bitarray" ) func TestInvertBitSet(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/inputs_test.go b/flyteplugins/go/tasks/plugins/array/inputs_test.go index 14247318485..8f9c670c571 100644 --- a/flyteplugins/go/tasks/plugins/array/inputs_test.go +++ b/flyteplugins/go/tasks/plugins/array/inputs_test.go @@ -3,12 +3,12 @@ package array import ( "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/config.go b/flyteplugins/go/tasks/plugins/array/k8s/config.go index c19cbb72a8a..d92eeb8c62b 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/config.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/config.go @@ -8,14 +8,13 @@ import ( "fmt" "io/ioutil" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/pkg/errors" v1 "k8s.io/api/core/v1" restclient "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/executor.go b/flyteplugins/go/tasks/plugins/array/k8s/executor.go index 172d0b65fda..3e324391b85 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/executor.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/executor.go @@ -3,17 +3,16 @@ package k8s import ( "context" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" ) const executorName = "k8s-array" diff --git a/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go b/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go index 1b8a8224a2f..04623c2b47e 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/integration_test.go @@ -5,25 +5,21 @@ import ( "strconv" "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/stretchr/testify/assert" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" - "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "sigs.k8s.io/controller-runtime/pkg/client" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/array/k8s/management.go b/flyteplugins/go/tasks/plugins/array/k8s/management.go index 89996226e6b..fdf9d4a182b 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/management.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/management.go @@ -6,7 +6,6 @@ import ( "time" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,7 +15,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/storage" diff --git a/flyteplugins/go/tasks/plugins/array/k8s/management_test.go b/flyteplugins/go/tasks/plugins/array/k8s/management_test.go index 5e1d37e0666..5bead4954d7 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/management_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/management_test.go @@ -4,8 +4,15 @@ import ( "fmt" "testing" - core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "golang.org/x/net/context" + structpb "google.golang.org/protobuf/types/known/structpb" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + core2 "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -14,21 +21,9 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - "github.com/flyteorg/flyte/flytestdlib/bitarray" "github.com/flyteorg/flyte/flytestdlib/storage" stdmocks "github.com/flyteorg/flyte/flytestdlib/storage/mocks" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "golang.org/x/net/context" - - structpb "google.golang.org/protobuf/types/known/structpb" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type metadata struct { diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask.go index a62c275f0c7..cb1a2c0b5f9 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask.go @@ -8,6 +8,12 @@ import ( "strings" "time" + v1 "k8s.io/api/core/v1" + k8serrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + k8stypes "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" @@ -16,16 +22,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8stypes "k8s.io/apimachinery/pkg/types" - - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go index beeb1a77878..8ac4d6edc09 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go @@ -7,7 +7,6 @@ import ( "strconv" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" @@ -16,7 +15,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils/secrets" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - "github.com/flyteorg/flyte/flytestdlib/storage" ) diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go index ea0078db207..c3e213e403f 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context_test.go @@ -5,12 +5,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" podPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/pod" - "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/stretchr/testify/assert" ) func TestSubTaskExecutionContext(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/array/outputs.go b/flyteplugins/go/tasks/plugins/array/outputs.go index 1f59f2a7e3b..d31988425f8 100644 --- a/flyteplugins/go/tasks/plugins/array/outputs.go +++ b/flyteplugins/go/tasks/plugins/array/outputs.go @@ -4,22 +4,17 @@ import ( "context" "fmt" - "github.com/flyteorg/flyte/flytestdlib/logger" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/errorcollector" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" ) var ( diff --git a/flyteplugins/go/tasks/plugins/array/outputs_test.go b/flyteplugins/go/tasks/plugins/array/outputs_test.go index 7ddf06a1dc5..f218e9540f7 100644 --- a/flyteplugins/go/tasks/plugins/array/outputs_test.go +++ b/flyteplugins/go/tasks/plugins/array/outputs_test.go @@ -7,33 +7,24 @@ import ( "testing" "github.com/go-test/deep" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" - - arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - - "github.com/flyteorg/flyte/flytestdlib/bitarray" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/stretchr/testify/assert" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/arraystatus" + arrayCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/array/core" + "github.com/flyteorg/flyte/flytestdlib/bitarray" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" + "github.com/flyteorg/flyte/flytestdlib/storage" ) func TestOutputAssembler_Queue(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go b/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go index e5d4664cfe6..9d4ad8b822e 100644 --- a/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go +++ b/flyteplugins/go/tasks/plugins/hive/client/qubole_client.go @@ -12,11 +12,9 @@ import ( "strconv" "time" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" errors2 "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" ) const ( diff --git a/flyteplugins/go/tasks/plugins/hive/config/config.go b/flyteplugins/go/tasks/plugins/hive/config/config.go index d098b627b1f..027e5df801b 100644 --- a/flyteplugins/go/tasks/plugins/hive/config/config.go +++ b/flyteplugins/go/tasks/plugins/hive/config/config.go @@ -6,10 +6,9 @@ import ( "context" "net/url" + pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" ) const quboleConfigSectionKey = "qubole" diff --git a/flyteplugins/go/tasks/plugins/hive/execution_state.go b/flyteplugins/go/tasks/plugins/hive/execution_state.go index f245279df4e..16ac3835bdc 100644 --- a/flyteplugins/go/tasks/plugins/hive/execution_state.go +++ b/flyteplugins/go/tasks/plugins/hive/execution_state.go @@ -6,22 +6,17 @@ import ( "strconv" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flytestdlib/contextutils" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + "github.com/flyteorg/flyte/flytestdlib/cache" + "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/logger" ) diff --git a/flyteplugins/go/tasks/plugins/hive/execution_state_test.go b/flyteplugins/go/tasks/plugins/hive/execution_state_test.go index b265c31bfb5..4e34a04593b 100644 --- a/flyteplugins/go/tasks/plugins/hive/execution_state_test.go +++ b/flyteplugins/go/tasks/plugins/hive/execution_state_test.go @@ -7,28 +7,23 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" + ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" quboleMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + mocks2 "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/hive/executions_cache.go b/flyteplugins/go/tasks/plugins/hive/executions_cache.go index b077da986ae..40885ab093c 100644 --- a/flyteplugins/go/tasks/plugins/hive/executions_cache.go +++ b/flyteplugins/go/tasks/plugins/hive/executions_cache.go @@ -6,15 +6,12 @@ import ( "k8s.io/client-go/util/workqueue" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go b/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go index 3dfcf62385b..82ef507cef0 100644 --- a/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go +++ b/flyteplugins/go/tasks/plugins/hive/executions_cache_test.go @@ -4,17 +4,16 @@ import ( "context" "testing" - "github.com/flyteorg/flyte/flytestdlib/cache" - cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" quboleMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestQuboleHiveExecutionsCache_SyncQuboleQuery(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/hive/executor.go b/flyteplugins/go/tasks/plugins/hive/executor.go index 7be422281f4..5e64c6ef93e 100644 --- a/flyteplugins/go/tasks/plugins/hive/executor.go +++ b/flyteplugins/go/tasks/plugins/hive/executor.go @@ -3,13 +3,12 @@ package hive import ( "context" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/hive/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/hive/executor_metrics.go b/flyteplugins/go/tasks/plugins/hive/executor_metrics.go index 7a0dbe9ed9b..815e51135aa 100644 --- a/flyteplugins/go/tasks/plugins/hive/executor_metrics.go +++ b/flyteplugins/go/tasks/plugins/hive/executor_metrics.go @@ -1,9 +1,10 @@ package hive import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/prometheus/client_golang/prometheus" ) type QuboleHiveExecutorMetrics struct { diff --git a/flyteplugins/go/tasks/plugins/hive/test_helpers.go b/flyteplugins/go/tasks/plugins/hive/test_helpers.go index 9635526aaf3..f8fe8d41487 100644 --- a/flyteplugins/go/tasks/plugins/hive/test_helpers.go +++ b/flyteplugins/go/tasks/plugins/hive/test_helpers.go @@ -1,6 +1,13 @@ package hive import ( + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -8,12 +15,6 @@ import ( ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytestdlib/storage" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) func GetSingleHiveQueryTaskTemplate() idlCore.TaskTemplate { diff --git a/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go b/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go index cfec0d3af45..576740af93e 100644 --- a/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/dask/dask_test.go @@ -6,24 +6,24 @@ import ( "time" daskAPI "github.com/dask/dask-kubernetes/v2023/dask_kubernetes/operator/go_client/pkg/apis/kubernetes.dask.org/v1" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/golang/protobuf/jsonpb" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/types/known/structpb" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/golang/protobuf/jsonpb" - "google.golang.org/protobuf/types/known/structpb" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go index f6a9787dbbf..e0903d02a3c 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator.go @@ -5,18 +5,18 @@ import ( "sort" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + v1 "k8s.io/api/core/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go index 6c083b68988..ae77d8c94d2 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func TestExtractCurrentCondition(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go index 25e45ad7274..1358422ec73 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go @@ -6,9 +6,15 @@ import ( "strings" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -17,12 +23,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" ) const workerSpecCommandKey = "worker_spec_command" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go index bda0faff75e..7b6e1f56118 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi_test.go @@ -6,10 +6,19 @@ import ( "testing" "time" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" + mpiOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -19,19 +28,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - mpiOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go index 2461c7bc187..e844c05d0ff 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go @@ -5,9 +5,15 @@ import ( "fmt" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - "sigs.k8s.io/controller-runtime/pkg/client" ) type pytorchOperatorResourceHandler struct { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go index f980c897417..9d95ecc61b6 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch/pytorch_test.go @@ -6,34 +6,28 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/stretchr/testify/mock" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/assert" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go index 1c4c9658198..8db340d37ec 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow.go @@ -5,9 +5,15 @@ import ( "fmt" "time" + commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -16,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - commonOp "github.com/kubeflow/common/pkg/apis/common/v1" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - "sigs.k8s.io/controller-runtime/pkg/client" ) type tensorflowOperatorResourceHandler struct { diff --git a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go index ee5e97db16a..bcabdaa87fd 100644 --- a/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow/tensorflow_test.go @@ -6,33 +6,28 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/golang/protobuf/jsonpb" + structpb "github.com/golang/protobuf/ptypes/struct" commonOp "github.com/kubeflow/common/pkg/apis/common/v1" + kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - - "github.com/stretchr/testify/mock" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - - pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" kfplugins "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/kubeflow" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - kubeflowv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "github.com/stretchr/testify/assert" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/kfoperators/common" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go b/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go index 286c2673d71..19000e0c725 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/container_test.go @@ -5,23 +5,20 @@ import ( "fmt" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" flytek8sConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - v1 "k8s.io/api/core/v1" - - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) var containerResourceRequirements = &v1.ResourceRequirements{ diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go b/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go index aacfea74250..d21eefb8b9b 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/plugin.go @@ -3,6 +3,10 @@ package pod import ( "context" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + pluginserrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" @@ -11,13 +15,7 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go b/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go index bbc797065ce..48a000de177 100644 --- a/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/pod/sidecar_test.go @@ -9,27 +9,23 @@ import ( "path" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCoreMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" + pluginsIOMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) const ResourceNvidiaGPU = "nvidia.com/gpu" diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go index 18499069dd9..08c44ce9e15 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/config_test.go @@ -3,8 +3,9 @@ package ray import ( "testing" - pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "gotest.tools/assert" + + pluginmachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) func TestLoadConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go index 9b205beee6f..fc39a04bf3d 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray.go @@ -6,24 +6,22 @@ import ( "strconv" "strings" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" + rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes/scheme" - - v1 "k8s.io/api/core/v1" - - flyteerr "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go index 40513e0ffaf..9d7abe45a7e 100644 --- a/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go @@ -5,30 +5,27 @@ import ( "testing" "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" - mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/golang/protobuf/jsonpb" structpb "github.com/golang/protobuf/ptypes/struct" + rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/logs" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config" pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" - rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go index 326eadfb8c7..4b6bcc23600 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training.go @@ -5,31 +5,22 @@ import ( "strings" "time" - "sigs.k8s.io/controller-runtime/pkg/client" - + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - - awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/aws/aws-sdk-go/service/sagemaker" + "sigs.k8s.io/controller-runtime/pkg/client" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/aws/aws-sdk-go/service/sagemaker" - - taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - + awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ReconcilingTrainingJobStatus = "ReconcilingTrainingJob" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go index 26b0efddad0..cf412edd0c3 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/builtin_training_test.go @@ -5,24 +5,20 @@ import ( "fmt" "testing" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - "github.com/aws/aws-sdk-go/service/sagemaker" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" ) func Test_awsSagemakerPlugin_BuildResourceForTrainingJob(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go index a7364c96ca1..fa80bbadf53 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training.go @@ -7,25 +7,21 @@ import ( "strings" "time" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/service/sagemaker" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func (m awsSagemakerPlugin) buildResourceForCustomTrainingJob( diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go index eac4d696ecd..094a9e5b011 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/custom_training_test.go @@ -6,20 +6,17 @@ import ( "strconv" "testing" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" - - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" - "github.com/aws/aws-sdk-go/service/sagemaker" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" stdConfig "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/config/viper" ) diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go index c4fb453acb4..b233af182c6 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning.go @@ -5,30 +5,22 @@ import ( "strings" "time" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" + "github.com/aws/aws-sdk-go/service/sagemaker" "sigs.k8s.io/controller-runtime/pkg/client" - awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - + flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - "github.com/aws/aws-sdk-go/service/sagemaker" - - taskError "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - flyteSageMakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - + awsUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/awsutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ReconcilingTuningJobStatus = "ReconcilingTuningJob" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go index 4f3caef8d7c..ee3452f6b66 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/hyperparameter_tuning_test.go @@ -5,18 +5,16 @@ import ( "fmt" "testing" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" "github.com/go-test/deep" + "github.com/stretchr/testify/assert" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/flyteorg/flyte/flytestdlib/config/viper" - + sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" - - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/stretchr/testify/assert" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" ) func Test_awsSagemakerPlugin_BuildResourceForHyperparameterTuningJob(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go index 062fbda4496..b26255d78d8 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs.go @@ -4,15 +4,14 @@ import ( "context" "fmt" - "sigs.k8s.io/controller-runtime/pkg/client" - - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flytestdlib/logger" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flytestdlib/logger" ) func createOutputLiteralMap(tk *core.TaskTemplate, outputPath string) *core.LiteralMap { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go index 6e99ca0ae42..665a31caac2 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/outputs_test.go @@ -3,10 +3,9 @@ package sagemaker import ( "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_createModelOutputPath(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go index 623d55f6745..328efc2e5c5 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin.go @@ -3,17 +3,14 @@ package sagemaker import ( "context" + commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" + hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" + trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - "k8s.io/client-go/kubernetes/scheme" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" - trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" ) diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go index 44150e547fc..38cc76bbab8 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test.go @@ -5,16 +5,15 @@ import ( "reflect" "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/flyteorg/flyte/flytestdlib/contextutils" - "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - hpojobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/hyperparametertuningjob" trainingjobv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/trainingjob" + "github.com/stretchr/testify/assert" + "sigs.k8s.io/controller-runtime/pkg/client" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/k8s" + "github.com/flyteorg/flyte/flytestdlib/contextutils" + "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" ) func Test_awsSagemakerPlugin_BuildIdentityResource(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go index 437945fe1e7..3733f74725f 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/plugin_test_utils.go @@ -1,12 +1,16 @@ package sagemaker import ( - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/pkg/errors" - + "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/pkg/errors" + "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" sagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -14,13 +18,8 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" pluginIOMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/golang/protobuf/jsonpb" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const testImage = "image://" diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go index 95616c249b8..047d2ae23c4 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils.go @@ -6,24 +6,21 @@ import ( "sort" "strings" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - - "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/Masterminds/semver" commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" awsSdk "github.com/aws/aws-sdk-go-v2/aws" + "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteSagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/golang/protobuf/proto" + "github.com/flyteorg/flyte/flytestdlib/logger" ) const ( diff --git a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go index e4266e1fd0b..8c5093ddac9 100644 --- a/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/sagemaker/utils_test.go @@ -7,21 +7,18 @@ import ( "strconv" "testing" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - structpb "github.com/golang/protobuf/ptypes/struct" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - commonv1 "github.com/aws/amazon-sagemaker-operator-for-k8s/api/v1/common" - sagemakerSpec "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" - "github.com/flyteorg/flyte/flytestdlib/config/viper" + structpb "github.com/golang/protobuf/ptypes/struct" "github.com/stretchr/testify/assert" - stdConfig "github.com/flyteorg/flyte/flytestdlib/config" - + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteSagemakerIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + sagemakerSpec "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins/sagemaker" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" sagemakerConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/k8s/sagemaker/config" + stdConfig "github.com/flyteorg/flyte/flytestdlib/config" + "github.com/flyteorg/flyte/flytestdlib/config/viper" ) func makeGenericLiteral(st *structpb.Struct) *core.Literal { diff --git a/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go b/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go index 695b780b069..e23a6ae912f 100644 --- a/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go +++ b/flyteplugins/go/tasks/plugins/presto/client/noop_presto_client.go @@ -4,7 +4,6 @@ import ( "context" "net/http" "net/url" - "time" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" diff --git a/flyteplugins/go/tasks/plugins/presto/config/config.go b/flyteplugins/go/tasks/plugins/presto/config/config.go index 6f8de3c5ffb..559d6a1af31 100644 --- a/flyteplugins/go/tasks/plugins/presto/config/config.go +++ b/flyteplugins/go/tasks/plugins/presto/config/config.go @@ -7,10 +7,9 @@ import ( "net/url" "time" + pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" - - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" ) const prestoConfigSectionKey = "presto" diff --git a/flyteplugins/go/tasks/plugins/presto/execution_state.go b/flyteplugins/go/tasks/plugins/presto/execution_state.go index 6b8b735548c..3399c013ae3 100644 --- a/flyteplugins/go/tasks/plugins/presto/execution_state.go +++ b/flyteplugins/go/tasks/plugins/presto/execution_state.go @@ -2,32 +2,23 @@ package presto import ( "context" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "k8s.io/apimachinery/pkg/util/rand" - "fmt" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" - "time" - "github.com/flyteorg/flyte/flytestdlib/cache" + "k8s.io/apimachinery/pkg/util/rand" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" - - pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) type ExecutionPhase int diff --git a/flyteplugins/go/tasks/plugins/presto/execution_state_test.go b/flyteplugins/go/tasks/plugins/presto/execution_state_test.go index ae0741a9147..4d20d64ee60 100644 --- a/flyteplugins/go/tasks/plugins/presto/execution_state_test.go +++ b/flyteplugins/go/tasks/plugins/presto/execution_state_test.go @@ -6,7 +6,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" @@ -15,13 +20,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/presto/executions_cache.go b/flyteplugins/go/tasks/plugins/presto/executions_cache.go index 40b81eb7055..cc5248c0f26 100644 --- a/flyteplugins/go/tasks/plugins/presto/executions_cache.go +++ b/flyteplugins/go/tasks/plugins/presto/executions_cache.go @@ -5,14 +5,11 @@ import ( "k8s.io/client-go/util/workqueue" - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + stdErrors "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go b/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go index e014d64b666..111f0ad80b8 100644 --- a/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go +++ b/flyteplugins/go/tasks/plugins/presto/executions_cache_test.go @@ -4,18 +4,16 @@ import ( "context" "testing" - prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" - - "github.com/flyteorg/flyte/flytestdlib/cache" - cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" + prestoMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" - + "github.com/flyteorg/flyte/flytestdlib/cache" + cacheMocks "github.com/flyteorg/flyte/flytestdlib/cache/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestPrestoExecutionsCache_SyncQuboleQuery(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/presto/executor.go b/flyteplugins/go/tasks/plugins/presto/executor.go index 7b452b0c681..306dfda4c7a 100644 --- a/flyteplugins/go/tasks/plugins/presto/executor.go +++ b/flyteplugins/go/tasks/plugins/presto/executor.go @@ -3,14 +3,12 @@ package presto import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" - - "github.com/flyteorg/flyte/flytestdlib/cache" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/client" "github.com/flyteorg/flyte/flyteplugins/go/tasks/plugins/presto/config" + "github.com/flyteorg/flyte/flytestdlib/cache" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" ) diff --git a/flyteplugins/go/tasks/plugins/presto/helpers_test.go b/flyteplugins/go/tasks/plugins/presto/helpers_test.go index 69cc3d4d381..60fc1cc050b 100644 --- a/flyteplugins/go/tasks/plugins/presto/helpers_test.go +++ b/flyteplugins/go/tasks/plugins/presto/helpers_test.go @@ -1,6 +1,13 @@ package presto import ( + structpb "github.com/golang/protobuf/ptypes/struct" + "github.com/stretchr/testify/mock" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -8,12 +15,6 @@ import ( ioMock "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" "github.com/flyteorg/flyte/flytestdlib/storage" - structpb "github.com/golang/protobuf/ptypes/struct" - "github.com/stretchr/testify/mock" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" ) func GetPrestoQueryTaskTemplate() idlCore.TaskTemplate { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go index b110897a47e..a3e6d69d669 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/config_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flytestdlib/config" - "github.com/stretchr/testify/assert" + + "github.com/flyteorg/flyte/flytestdlib/config" ) func TestGetAndSetConfig(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go index 1cd92caf9d5..0aecffdfc74 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/integration_test.go @@ -8,17 +8,22 @@ import ( "testing" "time" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/grpc" + "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/utils/strings/slices" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flyteplugins/tests" "github.com/flyteorg/flyte/flytestdlib/contextutils" @@ -26,11 +31,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" "github.com/flyteorg/flyte/flytestdlib/utils" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/grpc" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/utils/strings/slices" ) type MockPlugin struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go index c50d3617268..d115bad8965 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go @@ -7,13 +7,12 @@ import ( "fmt" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/config" + "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/grpclog" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" flyteIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" @@ -23,9 +22,9 @@ import ( "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/logger" "github.com/flyteorg/flyte/flytestdlib/promutils" - "google.golang.org/grpc" ) type GetClientFunc func(ctx context.Context, agent *Agent, connectionCache map[*Agent]*grpc.ClientConn) (service.AsyncAgentServiceClient, error) diff --git a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go index 3a8e759908b..ee3b699e9da 100644 --- a/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go @@ -5,16 +5,15 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" - "github.com/flyteorg/flyte/flytestdlib/config" - + "github.com/stretchr/testify/assert" "google.golang.org/grpc" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" webapiPlugin "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/config" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) func TestPlugin(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go b/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go index ec1c641c0e2..a1f16163fea 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/plugin.go @@ -5,23 +5,19 @@ import ( "fmt" "time" - errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - awsSdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/athena" athenaTypes "github.com/aws/aws-sdk-go-v2/service/athena/types" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - - "github.com/flyteorg/flyte/flytestdlib/errors" - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - + "github.com/flyteorg/flyte/flyteplugins/go/tasks/aws" + errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/errors" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go index 0ef2ddf3c7c..6e3238d8135 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/plugin_test.go @@ -4,8 +4,9 @@ import ( "testing" awsSdk "github.com/aws/aws-sdk-go-v2/aws" - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/stretchr/testify/assert" + + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func TestCreateTaskInfo(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/utils.go b/flyteplugins/go/tasks/plugins/webapi/athena/utils.go index bdee75c2827..761e81842af 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/utils.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/utils.go @@ -3,17 +3,14 @@ package athena import ( "context" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - - pluginsIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" - pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + pluginsIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func writeOutput(ctx context.Context, tCtx webapi.StatusContext, externalLocation string) error { diff --git a/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go b/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go index 40106c6b932..da490838fe4 100644 --- a/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/athena/utils_test.go @@ -6,21 +6,17 @@ import ( "testing" "github.com/golang/protobuf/proto" - - "github.com/flyteorg/flyte/flytestdlib/storage" - - mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" + "github.com/stretchr/testify/assert" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pb "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" - "github.com/flyteorg/flyte/flytestdlib/utils" - - "github.com/stretchr/testify/assert" - + mocks3 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi/mocks" + "github.com/flyteorg/flyte/flytestdlib/storage" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func Test_writeOutput(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go index c8c8ff1614e..eb118e3211b 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/config.go @@ -4,10 +4,9 @@ package bigquery import ( "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" - pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/config" ) diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go index 8db32ad6fa2..5509c216f79 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/integration_test.go @@ -9,8 +9,11 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/api/bigquery/v2" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" @@ -20,9 +23,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "google.golang.org/api/bigquery/v2" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go index 698eeeb5dc7..f08d1d15eae 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin.go @@ -7,29 +7,23 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - - "golang.org/x/oauth2" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" structpb "github.com/golang/protobuf/ptypes/struct" + "golang.org/x/oauth2" "google.golang.org/api/bigquery/v2" "google.golang.org/api/googleapi" + "google.golang.org/api/option" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "google.golang.org/api/option" - - "github.com/flyteorg/flyte/flytestdlib/logger" - - "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/google" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" + "github.com/flyteorg/flyte/flytestdlib/logger" + "github.com/flyteorg/flyte/flytestdlib/promutils" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go index 499e6c57925..939fe0577a0 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/plugin_test.go @@ -5,6 +5,15 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "google.golang.org/api/bigquery/v2" + "google.golang.org/api/googleapi" + "k8s.io/apimachinery/pkg/util/rand" + + flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" coreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" @@ -13,15 +22,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/mock" - "k8s.io/apimachinery/pkg/util/rand" - - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/stretchr/testify/assert" - "google.golang.org/api/bigquery/v2" - "google.golang.org/api/googleapi" ) func init() { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go index 8a9190d8e51..7ce788e0fe4 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job.go @@ -3,13 +3,13 @@ package bigquery import ( "strconv" + structpb "github.com/golang/protobuf/ptypes/struct" "github.com/pkg/errors" + "google.golang.org/api/bigquery/v2" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginUtils "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" - structpb "github.com/golang/protobuf/ptypes/struct" - "google.golang.org/api/bigquery/v2" ) type QueryJobConfig struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go index 665808830d5..f39ba4e5e41 100644 --- a/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/bigquery/query_job_test.go @@ -3,10 +3,10 @@ package bigquery import ( "testing" - "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" - "github.com/stretchr/testify/assert" "google.golang.org/api/bigquery/v2" + + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" ) func TestGetQueryParameter(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go index 7fba0f98281..6a933c6e4f7 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/integration_test.go @@ -8,12 +8,13 @@ import ( "testing" "time" - "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" - "github.com/flyteorg/flyte/flytestdlib/utils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" + "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" @@ -21,8 +22,7 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flytestdlib/utils" ) func TestEndToEnd(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go index 238932d6388..a0e5aa722e8 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go @@ -10,22 +10,19 @@ import ( "net/http" "time" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" - flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/plugins" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/ioutils" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/utils" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go index a6976abe884..1bafbba2233 100644 --- a/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/databricks/plugin_test.go @@ -9,10 +9,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type MockClient struct { diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go index 92053099e7f..97f53ee3224 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/integration_test.go @@ -8,6 +8,9 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/flyteorg/flyte/flyteidl/clients/go/coreutils" coreIdl "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" @@ -18,8 +21,6 @@ import ( "github.com/flyteorg/flyte/flytestdlib/contextutils" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/promutils/labeled" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" ) func TestEndToEnd(t *testing.T) { diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go index 037b70d390f..33334b4003f 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go @@ -13,16 +13,14 @@ import ( flyteIdlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" errors2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" pluginErrors "github.com/flyteorg/flyte/flyteplugins/go/tasks/errors" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" "github.com/flyteorg/flyte/flytestdlib/errors" "github.com/flyteorg/flyte/flytestdlib/logger" - "github.com/flyteorg/flyte/flytestdlib/promutils" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/webapi" ) const ( diff --git a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go index a7d79781e60..7657a9e315e 100644 --- a/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go +++ b/flyteplugins/go/tasks/plugins/webapi/snowflake/plugin_test.go @@ -9,10 +9,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + pluginsCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" pluginCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" "github.com/flyteorg/flyte/flytestdlib/promutils" - "github.com/stretchr/testify/assert" ) type MockClient struct { diff --git a/flyteplugins/tests/end_to_end.go b/flyteplugins/tests/end_to_end.go index 77522ab1d1b..8fad552b574 100644 --- a/flyteplugins/tests/end_to_end.go +++ b/flyteplugins/tests/end_to_end.go @@ -8,37 +8,27 @@ import ( "testing" "time" - "k8s.io/apimachinery/pkg/util/rand" - "github.com/go-test/deep" - - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "k8s.io/apimachinery/pkg/types" - - "k8s.io/apimachinery/pkg/api/resource" - + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + v12 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/rand" + idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog" catalogMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog/mocks" - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" - - v1 "k8s.io/api/core/v1" - - "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" - "github.com/stretchr/testify/mock" - + pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" coreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io" ioMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks" - - pluginCore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core" + "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue" "github.com/flyteorg/flyte/flytestdlib/promutils" "github.com/flyteorg/flyte/flytestdlib/storage" - "github.com/stretchr/testify/assert" - - idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" ) func createSampleContainerTask() *idlCore.Container {