From acce5619b67b5d77f1b084c94fc009dbf1f8c331 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Tue, 15 Oct 2019 14:33:47 -0600 Subject: [PATCH 1/3] be explicit about ports for workers and servers Signed-off-by: Matt Butcher --- 3.component_model.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/3.component_model.md b/3.component_model.md index 86fae55..9f22f29 100644 --- a/3.component_model.md +++ b/3.component_model.md @@ -135,6 +135,9 @@ A Server is used for long-running, scalable workloads that have a network endpoi - A Server is daemonized. A runtime MUST attempt to restart replicas that exit regardless of error code. - A Server has a network endpoint with an automatically assigned virtual IP address (VIP) and DNS name addressable within the network scope to which the component belongs. +> If a Server does not provide at least one `port` on at least one `container`, implementations SHOULD emit an error. + + ##### Singleton Server Workload type name: `core.oam.dev/v1alpha1.SingletonServer` @@ -143,6 +146,8 @@ A Singleton Server is a special case of the Server workload type that is limited - A Singleton Server is daemonized. A runtime MUST attempt to restart the singleton replica if it exits regardless of error code. - A Singleton Server has a network endpoint with an automatically assigned virtual IP address (VIP) and DNS name addressable within the network scope to which the component belongs. +> If a Singleton Server does not provide at least one `port` on at least one `container`, implementations SHOULD emit an error. + ##### Worker Workload type name: `core.oam.dev/v1alpha1.Worker` @@ -151,6 +156,8 @@ A worker is used for long-running, scalable workloads that do not have a service - An application operator can increase or decrease the number of worker replicas by applying and configuring traits when available. - A worker is daemonized. A runtime MUST attempt to restart replicas that exit regardless of error code. +> If a Worker declares a port, this SHOULD result in a validation error. + ##### Singleton Worker Workload type name: `core.oam.dev/v1alpha1.SingletonWorker` @@ -158,6 +165,7 @@ A singleton worker is a special case of the worker workload type that is limited - Defines a container runtime where at most one replica of the same container may be run at a time. - A singleton worker is daemonized. A runtime MUST attempt to restart the singleton replica if it exits regardless of error code. +> If a Singleton Worker declares a port, this SHOULD result in a validation error. ##### Task Workload type name: `core.oam.dev/v1alpha1.Task` From 3b58e8542577268d61e2491ab1c69fd6c75329d2 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Tue, 15 Oct 2019 14:39:39 -0600 Subject: [PATCH 2/3] Also fix 182 Signed-off-by: Matt Butcher --- 3.component_model.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/3.component_model.md b/3.component_model.md index 9f22f29..3b7385c 100644 --- a/3.component_model.md +++ b/3.component_model.md @@ -156,7 +156,7 @@ A worker is used for long-running, scalable workloads that do not have a service - An application operator can increase or decrease the number of worker replicas by applying and configuring traits when available. - A worker is daemonized. A runtime MUST attempt to restart replicas that exit regardless of error code. -> If a Worker declares a port, this SHOULD result in a validation error. +> If a Worker declares a `port` on any `container`, this SHOULD result in a validation error. ##### Singleton Worker Workload type name: `core.oam.dev/v1alpha1.SingletonWorker` @@ -165,7 +165,7 @@ A singleton worker is a special case of the worker workload type that is limited - Defines a container runtime where at most one replica of the same container may be run at a time. - A singleton worker is daemonized. A runtime MUST attempt to restart the singleton replica if it exits regardless of error code. -> If a Singleton Worker declares a port, this SHOULD result in a validation error. +> If a Singleton Worker declares a `port` on any `container`, this SHOULD result in a validation error. ##### Task Workload type name: `core.oam.dev/v1alpha1.Task` @@ -266,14 +266,16 @@ Resources describe compute resources attached to a runtime. | Attribute | Type | Required | Default Value | Description | |-----------|------|----------|---------------|-------------| -| `cpu` | [`CPU`](#cpu) | Y | | Specifies the attributes of the cpu resource required for the container. | -| `memory` | [`Memory`](#memory) | Y | | Specifies the attributes of the memory resource required for the container. | +| `cpu` | [`CPU`](#cpu) | N | | Specifies the attributes of the cpu resource required for the container. | +| `memory` | [`Memory`](#memory) | N | | Specifies the attributes of the memory resource required for the container. | | `gpu` | [`GPU`](#gpu) | N | | Specifies the attributes of the gpu resources required for the container. | | `volumes` | [`[]Volume`](#volume) | N | | Specifies the attributes of the volumes that the container uses. | | `extended` | [`[]ExtendedResource`](#extendedresource) | N | | Implementation-specific extended resource requirements | For any resource that cannot be satisfied by the underlying platform, the platform MUST return an error and cease deployment. A resource is considered a requirement, and failure to meet that requirement means the runtime MUST NOT deploy the application. For example, if an application requests `1P` of memory, and that amount of memory is not available, the application deployment must fail. Likewise, if an application requires `1` gpu, and the runtime does not provide gpus, the application deployment MUST fail. +If resources are not specified, the underlying platform is free to choose a suitable default. + #### CPU | Attribute | Type | Required | Default Value | Description | From a788271fd74746f421e5984407ee2d43dcca73e6 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Tue, 15 Oct 2019 15:23:01 -0600 Subject: [PATCH 3/3] removed 182 fix, which was surprisingly controversial --- 3.component_model.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/3.component_model.md b/3.component_model.md index 3b7385c..6020e98 100644 --- a/3.component_model.md +++ b/3.component_model.md @@ -266,16 +266,14 @@ Resources describe compute resources attached to a runtime. | Attribute | Type | Required | Default Value | Description | |-----------|------|----------|---------------|-------------| -| `cpu` | [`CPU`](#cpu) | N | | Specifies the attributes of the cpu resource required for the container. | -| `memory` | [`Memory`](#memory) | N | | Specifies the attributes of the memory resource required for the container. | +| `cpu` | [`CPU`](#cpu) | Y | | Specifies the attributes of the cpu resource required for the container. | +| `memory` | [`Memory`](#memory) | Y | | Specifies the attributes of the memory resource required for the container. | | `gpu` | [`GPU`](#gpu) | N | | Specifies the attributes of the gpu resources required for the container. | | `volumes` | [`[]Volume`](#volume) | N | | Specifies the attributes of the volumes that the container uses. | | `extended` | [`[]ExtendedResource`](#extendedresource) | N | | Implementation-specific extended resource requirements | For any resource that cannot be satisfied by the underlying platform, the platform MUST return an error and cease deployment. A resource is considered a requirement, and failure to meet that requirement means the runtime MUST NOT deploy the application. For example, if an application requests `1P` of memory, and that amount of memory is not available, the application deployment must fail. Likewise, if an application requires `1` gpu, and the runtime does not provide gpus, the application deployment MUST fail. -If resources are not specified, the underlying platform is free to choose a suitable default. - #### CPU | Attribute | Type | Required | Default Value | Description |