Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 7b61bf3

Browse files
committed
Revert code in main branch to single cluster support
1 parent 9f05a7f commit 7b61bf3

32 files changed

+455
-5348
lines changed

PROJECT

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,4 @@ resources:
1717
kind: AppWrapper
1818
path: github.com/tardieu/mcad/api/v1beta1
1919
version: v1beta1
20-
- api:
21-
crdVersion: v1
22-
namespaced: true
23-
controller: true
24-
domain: codeflare.dev
25-
group: workload
26-
kind: ClusterInfo
27-
path: github.com/tardieu/mcad/api/v1beta1
28-
plural: clusterinfo
29-
version: v1beta1
3020
version: "3"

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ This repository contains a prototype MCAD implementation
55
using recent versions of [controller
66
runtime](https://github.com/kubernetes-sigs/controller-runtime) and
77
[kubebuilder](https://github.com/kubernetes-sigs/kubebuilder). This prototype
8-
does not implement quotas.
9-
10-
Multi-cluster support assumes the use of [KubeStellar](https://kubestellar.io)
11-
syncers. A simple [syncer.js](syncer/syncer.js) is provided as possible
12-
substitute for development.
8+
does not implement quotas or dispatching to multiple clusters.
139

1410
## Getting Started
1511

api/v1beta1/appwrapper_types.go

Lines changed: 21 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -36,94 +36,39 @@ type AppWrapperSpec struct {
3636

3737
// Wrapped resources
3838
Resources AppWrapperResources `json:"resources"`
39-
40-
// Dispatcher status
41-
DispatcherStatus AppWrapperDispatcherStatus `json:"dispatcherStatus,omitempty"`
42-
43-
// Sustainable specification
44-
Sustainable SustainableSpec `json:"sustainable,omitempty"`
45-
46-
// Dispatching gates
47-
DispatchingGates []DispatchingGate `json:"dispatchingGates,omitempty"`
4839
}
4940

50-
// Dispatching gate
51-
type DispatchingGate string
52-
5341
type SchedulingSpec struct {
54-
// Minimum number of pods that need to run and succeed
55-
// These pods have to be labeled with the AppWrapper name to be accounted for and monitored by mcad:
56-
// workload.codeflare.dev: <appWrapper-name>
42+
// Minimum number of pods
5743
MinAvailable int32 `json:"minAvailable,omitempty"`
5844

5945
// Requeuing specification
6046
Requeuing RequeuingSpec `json:"requeuing,omitempty"`
61-
62-
// Cluster specification
63-
ClusterScheduling *ClusterSchedulingSpec `json:"clusterScheduling,omitempty"`
6447
}
6548

6649
type RequeuingSpec struct {
6750
// Max requeuings permitted
6851
MaxNumRequeuings int32 `json:"maxNumRequeuings,omitempty"`
6952
}
7053

71-
// Where to run
72-
type ClusterSchedulingSpec struct {
73-
PolicyResult ClusterDecision `json:"policyResult,omitempty"`
74-
}
75-
76-
type ClusterDecision struct {
77-
TargetCluster ClusterReference `json:"targetCluster,omitempty"`
78-
}
79-
80-
type ClusterReference struct {
81-
Name string `json:"name"`
82-
}
83-
84-
type SustainableSpec struct {
85-
// TODO
86-
}
87-
88-
// Status from the dispatcher perspective
89-
type AppWrapperDispatcherStatus struct {
54+
// AppWrapperStatus defines the observed state of AppWrapper
55+
type AppWrapperStatus struct {
9056
// Phase
9157
Phase AppWrapperPhase `json:"phase,omitempty"`
9258

9359
// When last dispatched
9460
LastDispatchingTime metav1.Time `json:"lastDispatchingTime,omitempty"`
9561

96-
// How many times requeued
97-
Requeued int32 `json:"requeued,omitempty"`
98-
99-
// Transition log
100-
Transitions []AppWrapperTransition `json:"transitions,omitempty"`
101-
102-
// Total time dispatched in seconds (excluding current leg)
103-
TimeDispatched int64 `json:"timeDispatched,omitempty"`
104-
}
105-
106-
// Status from the runner perspective
107-
type AppWrapperRunnerStatus struct {
108-
// Phase
109-
Phase AppWrapperPhase `json:"phase,omitempty"`
110-
111-
// When last running
112-
LastRunningTime metav1.Time `json:"lastRunningTime,omitempty"`
113-
11462
// When last requeued
11563
LastRequeuingTime metav1.Time `json:"lastRequeuingTime,omitempty"`
11664

65+
// How many times restarted
66+
Restarts int32 `json:"restarts"`
67+
11768
// Transition log
11869
Transitions []AppWrapperTransition `json:"transitions,omitempty"`
11970
}
12071

121-
// Status
122-
type AppWrapperStatus struct {
123-
// Runner status
124-
RunnerStatus AppWrapperRunnerStatus `json:"runnerStatus,omitempty"`
125-
}
126-
12772
// AppWrapperPhase is the label for the AppWrapper status
12873
type AppWrapperPhase string
12974

@@ -132,36 +77,35 @@ const (
13277
Empty AppWrapperPhase = ""
13378

13479
// no resource reservation
135-
Queued AppWrapperPhase = "Queued" // dispatcher-only phase
80+
Queued AppWrapperPhase = "Queued"
13681

13782
// resources are reserved
13883
Dispatching AppWrapperPhase = "Dispatching"
13984

14085
// resources are reserved
14186
Running AppWrapperPhase = "Running"
14287

143-
// no resource reservation even if pods may still exist in completed state
88+
// no resource reservation
14489
Succeeded AppWrapperPhase = "Succeeded"
14590

146-
// resources are reserved as failures may be partial
147-
// AppWrapper may not be requeued
91+
// resources are reserved (some pods may still be running)
14892
Failed AppWrapperPhase = "Failed"
14993

150-
// resources are reserved
94+
// resources are reserved (some pods may still be running)
15195
Requeuing AppWrapperPhase = "Requeuing"
15296
)
15397

154-
// AppWrapperResource
98+
// AppWrapper resources
15599
type AppWrapperResources struct {
156-
// GenericItems
100+
// Array of GenericItems
157101
GenericItems []GenericItem `json:"GenericItems"`
158102
}
159103

160-
// GenericItems is the schema for the wrapped resources
104+
// AppWrapper resource
161105
type GenericItem struct {
162106
DoNotUseReplicas int32 `json:"replicas,omitempty"`
163107

164-
// Replica count and resource requests
108+
// Array of resource requests
165109
CustomPodResources []CustomPodResource `json:"custompodresources,omitempty"`
166110

167111
// A comma-separated list of keywords to match against condition types
@@ -171,7 +115,7 @@ type GenericItem struct {
171115
GenericTemplate runtime.RawExtension `json:"generictemplate"`
172116
}
173117

174-
// Replica count and resource requests
118+
// Resource requests
175119
type CustomPodResource struct {
176120
// Replica count
177121
Replicas int32 `json:"replicas"`
@@ -191,23 +135,22 @@ type AppWrapperTransition struct {
191135
// Reason
192136
Reason string `json:"reason,omitempty"`
193137

194-
// Phase
138+
// Phase entered
195139
Phase AppWrapperPhase `json:"phase"`
196140
}
197141

198142
//+kubebuilder:object:root=true
199143
//+kubebuilder:subresource:status
200-
//+kubebuilder:printcolumn:name="DISPATCHER",type="string",JSONPath=`.spec.dispatcherStatus.phase`
201-
//+kubebuilder:printcolumn:name="RUNNER",type="string",JSONPath=`.status.runnerStatus.phase`
144+
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=`.status.phase`
145+
//+kubebuilder:printcolumn:name="Restarts",type="integer",JSONPath=`.status.restarts`
146+
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
202147

203-
// AppWrapper object
148+
// AppWrapper is the Schema for the appwrappers API
204149
type AppWrapper struct {
205150
metav1.TypeMeta `json:",inline"`
206151
metav1.ObjectMeta `json:"metadata,omitempty"`
207152

208-
Spec AppWrapperSpec `json:"spec"`
209-
210-
// AppWrapper status
153+
Spec AppWrapperSpec `json:"spec,omitempty"`
211154
Status AppWrapperStatus `json:"status,omitempty"`
212155
}
213156

api/v1beta1/clusterinfo_types.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

api/v1beta1/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1beta1 contains API Schema definitions for the mcad v1beta1 API group
17+
// Package v1beta1 contains API Schema definitions for the workload v1beta1 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=workload.codeflare.dev
2020
package v1beta1

0 commit comments

Comments
 (0)