File tree Expand file tree Collapse file tree 14 files changed +81
-21
lines changed
Expand file tree Collapse file tree 14 files changed +81
-21
lines changed Original file line number Diff line number Diff line change 1+ name : Verify Generated Files and Import Organization
2+ on :
3+ push :
4+ branches :
5+ - ' **'
6+ paths :
7+ - ' **.go'
8+ - ' **go.mod'
9+ - ' **go.sum'
10+ tags-ignore :
11+ - ' v*'
12+ pull_request :
13+ paths :
14+ - ' **.go'
15+ - ' **go.mod'
16+ - ' **go.sum'
17+ jobs :
18+ verify-imports :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : Set Go
23+ uses : actions/setup-go@v5
24+ with :
25+ go-version-file : ' ./go.mod'
26+ - name : Verify that imports are organized
27+ run : make verify-imports
Original file line number Diff line number Diff line change @@ -13,4 +13,24 @@ setup-kfto: ## Set up Training operator for e2e tests.
1313 kubectl create namespace opendatahub --dry-run=client -o yaml | kubectl apply -f -
1414 kubectl apply -k " github.com/opendatahub-io/training-operator/manifests/rhoai"
1515 echo " Wait for Training operator deployment"
16- kubectl -n opendatahub wait --timeout=300s --for=condition=Available deployments --all
16+ kubectl -n opendatahub wait --timeout=300s --for=condition=Available deployments --all
17+
18+ # # Location to install dependencies to
19+ LOCALBIN ?= $(shell pwd) /bin
20+ $(LOCALBIN ) :
21+ mkdir -p $(LOCALBIN )
22+
23+ OPENSHIFT-GOIMPORTS ?= $(LOCALBIN ) /openshift-goimports
24+
25+ .PHONY : openshift-goimports
26+ openshift-goimports : $(OPENSHIFT-GOIMPORTS ) # # Download openshift-goimports locally if necessary.
27+ $(OPENSHIFT-GOIMPORTS ) : $(LOCALBIN )
28+ test -s $(LOCALBIN ) /openshift-goimports || GOBIN=$(LOCALBIN ) go install github.com/openshift-eng/openshift-goimports@latest
29+
30+ .PHONY : imports
31+ imports : openshift-goimports # # Organize imports in go files using openshift-goimports. Example: make imports
32+ $(OPENSHIFT-GOIMPORTS )
33+
34+ .PHONY : verify-imports
35+ verify-imports : openshift-goimports # # Run import verifications.
36+ ./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS )
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ OPENSHIFT_GOIMPORTS=${1}
3+
4+ # ${OPENSHIFT_GOIMPORTS} -l
5+ bad_files=$( ${OPENSHIFT_GOIMPORTS} -l)
6+
7+ echo $bad_files
8+ if [[ -n ${bad_files} ]]; then
9+ echo " !!! openshift-goimports needs to be run on the following files:"
10+ echo " ${bad_files} "
11+ echo " Try running 'make imports'"
12+ exit 1
13+ fi
Original file line number Diff line number Diff line change @@ -21,17 +21,17 @@ import (
2121 "testing"
2222 "time"
2323
24+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
2425 . "github.com/onsi/gomega"
25- "github.com/opendatahub-io/distributed-workloads/tests/kfto"
2626 . "github.com/project-codeflare/codeflare-common/support"
27+ prometheusapiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
28+ prometheusmodel "github.com/prometheus/common/model"
2729
2830 corev1 "k8s.io/api/core/v1"
2931 "k8s.io/apimachinery/pkg/api/resource"
3032 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3133
32- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
33- prometheusapiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
34- prometheusmodel "github.com/prometheus/common/model"
34+ "github.com/opendatahub-io/distributed-workloads/tests/kfto"
3535)
3636
3737func TestMultiGpuPytorchjobAllamBeta13bChatGptq (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ import (
2020 "fmt"
2121 "testing"
2222
23+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
2324 . "github.com/onsi/gomega"
24- "github.com/opendatahub-io/distributed-workloads/tests/kfto"
2525 . "github.com/project-codeflare/codeflare-common/support"
26- kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
2726
2827 corev1 "k8s.io/api/core/v1"
2928 "k8s.io/apimachinery/pkg/api/resource"
3029 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30+ kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
3131
32- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1 "
32+ "github.com/opendatahub-io/distributed-workloads/tests/kfto "
3333)
3434
3535func TestPytorchjobWithSFTtrainerFinetuning (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ package fms
1919import (
2020 "testing"
2121
22+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
2223 . "github.com/onsi/gomega"
23- "github.com/opendatahub-io/distributed-workloads/tests/kfto"
2424 . "github.com/project-codeflare/codeflare-common/support"
25- kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
26- kueueacv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
2725
2826 corev1 "k8s.io/api/core/v1"
2927 "k8s.io/apimachinery/pkg/api/errors"
3028 "k8s.io/apimachinery/pkg/api/resource"
3129 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30+ kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
31+ kueueacv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"
3232
33- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1 "
33+ "github.com/opendatahub-io/distributed-workloads/tests/kfto "
3434)
3535
3636var (
Original file line number Diff line number Diff line change @@ -19,14 +19,13 @@ package fms
1919import (
2020 "testing"
2121
22+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
2223 . "github.com/onsi/gomega"
2324 . "github.com/project-codeflare/codeflare-common/support"
2425
2526 corev1 "k8s.io/api/core/v1"
2627 "k8s.io/apimachinery/pkg/api/errors"
2728 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28-
29- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
3029)
3130
3231var (
Original file line number Diff line number Diff line change @@ -3,14 +3,13 @@ package kfto
33import (
44 "testing"
55
6+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
67 . "github.com/onsi/gomega"
78 . "github.com/project-codeflare/codeflare-common/support"
89
910 corev1 "k8s.io/api/core/v1"
1011 "k8s.io/apimachinery/pkg/api/resource"
1112 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12-
13- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
1413)
1514
1615func TestPyTorchJobFailureWithCuda (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -20,14 +20,13 @@ import (
2020 "fmt"
2121 "testing"
2222
23+ kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
2324 . "github.com/onsi/gomega"
2425 . "github.com/project-codeflare/codeflare-common/support"
2526
2627 corev1 "k8s.io/api/core/v1"
2728 "k8s.io/apimachinery/pkg/api/resource"
2829 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29-
30- kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
3130)
3231
3332func TestPyTorchJobWithCuda (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ import (
2525 . "github.com/onsi/gomega"
2626 . "github.com/project-codeflare/codeflare-common/support"
2727 rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
28- "sigs.k8s.io/kueue/apis/kueue/v1beta1"
2928
3029 corev1 "k8s.io/api/core/v1"
3130 "k8s.io/apimachinery/pkg/api/resource"
3231 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32+ "sigs.k8s.io/kueue/apis/kueue/v1beta1"
3333)
3434
3535func TestMnistRayCpu (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments