Skip to content

Commit

Permalink
Redirect std out dev/null (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbreza authored May 13, 2024
1 parent a884608 commit b88aa05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions infra/hooks/postprovision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ azd env get-values > .env
Write-Host "Script execution completed successfully."

Write-Host 'Installing dependencies from "requirements.txt"'
python -m pip install -r contoso_chat/requirements.txt
python -m pip install -r contoso_chat/requirements.txt > $null

# populate data
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/customer_info/create-cosmos-db.ipynb
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/product_info/create-azure-search.ipynb
Write-Host "Populating data ...."
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/customer_info/create-cosmos-db.ipynb > $null
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/product_info/create-azure-search.ipynb > $null
18 changes: 9 additions & 9 deletions infra/hooks/postprovision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ azd env set AZURE_SEARCH_KEY $searchKey
azd env set AZURE_OPENAI_KEY $apiKey
azd env set COSMOS_KEY $cosmosKey

# Set additional environment variables expected by app
# Set additional environment variables expected by app
# TODO: Standardize these and remove need for setting here
azd env set AZURE_OPENAI_API_VERSION 2023-03-15-preview
azd env set AZURE_OPENAI_CHAT_DEPLOYMENT gpt-35-turbo
azd env set AZURE_SEARCH_ENDPOINT $AZURE_SEARCH_ENDPOINT
azd env set AZURE_SEARCH_KEY $AZURE_SEARCH_KEY
azd env set AZURE_SEARCH_KEY $AZURE_SEARCH_KEY

# Output environment variables to .env file using azd env get-values
azd env get-values > .env
azd env get-values >.env

# Create config.json with required Azure AI project config information
echo "{\"subscription_id\": \"$subscriptionId\", \"resource_group\": \"$resourceGroupName\", \"workspace_name\": \"$mlProjectName\"}" > config.json
Expand All @@ -50,15 +50,15 @@ echo "--- ✅ | 1. Post-provisioning - env configured ---"

# Setup to run notebooks
echo 'Installing dependencies from "requirements.txt"'
python -m pip install -r requirements.txt
python -m pip install ipython ipykernel # Install ipython and ipykernel
ipython kernel install --name=python3 --user # Configure the IPython kernel
jupyter kernelspec list # Verify kernelspec list isn't empty
python -m pip install -r requirements.txt > /dev/null
python -m pip install ipython ipykernel > /dev/null # Install ipython and ipykernel
ipython kernel install --name=python3 --user > /dev/null # Configure the IPython kernel
jupyter kernelspec list > /dev/null # Verify kernelspec list isn't empty
echo "--- ✅ | 2. Post-provisioning - ready execute notebooks ---"

echo "Populating data ...."
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/customer_info/create-cosmos-db.ipynb
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/product_info/create-azure-search.ipynb
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/customer_info/create-cosmos-db.ipynb > /dev/null
jupyter nbconvert --execute --to python --ExecutePreprocessor.timeout=-1 data/product_info/create-azure-search.ipynb > /dev/null
echo "--- ✅ | 3. Post-provisioning - populated data ---"

#echo "Running evaluations ...."
Expand Down

0 comments on commit b88aa05

Please sign in to comment.