Skip to content

Commit 4c8cdf6

Browse files
authored
Merge pull request #1 from Fiona-Waters/support-package-refactor
Support package refactor
2 parents 32729c5 + ce52e74 commit 4c8cdf6

26 files changed

+2529
-0
lines changed

Diff for: .github/workflows/verify_generated_files.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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@v3
22+
- name: Set Go
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: v1.19
26+
- name: Verify that imports are organized
27+
run: make verify-imports
28+
29+
verify-manifests:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set Go
34+
uses: actions/setup-go@v3
35+
with:
36+
go-version: v1.19
37+
- name: Verify that the latest WebhookConfigurations, ClusterRoles, and CustomResourceDefinitions have been generated
38+
run: make manifests && git diff --exit-code

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.dll
88
*.so
99
*.dylib
10+
bin
1011

1112
# Test binary, built with `go test -c`
1213
*.test

Diff for: Makefile

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CODEFLARE_SDK_VERSION defines the default version of the CodeFlare SDK
2+
CODEFLARE_SDK_VERSION ?= 0.9.0
3+
4+
# RAY_VERSION defines the default version of Ray (used for testing)
5+
RAY_VERSION ?= 2.5.0
6+
7+
# RAY_IMAGE defines the default container image for Ray (used for testing)
8+
RAY_IMAGE ?= rayproject/ray:$(RAY_VERSION)
9+
10+
##@ Development
11+
12+
DEFAULTS_TEST_FILE := support/defaults.go
13+
14+
.PHONY: defaults
15+
defaults:
16+
$(info Regenerating $(DEFAULTS_TEST_FILE))
17+
@echo "package support" > $(DEFAULTS_TEST_FILE)
18+
@echo "" >> $(DEFAULTS_TEST_FILE)
19+
@echo "// ***********************" >> $(DEFAULTS_TEST_FILE)
20+
@echo "// DO NOT EDIT THIS FILE" >> $(DEFAULTS_TEST_FILE)
21+
@echo "// ***********************" >> $(DEFAULTS_TEST_FILE)
22+
@echo "" >> $(DEFAULTS_TEST_FILE)
23+
@echo "const (" >> $(DEFAULTS_TEST_FILE)
24+
@echo " CodeFlareSDKVersion = \"$(CODEFLARE_SDK_VERSION)\"" >> $(DEFAULTS_TEST_FILE)
25+
@echo " RayVersion = \"$(RAY_VERSION)\"" >> $(DEFAULTS_TEST_FILE)
26+
@echo " RayImage = \"$(RAY_IMAGE)\"" >> $(DEFAULTS_TEST_FILE)
27+
@echo "" >> $(DEFAULTS_TEST_FILE)
28+
@echo ")" >> $(DEFAULTS_TEST_FILE)
29+
@echo "" >> $(DEFAULTS_TEST_FILE)
30+
31+
gofmt -w $(DEFAULTS_TEST_FILE)
32+
33+
## Tool Binaries
34+
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
35+
36+
## Tool Versions
37+
CONTROLLER_TOOLS_VERSION ?= v0.9.2
38+
39+
40+
## Location to install dependencies to
41+
LOCALBIN ?= $(shell pwd)/bin
42+
$(LOCALBIN):
43+
mkdir -p $(LOCALBIN)
44+
45+
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN)/openshift-goimports
46+
47+
.PHONY: openshift-goimports
48+
openshift-goimports: $(OPENSHIFT-GOIMPORTS) ## Download openshift-goimports locally if necessary.
49+
$(OPENSHIFT-GOIMPORTS): $(LOCALBIN)
50+
test -s $(LOCALBIN)/openshift-goimports || GOBIN=$(LOCALBIN) go install github.com/openshift-eng/openshift-goimports@latest
51+
52+
.PHONY: imports
53+
imports: openshift-goimports ## Organize imports in go files using openshift-goimports. Example: make imports
54+
$(OPENSHIFT-GOIMPORTS)
55+
56+
.PHONY: verify-imports
57+
verify-imports: openshift-goimports ## Run import verifications.
58+
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)
59+
60+
.PHONY: controller-gen
61+
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
62+
$(CONTROLLER_GEN): $(LOCALBIN)
63+
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
64+
65+
.PHONY: manifests
66+
manifests: controller-gen ## Generate RBAC objects.
67+
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..."

Diff for: go.mod

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
module github.com/project-codeflare/codeflare-common
2+
3+
go 1.19
4+
5+
require (
6+
github.com/onsi/gomega v1.28.0
7+
github.com/openshift-online/ocm-sdk-go v0.1.373
8+
github.com/openshift/api v0.0.0-20231012181603-8f468d7b55a8
9+
github.com/openshift/client-go v0.0.0-20231005121823-e81400b97c46
10+
github.com/project-codeflare/multi-cluster-app-dispatcher v1.36.0
11+
github.com/ray-project/kuberay/ray-operator v0.0.0-20231013074931-1184bc872c08
12+
k8s.io/api v0.28.2
13+
k8s.io/apimachinery v0.28.2
14+
k8s.io/client-go v0.28.2
15+
)
16+
17+
require (
18+
github.com/aymerick/douceur v0.2.0 // indirect
19+
github.com/beorn7/perks v1.0.1 // indirect
20+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
21+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
22+
github.com/davecgh/go-spew v1.1.1 // indirect
23+
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
24+
github.com/go-logr/logr v1.2.4 // indirect
25+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
26+
github.com/go-openapi/jsonreference v0.20.2 // indirect
27+
github.com/go-openapi/swag v0.22.3 // indirect
28+
github.com/gogo/protobuf v1.3.2 // indirect
29+
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
30+
github.com/golang/glog v1.0.0 // indirect
31+
github.com/golang/protobuf v1.5.3 // indirect
32+
github.com/google/gnostic-models v0.6.8 // indirect
33+
github.com/google/go-cmp v0.5.9 // indirect
34+
github.com/google/gofuzz v1.2.0 // indirect
35+
github.com/google/uuid v1.3.0 // indirect
36+
github.com/gorilla/css v1.0.0 // indirect
37+
github.com/imdario/mergo v0.3.12 // indirect
38+
github.com/josharian/intern v1.0.0 // indirect
39+
github.com/json-iterator/go v1.1.12 // indirect
40+
github.com/mailru/easyjson v0.7.7 // indirect
41+
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
42+
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
43+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
44+
github.com/modern-go/reflect2 v1.0.2 // indirect
45+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
46+
github.com/prometheus/client_golang v1.14.0 // indirect
47+
github.com/prometheus/client_model v0.3.0 // indirect
48+
github.com/prometheus/common v0.37.0 // indirect
49+
github.com/prometheus/procfs v0.8.0 // indirect
50+
github.com/spf13/pflag v1.0.5 // indirect
51+
golang.org/x/net v0.14.0 // indirect
52+
golang.org/x/oauth2 v0.8.0 // indirect
53+
golang.org/x/sys v0.11.0 // indirect
54+
golang.org/x/term v0.11.0 // indirect
55+
golang.org/x/text v0.12.0 // indirect
56+
golang.org/x/time v0.3.0 // indirect
57+
google.golang.org/appengine v1.6.7 // indirect
58+
google.golang.org/protobuf v1.30.0 // indirect
59+
gopkg.in/inf.v0 v0.9.1 // indirect
60+
gopkg.in/yaml.v2 v2.4.0 // indirect
61+
gopkg.in/yaml.v3 v3.0.1 // indirect
62+
k8s.io/klog/v2 v2.100.1 // indirect
63+
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
64+
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
65+
sigs.k8s.io/controller-runtime v0.11.1 // indirect
66+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
67+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
68+
sigs.k8s.io/yaml v1.3.0 // indirect
69+
)

0 commit comments

Comments
 (0)