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 3 commits
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
1 change: 0 additions & 1 deletion docs/content/guides/assets/mistral/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ spec:
- flow_control:
concurrency_scheduler:
concurrency_limiter:
limit_by_label_key: limit_by_label_key
max_inflight_duration: 60s
in_ports:
max_concurrency:
Expand Down
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: []
2 changes: 1 addition & 1 deletion docs/content/guides/concurrency-quota-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

Concurrency quota management, also called concurrency scheduling, is a
sophisticated technique that allows effective management of concurrent requests.
With this technique services can limit the number of concurrent API calls to

Check warning on line 35 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 A comma might be missing here. (AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA) Suggestions: `technique,` Rule: https://community.languagetool.org/rule/show/AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA?lang=en-US Category: MISC Raw Output: docs/content/guides/concurrency-quota-management.md:35:10: A comma might be missing here. (AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA) Suggestions: `technique,` Rule: https://community.languagetool.org/rule/show/AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA?lang=en-US Category: MISC
alleviate the load on the system.

When service limits are reached, Aperture Cloud can queue incoming requests and
Expand All @@ -55,7 +55,7 @@
of which is defined by its priority and weight. This classification is crucial
for the request scheduling process.

The scheduler priorities request admission based the priority and weight

Check warning on line 58 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Possible missing preposition found. (AI_HYDRA_LEO_MISSING_TO) Suggestions: `to the` Rule: https://community.languagetool.org/rule/show/AI_HYDRA_LEO_MISSING_TO?lang=en-US Category: MISC Raw Output: docs/content/guides/concurrency-quota-management.md:58:49: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_TO) Suggestions: `to the` Rule: https://community.languagetool.org/rule/show/AI_HYDRA_LEO_MISSING_TO?lang=en-US Category: MISC
assigned to the corresponding workload. This mechanism ensures that
high-priority requests are handled appropriately even under high load.

Expand All @@ -70,7 +70,7 @@

## Concurrency Scheduling with Aperture SDK

The first step to using the Aperture SDK is to import and set up Aperture

Check warning on line 73 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 You might be missing the article “the” here. (AI_EN_LECTOR_MISSING_DETERMINER_THE) Suggestions: `the Aperture` Rule: https://community.languagetool.org/rule/show/AI_EN_LECTOR_MISSING_DETERMINER_THE?lang=en-US Category: MISC Raw Output: docs/content/guides/concurrency-quota-management.md:73:65: You might be missing the article “the” here. (AI_EN_LECTOR_MISSING_DETERMINER_THE) Suggestions: `the Aperture` Rule: https://community.languagetool.org/rule/show/AI_EN_LECTOR_MISSING_DETERMINER_THE?lang=en-US Category: MISC
Client:

```mdx-code-block
Expand Down Expand Up @@ -146,23 +146,23 @@
```

Navigate to the `Policies` tab on the sidebar menu, and select `Create Policy`
in the upper right corner. Next, choose the Request Prioritization blueprint,

Check warning on line 149 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Consider adding a hyphen. (TOP_LEFT_CORNER[1]) Suggestions: `upper-right` Rule: https://community.languagetool.org/rule/show/TOP_LEFT_CORNER?lang=en-US&subId=1 Category: COMPOUNDING Raw Output: docs/content/guides/concurrency-quota-management.md:149:7: Consider adding a hyphen. (TOP_LEFT_CORNER[1]) Suggestions: `upper-right` Rule: https://community.languagetool.org/rule/show/TOP_LEFT_CORNER?lang=en-US&subId=1 Category: COMPOUNDING
and from the drop-down options select Concurrency based. Now, complete the form
with these specific values:

1. `Policy Name`: Unique for each policy, this field can be used to define

Check warning on line 153 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:153:16: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
policies tailored for different use cases. Set the policy name to
`concurrency-scheduling-test`.
2. `Limit by label key`: Determines the specific label key used for concurrency

Check warning on line 156 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:156:23: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
limits. We'll use `user_id` as an example.
3. `Max inflight duration`: Configures the time duration after which flow is

Check warning on line 158 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:158:26: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
assumed to have ended in case the end call gets missed. We'll set it to `60s`
as an example.
4. `Max concurrency`: Configures the maximum number of concurrent requests that

Check warning on line 161 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:161:20: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
a service can take. We'll set it to `20` as an example.
5. `Priority label key`: This field specifies the label that is used to

Check warning on line 163 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:163:23: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
determine the priority. We will leave the label as it is.
6. `Tokens label key`: This field specifies the label that is used to determine

Check warning on line 165 in docs/content/guides/concurrency-quota-management.md

View workflow job for this annotation

GitHub Actions / languagetool

[LanguageTool] reported by reviewdog 🐶 Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION Raw Output: docs/content/guides/concurrency-quota-management.md:165:21: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION[1]) Suggestions: `` Rule: https://community.languagetool.org/rule/show/UNLIKELY_OPENING_PUNCTUATION?lang=en-US&subId=1 Category: PUNCTUATION
tokens. We will leave the label as it is.
7. `Workload label key`: This field specifies the label that is used to
determine the workload. We will leave the label as it is.
Expand Down Expand Up @@ -249,7 +249,7 @@
menu. Copy and enter both your Organization address and API Key to establish a
connection between the SDK and Aperture Cloud.

## Monitoring concurrency Scheduling Policy
## Monitoring Concurrency Scheduling Policy

After running the example for a few minutes, you can review the telemetry data
in the Aperture Cloud UI. Navigate to the Aperture Cloud UI, and click the
Expand Down
Loading
Loading