Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dchourasia committed Dec 19, 2024
2 parents 8e0e6cb + 7e021fe commit f88d22a
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 21 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/verify_generated_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify Generated Files and Import Organization
on:
push:
branches:
- '**'
paths:
- '**.go'
- '**go.mod'
- '**go.sum'
tags-ignore:
- 'v*'
pull_request:
paths:
- '**.go'
- '**go.mod'
- '**go.sum'
jobs:
verify-imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Verify that imports are organized
run: make verify-imports
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,24 @@ setup-kfto: ## Set up Training operator for e2e tests.
kubectl create namespace opendatahub --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k "github.com/opendatahub-io/training-operator/manifests/rhoai"
echo "Wait for Training operator deployment"
kubectl -n opendatahub wait --timeout=300s --for=condition=Available deployments --all
kubectl -n opendatahub wait --timeout=300s --for=condition=Available deployments --all

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

OPENSHIFT-GOIMPORTS ?= $(LOCALBIN)/openshift-goimports

.PHONY: openshift-goimports
openshift-goimports: $(OPENSHIFT-GOIMPORTS) ## Download openshift-goimports locally if necessary.
$(OPENSHIFT-GOIMPORTS): $(LOCALBIN)
test -s $(LOCALBIN)/openshift-goimports || GOBIN=$(LOCALBIN) go install github.com/openshift-eng/openshift-goimports@latest

.PHONY: imports
imports: openshift-goimports ## Organize imports in go files using openshift-goimports. Example: make imports
$(OPENSHIFT-GOIMPORTS)

.PHONY: verify-imports
verify-imports: openshift-goimports ## Run import verifications.
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)
13 changes: 13 additions & 0 deletions hack/verify-imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
OPENSHIFT_GOIMPORTS=${1}

# ${OPENSHIFT_GOIMPORTS} -l
bad_files=$(${OPENSHIFT_GOIMPORTS} -l)

echo $bad_files
if [[ -n ${bad_files} ]]; then
echo "!!! openshift-goimports needs to be run on the following files:"
echo "${bad_files}"
echo "Try running 'make imports'"
exit 1
fi
8 changes: 4 additions & 4 deletions tests/fms/kfto_kueue_sft_GPU_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ import (
"testing"
"time"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
. "github.com/project-codeflare/codeflare-common/support"
prometheusapiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
prometheusmodel "github.com/prometheus/common/model"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
prometheusapiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
prometheusmodel "github.com/prometheus/common/model"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
)

func TestMultiGpuPytorchjobAllamBeta13bChatGptq(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions tests/fms/kfto_kueue_sft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import (
"fmt"
"testing"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
. "github.com/project-codeflare/codeflare-common/support"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
)

func TestPytorchjobWithSFTtrainerFinetuning(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions tests/fms/kfto_kueue_sft_upgrade_training_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ package fms
import (
"testing"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
. "github.com/project-codeflare/codeflare-common/support"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueueacv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kueuev1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1"
kueueacv1beta1 "sigs.k8s.io/kueue/client-go/applyconfiguration/kueue/v1beta1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
"github.com/opendatahub-io/distributed-workloads/tests/kfto"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions tests/fms/kfto_sft_upgrade_sleep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ package fms
import (
"testing"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions tests/kfto/kfto_pytorchjob_failed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ package kfto
import (
"testing"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
)

func TestPyTorchJobFailureWithCuda(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions tests/kfto/kfto_training_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ import (
"fmt"
"testing"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

kftov1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1"
)

func TestPyTorchJobWithCuda(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/odh/mnist_ray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/kueue/apis/kueue/v1beta1"
)

func TestMnistRayCpu(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions tests/odh/mnist_raytune_hpo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
1 change: 1 addition & 0 deletions tests/odh/ray_finetune_llm_deepspeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/odh/raytune_oai_mr_grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"testing"
"time"

corev1 "k8s.io/api/core/v1"

. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"

corev1 "k8s.io/api/core/v1"
)

func TestRaytuneOaiMrGrpcCpu(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions tests/odh/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
gomega "github.com/onsi/gomega"
"github.com/project-codeflare/codeflare-common/support"
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"

v1 "k8s.io/api/core/v1"
)

Expand Down

0 comments on commit f88d22a

Please sign in to comment.