Skip to content

Commit

Permalink
sdk workflow region change
Browse files Browse the repository at this point in the history
  • Loading branch information
anagarajan97 committed Oct 10, 2023
1 parent 33d122b commit e1fb056
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- .github/workflows/sdk-foundation-models-azure_openai-oai-v2-openai_chat_finetune_pipeline.yml
- sdk/python/dev-requirements.txt
- infra/bootstrapping/**
- sdk/python/setup.sh
- sdk/python/setup_oai_v2.sh
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -41,27 +41,27 @@ jobs:
- name: bootstrap resources
run: |
echo '${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}';
bash bootstrap.sh
bash bootstrap_oai_v2.sh
working-directory: infra/bootstrapping
continue-on-error: false
- name: setup SDK
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
source "${{ github.workspace }}/infra/bootstrapping/init_environment_oai_v2.sh";
bash setup_oai_v2.sh
working-directory: sdk/python
continue-on-error: true
- name: setup-cli
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
source "${{ github.workspace }}/infra/bootstrapping/init_environment_oai_v2.sh";
bash setup_oai_v2.sh
working-directory: cli
continue-on-error: true
- name: run foundation-models/azure_openai/oai-v2/openai_chat_finetune_pipeline.ipynb
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment_oai_v2.sh";
bash "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh" generate_workspace_config "../../.azureml/config.json";
bash "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh" replace_template_values "openai_chat_finetune_pipeline.ipynb";
[ -f "../../.azureml/config" ] && cat "../../.azureml/config";
Expand Down
47 changes: 47 additions & 0 deletions sdk/python/setup_oai_v2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

### If installing a release candidate:
### * Update the "$wheel_url"
### * Uncomment the following block surrounded by {}
### * Comment the ml extension install within <az_ml_install>

# {
# wheel_url='https://azuremlsdktestpypi.blob.core.windows.net/wheels/sdk-cli-v2-public/ml-2.9.0-py3-none-any.whl'
#
# az extension remove -n ml
# if ! az extension add --yes --upgrade --source "$wheel_url"; then
#
# echo "Error: Failed to install release candidate"
# exit 1
# fi
# az version
# unset wheel_url
# }


# <az_ml_install>
az extension add -n ml -y
# </az_ml_install>

## For backward compatibility - running on old subscription
# <set_variables>
GROUP="azureml-examples"
LOCATION="northcentralus"
WORKSPACE="main"
# </set_variables>

# If RESOURCE_GROUP_NAME is empty, the az configure is pending.
RESOURCE_GROUP_NAME=${RESOURCE_GROUP_NAME:-}
if [[ -z "$RESOURCE_GROUP_NAME" ]]
then
echo "No resource group name [RESOURCE_GROUP_NAME] specified, defaulting to ${GROUP}."
# Installing extension temporarily assuming the run is on old subscription
# without bootstrap script.

# <az_configure_defaults>
az configure --defaults group=$GROUP workspace=$WORKSPACE location=$LOCATION
# </az_configure_defaults>
echo "Default resource group set to $GROUP"
else
echo "Workflows are using the new subscription."
fi

0 comments on commit e1fb056

Please sign in to comment.