Skip to content

Commit

Permalink
Merge pull request #193 from rancher/release-v040
Browse files Browse the repository at this point in the history
Update for v0.4.0 release
  • Loading branch information
dbason authored Apr 1, 2022
2 parents a09cf7f + 6e5e985 commit 93ce3bb
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 383 deletions.
11 changes: 7 additions & 4 deletions apis/v1beta1/opnicluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1beta1

import (
"github.com/rancher/opni/apis/v1beta2"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)

Expand All @@ -20,8 +21,6 @@ func (src *OpniCluster) ConvertTo(dstRaw conversion.Hub) error {
services.PayloadReceiver = v1beta2.PayloadReceiverServiceSpec(src.Spec.Services.PayloadReceiver)
services.GPUController = v1beta2.GPUControllerServiceSpec(src.Spec.Services.GPUController)
services.Metrics = v1beta2.MetricsServiceSpec(src.Spec.Services.Metrics)
services.Insights = v1beta2.InsightsServiceSpec(src.Spec.Services.Insights)
services.UI = v1beta2.UIServiceSpec(src.Spec.Services.UI)
dst.Spec.Services = services

nats := v1beta2.NatsSpec{}
Expand Down Expand Up @@ -94,8 +93,12 @@ func (dst *OpniCluster) ConvertFrom(srcRaw conversion.Hub) error {
services.PayloadReceiver = PayloadReceiverServiceSpec(src.Spec.Services.PayloadReceiver)
services.GPUController = GPUControllerServiceSpec(src.Spec.Services.GPUController)
services.Metrics = MetricsServiceSpec(src.Spec.Services.Metrics)
services.Insights = InsightsServiceSpec(src.Spec.Services.Insights)
services.UI = UIServiceSpec(src.Spec.Services.UI)
services.Insights = InsightsServiceSpec{
Enabled: pointer.BoolPtr(false),
}
services.UI = UIServiceSpec{
Enabled: pointer.BoolPtr(false),
}
dst.Spec.Services = services

nats := NatsSpec{}
Expand Down
24 changes: 6 additions & 18 deletions apis/v1beta2/opnicluster_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const (
PayloadReceiverService
GPUControllerService
MetricsService
InsightsService
UIService
OpensearchFetcher
)

Expand All @@ -42,10 +40,6 @@ func (s ServiceKind) String() string {
return "gpu-controller"
case MetricsService:
return "metrics"
case InsightsService:
return "insights"
case UIService:
return "ui"
case OpensearchFetcher:
return "opensearch-fetcher"
default:
Expand All @@ -61,8 +55,6 @@ func (s ServiceKind) ImageName() string {
switch s {
case GPUControllerService:
return "opni-gpu-service-controller"
case UIService:
return "opni-ui"
case OpensearchFetcher:
return "opni-opensearch-fetcher"
default:
Expand All @@ -84,10 +76,8 @@ func (s ServiceKind) GetImageSpec(opniCluster *OpniCluster) *opnimeta.ImageSpec
return &opniCluster.Spec.Services.GPUController.ImageSpec
case MetricsService:
return &opniCluster.Spec.Services.Metrics.ImageSpec
case InsightsService:
return &opniCluster.Spec.Services.Insights.ImageSpec
case UIService:
return &opniCluster.Spec.Services.UI.ImageSpec
case OpensearchFetcher:
return &opniCluster.Spec.Services.OpensearchFetcher.ImageSpec
default:
return nil
}
Expand All @@ -107,10 +97,8 @@ func (s ServiceKind) GetNodeSelector(opniCluster *OpniCluster) map[string]string
return opniCluster.Spec.Services.GPUController.NodeSelector
case MetricsService:
return opniCluster.Spec.Services.Metrics.NodeSelector
case InsightsService:
return opniCluster.Spec.Services.Insights.NodeSelector
case UIService:
return opniCluster.Spec.Services.UI.NodeSelector
case OpensearchFetcher:
return opniCluster.Spec.Services.OpensearchFetcher.NodeSelector
default:
return map[string]string{}
}
Expand All @@ -130,8 +118,8 @@ func (s ServiceKind) GetTolerations(opniCluster *OpniCluster) []corev1.Toleratio
return opniCluster.Spec.Services.GPUController.Tolerations
case MetricsService:
return opniCluster.Spec.Services.Metrics.Tolerations
case UIService:
return opniCluster.Spec.Services.UI.Tolerations
case OpensearchFetcher:
return opniCluster.Spec.Services.OpensearchFetcher.Tolerations
default:
return []corev1.Toleration{}
}
Expand Down
2 changes: 0 additions & 2 deletions apis/v1beta2/opnicluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ type ServicesSpec struct {
PayloadReceiver PayloadReceiverServiceSpec `json:"payloadReceiver,omitempty"`
GPUController GPUControllerServiceSpec `json:"gpuController,omitempty"`
Metrics MetricsServiceSpec `json:"metrics,omitempty"`
Insights InsightsServiceSpec `json:"insights,omitempty"`
UI UIServiceSpec `json:"ui,omitempty"`
OpensearchFetcher OpensearchFetcherServiceSpec `json:"opensearchFetcher,omitempty"`
}

Expand Down
2 changes: 0 additions & 2 deletions apis/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 0 additions & 72 deletions config/crd/bases/opni.io_opniclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4152,42 +4152,6 @@ spec:
type: object
type: array
type: object
insights:
properties:
enabled:
type: boolean
image:
type: string
imagePullPolicy:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
type: array
nodeSelector:
additionalProperties:
type: string
type: object
tolerations:
items:
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
format: int64
type: integer
value:
type: string
type: object
type: array
type: object
metrics:
properties:
enabled:
Expand Down Expand Up @@ -4341,42 +4305,6 @@ spec:
type: object
type: array
type: object
ui:
properties:
enabled:
type: boolean
image:
type: string
imagePullPolicy:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
type: array
nodeSelector:
additionalProperties:
type: string
type: object
tolerations:
items:
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
format: int64
type: integer
value:
type: string
type: object
type: array
type: object
type: object
version:
default: latest
Expand Down
2 changes: 1 addition & 1 deletion controllers/opnicluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var _ = Describe("OpniCluster Controller", Label("controller"), func() {
v1beta2.PreprocessingService,
//v1beta2.GPUControllerService,
v1beta2.MetricsService,
v1beta2.InsightsService,
v1beta2.OpensearchFetcher,
} {
wg.Add(1)

Expand Down
9 changes: 4 additions & 5 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ func buildCluster(opts opniClusterOpts) *v1beta2.OpniCluster {
Nats: v1beta2.NatsSpec{
AuthMethod: v1beta2.NatsAuthUsername,
},
Opensearch: v1beta2.OpensearchClusterSpec{
Version: "1.0.0",
},
Services: v1beta2.ServicesSpec{
Inference: v1beta2.InferenceServiceSpec{
Enabled: pointer.Bool(!opts.DisableOpniServices),
Expand Down Expand Up @@ -266,11 +269,7 @@ func buildCluster(opts opniClusterOpts) *v1beta2.OpniCluster {
return nil
}(),
},
Insights: v1beta2.InsightsServiceSpec{
Enabled: pointer.Bool(!opts.DisableOpniServices),
ImageSpec: imageSpec,
},
UI: v1beta2.UIServiceSpec{
OpensearchFetcher: v1beta2.OpensearchFetcherServiceSpec{
Enabled: pointer.Bool(!opts.DisableOpniServices),
ImageSpec: imageSpec,
},
Expand Down
72 changes: 0 additions & 72 deletions deploy/manifests/00_crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48940,42 +48940,6 @@ spec:
type: object
type: array
type: object
insights:
properties:
enabled:
type: boolean
image:
type: string
imagePullPolicy:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
type: array
nodeSelector:
additionalProperties:
type: string
type: object
tolerations:
items:
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
format: int64
type: integer
value:
type: string
type: object
type: array
type: object
metrics:
properties:
enabled:
Expand Down Expand Up @@ -49129,42 +49093,6 @@ spec:
type: object
type: array
type: object
ui:
properties:
enabled:
type: boolean
image:
type: string
imagePullPolicy:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
type: array
nodeSelector:
additionalProperties:
type: string
type: object
tolerations:
items:
properties:
effect:
type: string
key:
type: string
operator:
type: string
tolerationSeconds:
format: int64
type: integer
value:
type: string
type: object
type: array
type: object
type: object
version:
default: latest
Expand Down
2 changes: 1 addition & 1 deletion deploy/manifests/20_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ metadata:
name: cluster
namespace: opni
spec:
version: v0.3.1
version: v0.4.0
deployLogCollector: true
services:
gpuController:
Expand Down
Loading

0 comments on commit 93ce3bb

Please sign in to comment.