Skip to content

Commit f88d22a

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 8e0e6cb + 7e021fe commit f88d22a

14 files changed

+81
-21
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

hack/verify-imports.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

tests/fms/kfto_kueue_sft_GPU_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

3737
func TestMultiGpuPytorchjobAllamBeta13bChatGptq(t *testing.T) {

tests/fms/kfto_kueue_sft_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

3535
func TestPytorchjobWithSFTtrainerFinetuning(t *testing.T) {

tests/fms/kfto_kueue_sft_upgrade_training_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ package fms
1919
import (
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

3636
var (

tests/fms/kfto_sft_upgrade_sleep_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ package fms
1919
import (
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

3231
var (

tests/kfto/kfto_pytorchjob_failed_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ package kfto
33
import (
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

1615
func TestPyTorchJobFailureWithCuda(t *testing.T) {

tests/kfto/kfto_training_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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

3332
func TestPyTorchJobWithCuda(t *testing.T) {

tests/odh/mnist_ray_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

3535
func TestMnistRayCpu(t *testing.T) {

0 commit comments

Comments
 (0)