Skip to content

Commit

Permalink
remove completed label (#189)
Browse files Browse the repository at this point in the history
* remove completed label
* give python test a little extra time

status attributes are immuatable, and this is leading to
bugs elsewhere, so while we are not actively using kubeflow
I am removing this.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Jun 28, 2023
1 parent 24d54d7 commit 73ddf92
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 77 deletions.
5 changes: 0 additions & 5 deletions api/v1alpha1/minicluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ type MiniClusterStatus struct {
Size int32 `json:"size"`
Selector string `json:"selector"`

// Label to indicate that job is completed, comes from Job.Completed
// The user can also look at conditions -> JobFinished
// +optional
Completed bool `json:"completed"`

// The Jobid is set internally to associate to a miniCluster
// This isn't currently in use, we only have one!
Jobid string `json:"jobid"`
Expand Down
5 changes: 0 additions & 5 deletions api/v1alpha1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,6 @@
"maximumSize"
],
"properties": {
"completed": {
"description": "Label to indicate that job is completed, comes from Job.Completed The user can also look at conditions -\u003e JobFinished",
"type": "boolean",
"default": false
},
"conditions": {
"description": "conditions hold the latest Flux Job and MiniCluster states",
"type": "array",
Expand Down
8 changes: 0 additions & 8 deletions api/v1alpha1/zz_generated.openapi.go

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

4 changes: 0 additions & 4 deletions chart/templates/minicluster-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,6 @@ spec:
status:
description: MiniClusterStatus defines the observed state of Flux
properties:
completed:
description: Label to indicate that job is completed, comes from Job.Completed
The user can also look at conditions -> JobFinished
type: boolean
conditions:
description: conditions hold the latest Flux Job and MiniCluster states
items:
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/flux-framework.org_miniclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,6 @@ spec:
status:
description: MiniClusterStatus defines the observed state of Flux
properties:
completed:
description: Label to indicate that job is completed, comes from Job.Completed
The user can also look at conditions -> JobFinished
type: boolean
conditions:
description: conditions hold the latest Flux Job and MiniCluster states
items:
Expand Down
10 changes: 0 additions & 10 deletions controllers/flux/minicluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,6 @@ func (r *MiniClusterReconciler) ensureMiniCluster(
r.Status().Update(ctx, clusterCopy)
}

// Determine if the job is completed, and flag the MiniCluster
if !cluster.Status.Completed {
if jobctrl.IsFinished(mc) {
cluster.Status.Completed = true
clusterCopy := cluster.DeepCopy()
jobctrl.FlagConditionFinished(clusterCopy)
r.Status().Update(ctx, clusterCopy)
}
}

// And we re-queue so the Ready condition triggers next steps!
return ctrl.Result{Requeue: true}, nil
}
Expand Down
4 changes: 0 additions & 4 deletions examples/dist/flux-operator-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,6 @@ spec:
status:
description: MiniClusterStatus defines the observed state of Flux
properties:
completed:
description: Label to indicate that job is completed, comes from Job.Completed
The user can also look at conditions -> JobFinished
type: boolean
conditions:
description: conditions hold the latest Flux Job and MiniCluster states
items:
Expand Down
4 changes: 0 additions & 4 deletions examples/dist/flux-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,6 @@ spec:
status:
description: MiniClusterStatus defines the observed state of Flux
properties:
completed:
description: Label to indicate that job is completed, comes from Job.Completed
The user can also look at conditions -> JobFinished
type: boolean
conditions:
description: conditions hold the latest Flux Job and MiniCluster states
items:
Expand Down
1 change: 0 additions & 1 deletion sdk/python/v1alpha1/docs/MiniClusterStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ MiniClusterStatus defines the observed state of Flux
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**completed** | **bool** | Label to indicate that job is completed, comes from Job.Completed The user can also look at conditions -&gt; JobFinished | [optional] [default to False]
**conditions** | [**list[V1Condition]**](V1Condition.md) | conditions hold the latest Flux Job and MiniCluster states | [optional]
**jobid** | **str** | The Jobid is set internally to associate to a miniCluster This isn&#39;t currently in use, we only have one! | [default to '']
**maximum_size** | **int** | We keep the original size of the MiniCluster request as this is the absolute maximum | [default to 0]
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/v1alpha1/examples/interactive-submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@

# Just call this so we know to wait
# Let's exec commands to run a bunch of jobs!
# This is why we want interactive mod!
# This is why we want interactive mode!
# By default, this selects (and waits for) the broker pod
time.sleep(60)
print("✨️ Submitting jobs!")
time.sleep(5)
for iter in range(0, 5):
res = cli.execute("flux submit sleep %s" % iter)
print(res)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
# By default, this selects (and waits for) the broker pod

print("✨️ Submitting a ton of jobs!")
time.sleep(5)
time.sleep(60)
for iter in range(0, 30):
res = cli.execute("flux submit sleep %s" % iter)
assert res.startswith("ƒ")
Expand Down
30 changes: 1 addition & 29 deletions sdk/python/v1alpha1/fluxoperator/models/mini_cluster_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class MiniClusterStatus(object):
and the value is json key in definition.
"""
openapi_types = {
'completed': 'bool',
'conditions': 'list[V1Condition]',
'jobid': 'str',
'maximum_size': 'int',
Expand All @@ -42,60 +41,33 @@ class MiniClusterStatus(object):
}

attribute_map = {
'completed': 'completed',
'conditions': 'conditions',
'jobid': 'jobid',
'maximum_size': 'maximumSize',
'selector': 'selector',
'size': 'size'
}

def __init__(self, completed=False, conditions=None, jobid='', maximum_size=0, selector='', size=0, local_vars_configuration=None): # noqa: E501
def __init__(self, conditions=None, jobid='', maximum_size=0, selector='', size=0, local_vars_configuration=None): # noqa: E501
"""MiniClusterStatus - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration.get_default_copy()
self.local_vars_configuration = local_vars_configuration

self._completed = None
self._conditions = None
self._jobid = None
self._maximum_size = None
self._selector = None
self._size = None
self.discriminator = None

if completed is not None:
self.completed = completed
if conditions is not None:
self.conditions = conditions
self.jobid = jobid
self.maximum_size = maximum_size
self.selector = selector
self.size = size

@property
def completed(self):
"""Gets the completed of this MiniClusterStatus. # noqa: E501
Label to indicate that job is completed, comes from Job.Completed The user can also look at conditions -> JobFinished # noqa: E501
:return: The completed of this MiniClusterStatus. # noqa: E501
:rtype: bool
"""
return self._completed

@completed.setter
def completed(self, completed):
"""Sets the completed of this MiniClusterStatus.
Label to indicate that job is completed, comes from Job.Completed The user can also look at conditions -> JobFinished # noqa: E501
:param completed: The completed of this MiniClusterStatus. # noqa: E501
:type completed: bool
"""

self._completed = completed

@property
def conditions(self):
"""Gets the conditions of this MiniClusterStatus. # noqa: E501
Expand Down

0 comments on commit 73ddf92

Please sign in to comment.