diff --git a/flyteplugins/.golangci.yml b/flyteplugins/.golangci.yml index a414f33f79..7f4dbc80e8 100644 --- a/flyteplugins/.golangci.yml +++ b/flyteplugins/.golangci.yml @@ -1,7 +1,7 @@ # WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: +# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: # -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst +# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst run: skip-dirs: @@ -13,6 +13,7 @@ linters: - deadcode - errcheck - gas + - gci - goconst - goimports - golint @@ -28,3 +29,12 @@ linters: - unparam - unused - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go b/flyteplugins/boilerplate/flyte/golang_support_tools/tools.go index a78b61162a..6c3da04107 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 c7e5577ef3..9cd49959f4 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/goimports b/flyteplugins/boilerplate/flyte/golang_test_targets/goimports index af1829036c..40f50d106e 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/boilerplate/flyte/golangci_file/.golangci.yml b/flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml new file mode 100644 index 0000000000..7f4dbc80e8 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/.golangci.yml @@ -0,0 +1,40 @@ +# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. +# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: +# +# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst + +run: + skip-dirs: + - pkg/client + +linters: + disable-all: true + enable: + - deadcode + - errcheck + - gas + - gci + - goconst + - goimports + - golint + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - staticcheck + - structcheck + - typecheck + - unconvert + - unparam + - unused + - varcheck + +linters-settings: + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/flyteorg) + skip-generated: true diff --git a/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst b/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst new file mode 100644 index 0000000000..e4cbd18b96 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/Readme.rst @@ -0,0 +1,8 @@ +GolangCI File +~~~~~~~~~~~~~ + +Provides a ``.golangci`` file with the linters we've agreed upon. + +**To Enable:** + +Add ``flyteorg/golangci_file`` to your ``boilerplate/update.cfg`` file. diff --git a/flyteplugins/boilerplate/flyte/golangci_file/update.sh b/flyteplugins/boilerplate/flyte/golangci_file/update.sh new file mode 100755 index 0000000000..ab2f85c680 --- /dev/null +++ b/flyteplugins/boilerplate/flyte/golangci_file/update.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. +# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY: +# +# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst + +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +# Clone the .golangci file +echo " - copying ${DIR}/.golangci to the root directory." +cp ${DIR}/.golangci.yml ${DIR}/../../../.golangci.yml diff --git a/flyteplugins/boilerplate/update.cfg b/flyteplugins/boilerplate/update.cfg index d4c008a812..3a632dbe72 100755 --- a/flyteplugins/boilerplate/update.cfg +++ b/flyteplugins/boilerplate/update.cfg @@ -1,5 +1,6 @@ +flyte/code_of_conduct +flyte/docker_build flyte/golang_test_targets flyte/golang_support_tools +flyte/golangci_file flyte/pull_request_template -flyte/docker_build -flyte/code_of_conduct diff --git a/flyteplugins/go/tasks/aws/client.go b/flyteplugins/go/tasks/aws/client.go index cc0d606c9a..7d6d47d655 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 9f614bef29..387305ebec 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 5fc636e7e0..0ca515d7c8 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 42e6fdd83b..fbf86b9933 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 04ba00528d..a36edf20ea 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 956e38a922..c302db8c32 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 91470f7994..7e309396fc 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 b1acc2c953..4b8e2efb37 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 4a9b804492..aedc2795dd 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 070e023e94..43b6754c02 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 29ee207487..a7038b8bf3 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 835e5a4f0d..4d5d84c33c 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 7dc5ece5df..8517b9c385 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 420fc7f60a..1237220374 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 d2538f4032..ba6edc4f37 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 bb24159681..9b5dec96de 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 567c8ab68a..385abf09f4 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 a7f6c97477..ba2f5f6ae9 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 a58fbfe55c..4c32d290f8 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 dbba1f3b68..b2ed99fbdb 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 d4a04ec1c5..4515d6311c 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 bec39010be..ca6d3be42f 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 f41262771f..09a9fbf52b 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 645e9e2233..c2d868c039 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 db2cece649..5703b88d81 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 6c80fbd09d..8d33305806 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 5c503239d0..0c3f8d90f2 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 9c8c1d25af..64ac86129f 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 1b1a163b24..d963c1817a 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 d8a2a08664..fe626764a2 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 661d24b14c..8c75f00a90 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 0a136edfef..7e530f42db 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 d31f5a0955..a20ef4a1ab 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 18fe498e20..881e7a888d 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 128a812657..a305323dca 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 a341b9172f..53e80cd391 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 91a171bbec..d5e04f7347 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 d7db79495c..65d90a6c7e 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 3ee99b2f4b..bf6ef791ac 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 40f9999ff8..85ba42d0c6 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 b014f8df76..f2fa03104c 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 4876ec2724..c68634d0e0 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 bb6f0b089c..c47d77ae76 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 ae64646e8a..c46a75f05f 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 bd0c7b2c24..a9001f20f8 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 e786365a3b..ad82fca8a3 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 eb7224800a..28bacceaed 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 1b768578d4..afd884ca02 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 1a4a818bda..896cd2d648 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 c7bb704da8..6071c40d74 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 241f2e553d..5a6f4dd522 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 e20e0e18c0..70304597a2 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 49b499e114..152644d828 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 8865e75783..0e7ae179d9 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 80cb54ce43..a1ed90934e 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 0d58a46cc2..1ca51eb1ad 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 a7eb38c8eb..9854a3156f 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 3e15231e00..175060f2ce 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 fa6ec67d21..97abfefd8a 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 0bb3774dcd..8b56f7dd5e 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 b792ce80ce..39a241a50e 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 50c9213afb..e3f03047aa 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 5f5a911ccf..e9a4317e17 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 9b51db0b82..b6ea59020b 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 c2a3f17e80..de5265fda6 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 ffd462d76c..95b5c7881f 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 bcb34eace7..0ec6c2066e 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 f6d9906594..37be2c1e40 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 09d75bc493..fce1acde89 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 76fd52f775..d2ded7d8e8 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 6d6bd897d0..701b4780aa 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 6b17f2c81c..96aabcfcc6 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 74ad8617c4..1ff3a44aff 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 efef99643c..fe35f74e2a 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 5187ed7086..99688fe36d 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 120fe40d2d..28d1eb8483 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 9629b3d771..1ca10cb39d 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 22f39c200d..1ef9e4ec5b 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 6568fecee3..61f9b137e7 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 ad51d2e789..cd3bca93c4 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 cc3c258e38..8196925e15 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 10752d6f3c..609bab6cf7 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 4b23c6dabb..449280bdcf 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 cf60cbc491..592d602ff4 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 967639e6ed..666b1e741a 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 9188ce0237..d40edd41de 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 c3a05b0fcc..caf2e51a38 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 521189cb67..8c252a7c06 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 27beea588e..bbe8c88995 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 0efbdc4088..8544555609 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 fe52dc2ff6..15a36a4dcf 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 f7330d3b6f..4ac7c71b4c 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 90275fb844..262bd3b822 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 80cfb1f742..665eec309f 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 51fe731de0..26a80531b5 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 1424731848..8f9c670c57 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 c19cbb72a8..d92eeb8c62 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 172d0b65fd..3e324391b8 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 1b8a8224a2..04623c2b47 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 89996226e6..fdf9d4a182 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 5e1d37e066..5bead4954d 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 a62c275f0c..cb1a2c0b5f 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 beeb1a7787..8ac4d6edc0 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 ea0078db20..c3e213e403 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 1f59f2a7e3..d31988425f 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 7ddf06a1dc..f218e9540f 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 e5d4664cfe..9d4ad8b822 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 d098b627b1..027e5df801 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 f245279df4..16ac3835bd 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 b265c31bfb..4e34a04593 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 b077da986a..40885ab093 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 3dfcf62385..82ef507cef 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 7be422281f..5e64c6ef93 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 7a0dbe9ed9..815e51135a 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 9635526aaf..f8fe8d4148 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 cfec0d3af4..576740af93 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 f6a9787dbb..e0903d02a3 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 6c083b6898..ae77d8c94d 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 25e45ad727..1358422ec7 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 bda0faff75..7b6e1f5611 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 2461c7bc18..e844c05d0f 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 f980c89741..9d95ecc61b 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 1c4c965819..8db340d37e 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 ee5e97db16..bcabdaa87f 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 286c2673d7..19000e0c72 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 aacfea7425..d21eefb8b9 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 bbc797065c..48a000de17 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 18499069dd..08c44ce9e1 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 9b205beee6..fc39a04bf3 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 40513e0ffa..9d7abe45a7 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 326eadfb8c..4b6bcc2360 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 26b0efddad..cf412edd0c 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 a7364c96ca..fa80bbadf5 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 eac4d696ec..094a9e5b01 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 c4fb453acb..b233af182c 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 4f3caef8d7..ee3452f6b6 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 062fbda449..b26255d78d 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 6e99ca0ae4..665a31caac 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 623d55f674..328efc2e5c 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 44150e547f..38cc76bbab 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 437945fe1e..3733f74725 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 95616c249b..047d2ae23c 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 e4266e1fd0..8c5093ddac 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 695b780b06..e23a6ae912 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 6f8de3c5ff..559d6a1af3 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 6b8b735548..3399c013ae 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 ae0741a914..4d20d64ee6 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 40b81eb705..cc5248c0f2 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 e014d64b66..111f0ad80b 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 7b452b0c68..306dfda4c7 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 69cc3d4d38..60fc1cc050 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 b110897a47..a3e6d69d66 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 1cd92caf9d..0aecffdfc7 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 c50d361726..d115bad896 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 3a8e759908..ee3b699e9d 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 ec1c641c0e..a1f16163fe 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 0ef2ddf3c7..6e3238d813 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 bdee75c282..761e81842a 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 40106c6b93..da490838fe 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 c8c8ff1614..eb118e3211 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 8db32ad6fa..5509c216f7 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 698eeeb5dc..f08d1d15ea 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 499e6c5792..939fe0577a 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 8a9190d8e5..7ce788e0fe 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 665808830d..f39ba4e5e4 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 7fba0f9828..6a933c6e4f 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 238932d638..a0e5aa722e 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 a6976abe88..1bafbba223 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 92053099e7..97f53ee322 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 037b70d390..33334b4003 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 a7d79781e6..7657a9e315 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 77522ab1d1..8fad552b57 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 {