Skip to content

Commit

Permalink
Merge branch 'main' into fix/pod-info-decimal-precision
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh0728 authored Nov 21, 2024
2 parents 8b8ea70 + c5afc90 commit 66dadc1
Show file tree
Hide file tree
Showing 51 changed files with 1,289 additions and 1,024 deletions.
11 changes: 8 additions & 3 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20922,8 +20922,13 @@
"io.numaproj.numaflow.v1alpha1.Lifecycle": {
"properties": {
"deleteGracePeriodSeconds": {
"description": "DeleteGracePeriodSeconds used to delete pipeline gracefully",
"format": "int32",
"description": "DeleteGracePeriodSeconds used to delete pipeline gracefully Deprecated: Use DeletionGracePeriodSeconds instead",
"format": "int64",
"type": "integer"
},
"deletionGracePeriodSeconds": {
"description": "DeletionGracePeriodSeconds used to delete pipeline gracefully",
"format": "int64",
"type": "integer"
},
"desiredPhase": {
Expand All @@ -20932,7 +20937,7 @@
},
"pauseGracePeriodSeconds": {
"description": "PauseGracePeriodSeconds used to pause pipeline gracefully",
"format": "int32",
"format": "int64",
"type": "integer"
}
},
Expand Down
11 changes: 8 additions & 3 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20918,9 +20918,14 @@
"type": "object",
"properties": {
"deleteGracePeriodSeconds": {
"description": "DeleteGracePeriodSeconds used to delete pipeline gracefully",
"description": "DeleteGracePeriodSeconds used to delete pipeline gracefully Deprecated: Use DeletionGracePeriodSeconds instead",
"type": "integer",
"format": "int32"
"format": "int64"
},
"deletionGracePeriodSeconds": {
"description": "DeletionGracePeriodSeconds used to delete pipeline gracefully",
"type": "integer",
"format": "int64"
},
"desiredPhase": {
"description": "DesiredPhase used to bring the pipeline from current phase to desired phase",
Expand All @@ -20929,7 +20934,7 @@
"pauseGracePeriodSeconds": {
"description": "PauseGracePeriodSeconds used to pause pipeline gracefully",
"type": "integer",
"format": "int32"
"format": "int64"
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ spec:
properties:
deleteGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
deletionGracePeriodSeconds:
default: 30
format: int64
type: integer
desiredPhase:
default: Running
Expand All @@ -122,7 +126,7 @@ spec:
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
type: object
limits:
Expand Down
8 changes: 6 additions & 2 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9846,7 +9846,11 @@ spec:
properties:
deleteGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
deletionGracePeriodSeconds:
default: 30
format: int64
type: integer
desiredPhase:
default: Running
Expand All @@ -9860,7 +9864,7 @@ spec:
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
type: object
limits:
Expand Down
8 changes: 6 additions & 2 deletions config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9846,7 +9846,11 @@ spec:
properties:
deleteGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
deletionGracePeriodSeconds:
default: 30
format: int64
type: integer
desiredPhase:
default: Running
Expand All @@ -9860,7 +9864,7 @@ spec:
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
format: int64
type: integer
type: object
limits:
Expand Down
26 changes: 23 additions & 3 deletions docs/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5497,15 +5497,15 @@ Description

<td>

<code>deleteGracePeriodSeconds</code></br> <em> int32 </em>
<code>deletionGracePeriodSeconds</code></br> <em> int64 </em>
</td>

<td>

<em>(Optional)</em>
<p>

DeleteGracePeriodSeconds used to delete pipeline gracefully
DeletionGracePeriodSeconds used to delete pipeline gracefully
</p>

</td>
Expand Down Expand Up @@ -5538,7 +5538,7 @@ phase

<td>

<code>pauseGracePeriodSeconds</code></br> <em> int32 </em>
<code>pauseGracePeriodSeconds</code></br> <em> int64 </em>
</td>

<td>
Expand All @@ -5553,6 +5553,26 @@ PauseGracePeriodSeconds used to pause pipeline gracefully

</tr>

<tr>

<td>

<code>deleteGracePeriodSeconds</code></br> <em> int64 </em>
</td>

<td>

<em>(Optional)</em>
<p>

DeleteGracePeriodSeconds used to delete pipeline gracefully Deprecated:
Use DeletionGracePeriodSeconds instead
</p>

</td>

</tr>

</tbody>

</table>
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/reference/pipeline-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ The command below will bring the pipeline back to `Running` status.

## Delete a Pipeline

When deleting a pipeline, before terminating all the pods, it will try to wait for all the backlog messages that have already been ingested into the pipeline to be processed. However, it will not wait forever, if the backlog is too large, it will terminate the pods after `terminationGracePeriodSeconds`, which defaults to 30, and can be customized by setting `spec.lifecycle.terminationGracePeriodSeconds`.
When deleting a pipeline, before terminating all the pods, it will try to wait for all the backlog messages that have already been ingested into the pipeline to be processed. However, it will not wait forever, if the backlog is too large, it will terminate the pods after `deletionGracePeriodSeconds`, which defaults to 30, and can be customized by setting `spec.lifecycle.deletionGracePeriodSeconds`.
2 changes: 1 addition & 1 deletion examples/21-simple-mono-vertex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
sink:
udsink:
container:
image: quay.io/numaio/numaflow-rs/sink-log:stable
image: quay.io/numaio/numaflow-rs/sink-log:stable
10 changes: 9 additions & 1 deletion pkg/apis/numaflow/v1alpha1/container_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ limitations under the License.

package v1alpha1

import corev1 "k8s.io/api/core/v1"
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/ptr"
)

type containerBuilder corev1.Container

Expand Down Expand Up @@ -85,6 +88,11 @@ func (b containerBuilder) resources(x corev1.ResourceRequirements) containerBuil
return b
}

func (b containerBuilder) asSidecar() containerBuilder {
b.RestartPolicy = ptr.To[corev1.ContainerRestartPolicy](corev1.ContainerRestartPolicyAlways)
return b
}

func (b containerBuilder) build() corev1.Container {
return corev1.Container(b)
}
3 changes: 3 additions & 0 deletions pkg/apis/numaflow/v1alpha1/container_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
resource "k8s.io/apimachinery/pkg/api/resource"
"k8s.io/utils/ptr"
)

var (
Expand Down Expand Up @@ -49,6 +50,7 @@ func Test_containerBuilder(t *testing.T) {
appendEnv(corev1.EnvVar{
Name: "env", Value: "value"}).
appendPorts(corev1.ContainerPort{Name: "port", ContainerPort: 8080}).
asSidecar().
build()
assert.Equal(t, "numa", c.Name)
assert.Len(t, c.VolumeMounts, 1)
Expand All @@ -58,4 +60,5 @@ func Test_containerBuilder(t *testing.T) {
assert.Equal(t, corev1.PullIfNotPresent, c.ImagePullPolicy)
assert.Equal(t, []corev1.EnvVar{{Name: "env", Value: "value"}}, c.Env)
assert.Equal(t, []corev1.ContainerPort{{Name: "port", ContainerPort: 8080}}, c.Ports)
assert.Equal(t, ptr.To[corev1.ContainerRestartPolicy](corev1.ContainerRestartPolicyAlways), c.RestartPolicy)
}
3 changes: 2 additions & 1 deletion pkg/apis/numaflow/v1alpha1/container_supplier.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ type getContainerReq struct {
}

type containerSupplier interface {
getContainers(req getContainerReq) ([]corev1.Container, error)
// getContainers returns the sidecar containers and main containers for the vertex.
getContainers(req getContainerReq) ([]corev1.Container, []corev1.Container, error)
}
Loading

0 comments on commit 66dadc1

Please sign in to comment.