Skip to content

Commit

Permalink
[YUNIKORN-2049] Fix incorrect placement rule examples (apache#691)
Browse files Browse the repository at this point in the history
Closes: apache#691

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
brandboat authored and wilfred-s committed Oct 26, 2023
1 parent 4f82e93 commit e05f48b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 30 deletions.
10 changes: 5 additions & 5 deletions deployments/examples/placements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ The sleep pod is described in the example file and the partition is provided in

## How to adopt the queues in `config.yaml`
Before deploying the pods, make sure that the data in the `yunikorn-configs` configmap is correct.
For example, `queue.yaml` in the `yunikorn-configs` configmap should be updated before starting fixed example.
For example, `queues.yaml` in the `yunikorn-configs` configmap should be updated before starting fixed example.
`yunikorn-configs` configmap should contains following information.
---
**_NOTE:_**
`queue.yaml` should be __full__ queue config and then legal configuration would be updated to Yunikorn.
---

> **_NOTE:_**
> `queues.yaml` should be __full__ queue config and then legal configuration would be updated to Yunikorn.
```
yunikornDefaults:
queues.yaml: |
Expand Down
5 changes: 2 additions & 3 deletions deployments/examples/placements/fixed/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Update this queue yaml to the yunikorn-configs configmap before trying this example.
queue.yaml: |
# Update the queues.yaml to the yunikorn-configs configmap before trying this example.
queues.yaml: |
partitions:
- name: default
placementrules:
Expand All @@ -27,4 +27,3 @@ queue.yaml: |
submitacl: '*'
queues:
- name: last_resort
6 changes: 3 additions & 3 deletions deployments/examples/placements/fixed/fixed_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ kind: Pod
metadata:
labels:
app: sleep
applicationId: "prvoided-rule-example01"
applicationId: "fixed-rule-example01"
queue: "my_special_queue"
yunikorn.apache.org/username: developer
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"developer\"}"
name: task0
spec:
schedulerName: yunikorn
Expand All @@ -34,4 +35,3 @@ spec:
requests:
cpu: "100m"
memory: "500M"

5 changes: 2 additions & 3 deletions deployments/examples/placements/provided/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Update this queue yaml to the yunikorn-configs configmap before trying this example.
queue.yaml: |
# Update the queues.yaml to the yunikorn-configs configmap before trying this example.
queues.yaml: |
partitions:
- name: default
placementrules:
Expand All @@ -28,4 +28,3 @@ queue.yaml: |
queues:
- name: root
submitacl: '*'
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ metadata:
app: sleep
applicationId: "prvoided-rule-example01"
queue: "my_special_queue"
yunikorn.apache.org/username: "developer"
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"developer\"}"
name: task0
spec:
schedulerName: yunikorn
Expand All @@ -34,4 +35,3 @@ spec:
requests:
cpu: "100m"
memory: "500M"

5 changes: 2 additions & 3 deletions deployments/examples/placements/tag/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Update this queue yaml to the yunikorn-configs configmap before trying this example.
queue.yaml: |
# Update the queues.yaml to the yunikorn-configs configmap before trying this example.
queues.yaml: |
partitions:
- name: default
placementrules:
Expand All @@ -26,4 +26,3 @@ queue.yaml: |
queues:
- name: root
submitacl: '*'
11 changes: 6 additions & 5 deletions deployments/examples/placements/tag/tag_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ kind: Pod
metadata:
labels:
app: sleep
applicationId: "prvoided-rule-example01"
yunikorn.apache.org/username: developer
applicationId: "tag-rule-example01"
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"developer\"}"
name: task0
spec:
schedulerName: yunikorn
Expand All @@ -40,8 +41,9 @@ metadata:
namespace: testing
labels:
app: sleep
applicationId: "prvoided-rule-example02"
yunikorn.apache.org/username: developer
applicationId: "tag-rule-example02"
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"developer\"}"
name: task1
spec:
schedulerName: yunikorn
Expand All @@ -53,4 +55,3 @@ spec:
requests:
cpu: "100m"
memory: "500M"

5 changes: 2 additions & 3 deletions deployments/examples/placements/username/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Update this queue yaml to the yunikorn-configs configmap before trying this example.
queue.yaml: |
# Update the queues.yaml to the yunikorn-configs configmap before trying this example.
queues.yaml: |
partitions:
- name: default
placementrules:
Expand All @@ -27,4 +27,3 @@ queue.yaml: |
submitacl: '*'
queues:
- name: finance_dot_test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ metadata:
labels:
app: sleep
applicationId: "username-rule-example01"
yunikorn.apache.org/username: finance.test
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"finance.test\"}"
name: task0
spec:
schedulerName: yunikorn
Expand All @@ -40,7 +41,8 @@ metadata:
labels:
app: sleep
applicationId: "username-rule-example02"
yunikorn.apache.org/username: developer
annotations:
yunikorn.apache.org/user.info: "{\"user\": \"developer\"}"
name: task1
spec:
schedulerName: yunikorn
Expand All @@ -52,4 +54,3 @@ spec:
requests:
cpu: "100m"
memory: "500M"

0 comments on commit e05f48b

Please sign in to comment.