Skip to content

Commit 9e42739

Browse files
committed
grpc for grow is working!
Signed-off-by: vsoch <[email protected]>
1 parent a582201 commit 9e42739

File tree

11 files changed

+638
-297
lines changed

11 files changed

+638
-297
lines changed

api/v1alpha1/ensemble_types.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@ package v1alpha1
1919
import (
2020
"fmt"
2121
"reflect"
22-
"strings"
2322

2423
minicluster "github.com/flux-framework/flux-operator/api/v1alpha2"
2524
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2625
)
2726

2827
var (
2928
defaultSidecarbase = "ghcr.io/converged-computing/ensemble-python:latest"
30-
defaultFluxView = "ghcr.io/converged-computing/flux-view-ubuntu:tag-jammy"
31-
32-
MiniclusterType = "minicluster"
33-
UnknownType = "unknown"
29+
MiniclusterType = "minicluster"
30+
UnknownType = "unknown"
3431
)
3532

3633
// EnsembleSpec defines the desired state of Ensemble
@@ -52,6 +49,11 @@ type Member struct {
5249
// +optional
5350
MiniCluster minicluster.MiniCluster `json:"minicluster,omitempty"`
5451

52+
// Branch
53+
// Instead of pip, install a specific branch of ensemble python
54+
// +optional
55+
Branch string `json:"branch"`
56+
5557
// Ensemble yaml (configuration file)
5658
Ensemble string `json:"ensemble"`
5759
}
@@ -65,9 +67,9 @@ type Sidecar struct {
6567
// +optional
6668
Image string `json:"image"`
6769

68-
// Always pull the sidecar container (useful for development)
70+
// Sidecar image pull policy
6971
// +optional
70-
PullAlways bool `json:"pullAlways"`
72+
ImagePullPolicy string `json:"imagePullPolicy"`
7173

7274
// +kubebuilder:default="50051"
7375
// +default="50051"
@@ -121,17 +123,14 @@ func (e *Ensemble) Validate() error {
121123
e.Spec.Sidecar.Image = defaultSidecarbase
122124
}
123125

124-
// If the sidecar has a digest it's OK, but remove for check
125-
sidecar := e.Spec.Sidecar.Image
126-
if strings.Contains(sidecar, "@") {
127-
parts := strings.Split(sidecar, "@")
128-
sidecar = parts[0]
129-
}
130-
131126
fmt.Printf(" Ensemble.Sidecar.Image: %s\n", e.Spec.Sidecar.Image)
132127
fmt.Printf(" Ensemble.Sidecar.Port: %s\n", e.Spec.Sidecar.Port)
133-
fmt.Printf(" Ensemble.Sidecar.PullAlways: %v\n", e.Spec.Sidecar.PullAlways)
128+
if e.Spec.Sidecar.ImagePullPolicy != "" {
129+
fmt.Printf(" Ensemble.Sidecar.ImagePullPolicy: %v\n", e.Spec.Sidecar.ImagePullPolicy)
130+
}
134131

132+
// TODO stopped here - make interactive cluster with grpc running, shell in, and test
133+
// client.
135134
count := 0
136135
for i, member := range e.Spec.Members {
137136

config/crd/bases/ensemble.flux-framework.org_ensembles.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ spec:
4545
A member of the ensemble that will run for some number of times,
4646
optionally with a maximum or minumum
4747
properties:
48+
branch:
49+
description: |-
50+
Branch
51+
Instead of pip, install a specific branch of ensemble python
52+
type: string
4853
ensemble:
4954
description: Ensemble yaml (configuration file)
5055
type: string
@@ -955,12 +960,12 @@ spec:
955960
Baseimage for the sidecar that will monitor the queue.
956961
Ensure that the operating systems match!
957962
type: string
963+
imagePullPolicy:
964+
description: Sidecar image pull policy
965+
type: string
958966
port:
959967
default: "50051"
960968
type: string
961-
pullAlways:
962-
description: Always pull the sidecar container (useful for development)
963-
type: boolean
964969
workers:
965970
default: 10
966971
format: int32

config/rbac/role.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,42 @@ kind: ClusterRole
44
metadata:
55
name: manager-role
66
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- rolebindings
11+
verbs:
12+
- create
13+
- delete
14+
- get
15+
- list
16+
- patch
17+
- update
18+
- watch
19+
- apiGroups:
20+
- ""
21+
resources:
22+
- roles
23+
verbs:
24+
- create
25+
- delete
26+
- get
27+
- list
28+
- patch
29+
- update
30+
- watch
31+
- apiGroups:
32+
- ""
33+
resources:
34+
- services
35+
verbs:
36+
- create
37+
- delete
38+
- get
39+
- list
40+
- patch
41+
- update
42+
- watch
743
- apiGroups:
844
- apps
945
resources:
@@ -64,6 +100,18 @@ rules:
64100
- patch
65101
- update
66102
- watch
103+
- apiGroups:
104+
- ""
105+
resources:
106+
- serviceaccounts
107+
verbs:
108+
- create
109+
- delete
110+
- get
111+
- list
112+
- patch
113+
- update
114+
- watch
67115
- apiGroups:
68116
- ensemble.flux-framework.org
69117
resources:
@@ -120,3 +168,27 @@ rules:
120168
- patch
121169
- update
122170
- watch
171+
- apiGroups:
172+
- rbac.authorization.k8s.io
173+
resources:
174+
- rolebindings
175+
verbs:
176+
- create
177+
- delete
178+
- get
179+
- list
180+
- patch
181+
- update
182+
- watch
183+
- apiGroups:
184+
- rbac.authorization.k8s.io
185+
resources:
186+
- roles
187+
verbs:
188+
- create
189+
- delete
190+
- get
191+
- list
192+
- patch
193+
- update
194+
- watch

0 commit comments

Comments
 (0)