Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable goimport and add new makefile target to only build image without test #123

Merged
merged 2 commits into from
Jan 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/test-job.yaml
Original file line number Diff line number Diff line change
@@ -62,16 +62,23 @@ jobs:
with:
go-version: '~1.15.1'

- name: Set up Docker
uses: docker-practice/actions-setup-docker@master

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
# When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Default value should work for both pull_request and merge(push) event.
ref: ${{github.event.pull_request.head.sha}}

- name: Install goimports
run: go get golang.org/x/tools/cmd/goimports

- name: Run goimports
run: test -z "$(set -o pipefail && $(go env GOPATH)/bin/goimports -l . | tee goimports.out)" || { cat goimports.out && exit 1; }

- name: Open this to see how to fix goimports if it fails
run: echo Run goimports -w .
if: failure()

- name: list directories
working-directory: ${{env.working-directory}}
@@ -90,10 +97,13 @@ jobs:
run: make build
working-directory: ${{env.working-directory}}

- name: Build Docker Image
run: make docker-build
working-directory: ${{env.working-directory}}

- name: Test
run: make test
working-directory: ${{env.working-directory}}

- name: Set up Docker
uses: docker-practice/actions-setup-docker@master

- name: Build Docker Image
run: make docker-image
working-directory: ${{env.working-directory}}
2 changes: 1 addition & 1 deletion apiserver/cmd/main.go
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ import (
"k8s.io/klog/v2"

"github.com/prometheus/client_golang/prometheus/promhttp"
api "github.com/ray-project/kuberay/proto/go_client"
"github.com/ray-project/kuberay/apiserver/pkg/interceptor"
"github.com/ray-project/kuberay/apiserver/pkg/manager"
"github.com/ray-project/kuberay/apiserver/pkg/server"
api "github.com/ray-project/kuberay/proto/go_client"
)

var (
1 change: 1 addition & 0 deletions apiserver/pkg/interceptor/interceptor.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package interceptor

import (
"context"

"google.golang.org/grpc"
"k8s.io/klog/v2"
)
1 change: 0 additions & 1 deletion apiserver/pkg/manager/client_manager.go
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ func (c *ClientManager) Time() util.TimeInterface {
return c.time
}


func (c *ClientManager) init() {
// db, kubernetes initialization
klog.Info("Initializing client manager")
4 changes: 2 additions & 2 deletions apiserver/pkg/server/cluster_server.go
Original file line number Diff line number Diff line change
@@ -2,10 +2,11 @@ package server

import (
"context"

"github.com/golang/protobuf/ptypes/empty"
api "github.com/ray-project/kuberay/proto/go_client"
"github.com/ray-project/kuberay/apiserver/pkg/manager"
"github.com/ray-project/kuberay/apiserver/pkg/util"
api "github.com/ray-project/kuberay/proto/go_client"
)

type ClusterServerOptions struct {
@@ -42,7 +43,6 @@ func (s *ClusterServer) DeleteCluster(ctx context.Context, request *api.DeleteCl
panic("Implement me")
}


func ValidateCreateClusterRequest(request *api.CreateClusterRequest) error {
if request.Cluster.Name == "" {
return util.NewInvalidInputError("Cluster name is empty. Please specify a valid value.")
4 changes: 3 additions & 1 deletion ray-operator/Makefile
Original file line number Diff line number Diff line change
@@ -63,9 +63,11 @@ build: generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go

docker-build: test ## Build docker image with the manager.
docker-image: ## Build image only
docker build -t ${IMG} .

docker-build: test docker-image ## Build docker image with the manager.

docker-push: ## Push docker image with the manager.
docker push ${IMG}