Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mistral Guide and Assets #3127

Merged
merged 6 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/content/guides/assets/mistral/graph.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
flowchart LR
subgraph root.0[<center>ConcurrencyScheduler<br/>1 selectors</center>]
subgraph root.0_inports[ ]
style root.0_inports fill:none,stroke:none
root.0max_capacity[max_capacity]
end
subgraph root.0_outports[ ]
style root.0_outports fill:none,stroke:none
root.0accept_percentage[accept_percentage]
end
end
root.0_max_capacity_FakeConstantout((2.00))
subgraph root.1[<center>Decider<br/>gte for 0s</center>]
subgraph root.1_inports[ ]
style root.1_inports fill:none,stroke:none
root.1lhs[lhs]
root.1rhs[rhs]
end
subgraph root.1_outports[ ]
style root.1_outports fill:none,stroke:none
root.1output[output]
end
end
root.1_rhs_FakeConstantout((90.00))
subgraph root.2[<center>Alerter<br/>Too many inflight requests/...</center>]
subgraph root.2_inports[ ]
style root.2_inports fill:none,stroke:none
root.2signal[signal]
end
end
root.0accept_percentage --> |ACCEPT_PERCENTAGE| root.1lhs
root.0_max_capacity_FakeConstantout --> root.0max_capacity
root.1output --> |ACCEPT_PERCENTAGE_ALERT| root.2signal
root.1_rhs_FakeConstantout --> root.1rhs
1 change: 1 addition & 0 deletions docs/content/guides/assets/mistral/graph.mmd.md5sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9ca1ad832dcce3be1db8edf82a0979c7
5 changes: 5 additions & 0 deletions docs/content/guides/assets/mistral/graph.mmd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/content/guides/assets/mistral/mistral.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
flowchart LR
classDef Orange fill:#F8773D,stroke:#000000,stroke-width:2px;
classDef Green fill:#56AE89,stroke:#000000,stroke-width:2px;
classDef Red fill:#F13C15,stroke:#000000,stroke-width:1px;
classDef Pink fill:#ffb6c1,stroke:#000000,stroke-width:1px;

TC[\Token Counter/]
class TC Orange

Scheduler
class Scheduler Orange

SDK
class SDK Green

subgraph Aperture_Cloud ["Aperture Cloud"]
Scheduler -- "Counting" --> TC
end
class Aperture_Cloud Green

SDK -- "Schedule Request" --> Scheduler
1 change: 1 addition & 0 deletions docs/content/guides/assets/mistral/mistral.mmd.md5sum
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5df63f64375615e3ec9761cb92b987af
5 changes: 5 additions & 0 deletions docs/content/guides/assets/mistral/mistral.mmd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docs/content/guides/assets/mistral/policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: fluxninja.com/v1alpha1
kind: Policy
metadata:
labels:
fluxninja.com/validate: "true"
name: mistral-concurrency-scheduling
spec:
circuit:
components:
- flow_control:
concurrency_scheduler:
concurrency_limiter:
limit_by_label_key: limit_by_label_key
max_inflight_duration: 60s
in_ports:
max_concurrency:
constant_signal:
value: 2
out_ports:
accept_percentage:
signal_name: ACCEPT_PERCENTAGE
scheduler:
priority_label_key: priority
tokens_label_key: tokens
workload_label_key: workload
selectors:
- control_point: mistral-prompt
- decider:
in_ports:
lhs:
signal_name: ACCEPT_PERCENTAGE
rhs:
constant_signal:
value: 90
operator: gte
out_ports:
output:
signal_name: ACCEPT_PERCENTAGE_ALERT
- alerter:
in_ports:
signal:
signal_name: ACCEPT_PERCENTAGE_ALERT
parameters:
alert_name: Too many inflight requests
evaluation_interval: 1s
resources:
flow_control:
classifiers: []
22 changes: 22 additions & 0 deletions docs/content/guides/assets/mistral/validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

git_root=$(git rev-parse --show-toplevel)

# shellcheck disable=SC1091
source "$git_root"/docs/tools/aperturectl/validate_common.sh

generate_from_values \
values.yaml \
tmp

# copy the generated policy and graph to this (assets) directory so that they can be used in the docs
cp tmp/policies/mistral-concurrency-scheduling-cr.yaml policy.yaml
cp tmp/graphs/mistral-concurrency-scheduling-cr.mmd graph.mmd

# git add the generated policy and graph
"$git_root"/scripts/git_add_safely.sh policy.yaml graph.mmd

# remove the tmp directory
rm -rf tmp
21 changes: 21 additions & 0 deletions docs/content/guides/assets/mistral/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# yaml-language-server: $schema=../../../../../blueprints/concurrency-scheduling/base/gen/definitions.json
blueprint: concurrency-scheduling/base
uri: ../../../../../blueprints
policy:
policy_name: "mistral-concurrency-scheduling"
components: []
concurrency_scheduler:
alerter:
alert_name: "Too many inflight requests"
concurrency_limiter:
max_inflight_duration: "60s"
max_concurrency: 2
scheduler:
priority_label_key: "priority"
tokens_label_key: "tokens"
workload_label_key: "workload"
selectors:
- control_point: "mistral-prompt"
resources:
flow_control:
classifiers: []
Loading