Azure / GPT-RAG

Sharing the learning along the way we been gathering to enable Azure OpenAI at enterprise scale in a secure manner. GPT-RAG core is a Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/en-us/products/cognitive-services/openai-service
MIT License
773 stars 125 forks source link

grep: invalid option in raipolicies.sh #162

Closed pichuang closed 2 days ago

pichuang commented 3 days ago

grep: invalid option in raipolicies.sh

Expected Behavior

No error output

Current Behavior

$ azd provision

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time.

Subscription: subscription-project-openai (e5c7259b-cf08-4fff-92d4-9a836d986370)
Location: Japan East

  You can view detailed progress in the Azure Portal:
  https://portal.azure.com/#view/HubsExtension/DeploymentDetailsBlade/~/overview/id/%2Fsubscriptions%2Fe5c7259b-cf08-4fff-92d4-9a836d986370%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2F20240702-1719895224

  (✓) Done: Resource group: rg-20240702
  (✓) Done: Application Insights: appins0-g6pclrf6ozgf6
  (✓) Done: App Service plan: appplan0-g6pclrf6ozgf6
  (✓) Done: Key Vault: kv0-g6pclrf6ozgf6
  (✓) Done: Storage account: strag0g6pclrf6ozgf6
  (✓) Done: Search service: search0-g6pclrf6ozgf6
  (✓) Done: Azure Cosmos DB: dbgpt0-g6pclrf6ozgf6
  (✓) Done: Storage account: strag0g6pclrf6ozgf6orc
  (✓) Done: Storage account: strag0g6pclrf6ozgf6ing
  (✓) Done: Cognitive Service: ai0-g6pclrf6ozgf6
  (✓) Done: App Service: webgpt0-g6pclrf6ozgf6
  (✓) Done: Function App: fninges0-g6pclrf6ozgf6
  (✓) Done: Function App: fnorch0-g6pclrf6ozgf6
  (✓) Done: Azure OpenAI: oai0-g6pclrf6ozgf6
RAI Script: Setting up AOAI content filters & blocklist
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
    [-e pattern] [-f file] [--binary-files=value] [--color=when]
    [--context[=num]] [--directories=action] [--label] [--line-buffered]
    [--null] [pattern] [file ...]

SUCCESS: Your application was provisioned in Azure in 1 minute 38 seconds.
You can view the resources created under the resource group rg-20240702 in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/e5c7259b-cf08-4fff-92d4-9a836d986370/resourceGroups/rg-20240702/overview

Possible Solution

Fix https://github.com/Azure/GPT-RAG/blob/main/scripts/rai/raipolicies.sh#L88-L93

Steps to Reproduce

  1. azd auth login
  2. azd up
  3. azd provision

Context (Environment)

Detailed Description

$ azd version
azd version 1.9.3 (commit e1624330dcc7dde440ecc1eda06aac40e68aa0a3)
$ grep -V
grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
$ sw_vers
ProductName:        macOS
ProductVersion:     14.5
BuildVersion:       23F79

Possible Implementation