-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Port over draft PR for OpenAI * Fixes to get OpenAI to install * Temporary hack fix for the privatelink URLS for openai * Use forked repo instead of the hack * Re-add private DNS to list * Change github URL temporarily in openai terraform as well * Parameterise OpenAI model name and version (locals for now but should be vars) * Fix private DNS links and add public access variable * Fix template schema * Open AI Model and version configurable * Terraform format * Revert back to microsoft environment configuration with new version * Remove commented code * Make parameters updateable and output the deployment id * Update porter file * Bump core version * More version bumps and documentation * Some fixes based on linting results * Remove tag lifecycle from the OpenAI deployment as it is not supported * Add tags to OpenAI instance
- Loading branch information
Showing
25 changed files
with
531 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.10.6" | ||
__version__ = "0.10.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# OpenAI Workspace Service | ||
|
||
See: [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview) | ||
|
||
## Prerequisites | ||
|
||
- [A base workspace deployed](../workspaces/base.md) | ||
|
||
- The OpenAI workspace service container image needs building and pushing: | ||
|
||
`make workspace_service_bundle BUNDLE=openai` | ||
|
||
## Authenticating | ||
|
||
1. The open AI domain and deployment id can be found from the details tab. | ||
2. When communicating with the API, an "api_key" is required. This can be found in the Key Vault. | ||
|
||
## Properties | ||
- `is_exposed_externally` - If `True`, the OpenAI workspace is accessible from outside of the workspace virtual network. | ||
- `openai_model` - The model to use for the OpenAI deployment `<model name> | <model version>`. The default is `gpt-35-turbo | 0301`. | ||
- Important note: Models are subject to different quota and region availability and the deployment may fail if you don't have the correct quota. | ||
Please review this link on current limits and how to request increases: [Open AI Quotas](https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ID="__CHANGE_ME__" | ||
WORKSPACE_ID="__CHANGE_ME__" | ||
IS_EXPOSED_EXTERNALLY="__CHANGE_ME__" | ||
OPENAI_MODEL="__CHANGE_ME__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# syntax=docker/dockerfile-upstream:1.4.0 | ||
FROM --platform=linux/amd64 debian:bullseye-slim | ||
|
||
# PORTER_INIT | ||
|
||
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache | ||
|
||
# Git is required for terraform_azurerm_environment_configuration | ||
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \ | ||
apt-get update && apt-get install -y git --no-install-recommends | ||
|
||
# PORTER_MIXINS | ||
|
||
# Use the BUNDLE_DIR build argument to copy files into the bundle | ||
COPY --link . ${BUNDLE_DIR}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"schemaType": "ParameterSet", | ||
"schemaVersion": "1.0.0", | ||
"namespace": "", | ||
"name": "tre-workspace-service-openai", | ||
"parameters": [ | ||
{ | ||
"name": "tre_id", | ||
"source": { | ||
"env": "TRE_ID" | ||
} | ||
}, | ||
{ | ||
"name": "id", | ||
"source": { | ||
"env": "ID" | ||
} | ||
}, | ||
{ | ||
"name": "tfstate_container_name", | ||
"source": { | ||
"env": "TERRAFORM_STATE_CONTAINER_NAME" | ||
} | ||
}, | ||
{ | ||
"name": "tfstate_resource_group_name", | ||
"source": { | ||
"env": "MGMT_RESOURCE_GROUP_NAME" | ||
} | ||
}, | ||
{ | ||
"name": "tfstate_storage_account_name", | ||
"source": { | ||
"env": "MGMT_STORAGE_ACCOUNT_NAME" | ||
} | ||
}, | ||
{ | ||
"name": "workspace_id", | ||
"source": { | ||
"env": "WORKSPACE_ID" | ||
} | ||
}, | ||
{ | ||
"name": "arm_environment", | ||
"source": { | ||
"env": "ARM_ENVIRONMENT" | ||
} | ||
}, | ||
{ | ||
"name": "is_exposed_externally", | ||
"source": { | ||
"env": "IS_EXPOSED_EXTERNALLY" | ||
} | ||
}, | ||
{ | ||
"name": "openai_model", | ||
"source": { | ||
"env": "OPENAI_MODEL" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
--- | ||
schemaVersion: 1.0.0 | ||
name: tre-workspace-service-openai | ||
version: 1.0.0 | ||
description: "An OpenAI workspace service" | ||
registry: azuretre | ||
dockerfile: Dockerfile.tmpl | ||
|
||
credentials: | ||
- name: azure_tenant_id | ||
env: ARM_TENANT_ID | ||
- name: azure_subscription_id | ||
env: ARM_SUBSCRIPTION_ID | ||
- name: azure_client_id | ||
env: ARM_CLIENT_ID | ||
- name: azure_client_secret | ||
env: ARM_CLIENT_SECRET | ||
parameters: | ||
- name: workspace_id | ||
type: string | ||
- name: tre_id | ||
type: string | ||
|
||
# the following are added automatically by the resource processor | ||
- name: id | ||
type: string | ||
description: "Resource ID" | ||
env: id | ||
- name: tfstate_resource_group_name | ||
type: string | ||
description: "Resource group containing the Terraform state storage account" | ||
- name: tfstate_storage_account_name | ||
type: string | ||
description: "The name of the Terraform state storage account" | ||
- name: tfstate_container_name | ||
env: tfstate_container_name | ||
type: string | ||
default: "tfstate" | ||
description: "The name of the Terraform state storage container" | ||
- name: arm_use_msi | ||
env: ARM_USE_MSI | ||
type: boolean | ||
default: false | ||
- name: arm_environment | ||
env: ARM_ENVIRONMENT | ||
type: string | ||
default: "public" | ||
- name: is_exposed_externally | ||
env: IS_EXPOSED_EXTERNALLY | ||
type: boolean | ||
- name: openai_model | ||
env: OPENAI_MODEL | ||
type: string | ||
|
||
mixins: | ||
- exec | ||
- terraform: | ||
clientVersion: 1.3.6 | ||
|
||
outputs: | ||
- name: openai_fqdn | ||
type: string | ||
applyTo: | ||
- install | ||
- upgrade | ||
- name: openai_deployment_id | ||
type: string | ||
applyTo: | ||
- install | ||
- upgrade | ||
|
||
install: | ||
- terraform: | ||
description: "Deploy OpenAI workspace service" | ||
vars: | ||
workspace_id: ${ bundle.parameters.workspace_id } | ||
tre_id: ${ bundle.parameters.tre_id } | ||
tre_resource_id: ${ bundle.parameters.id } | ||
arm_environment: ${ bundle.parameters.arm_environment } | ||
is_exposed_externally: ${ bundle.parameters.is_exposed_externally } | ||
openai_model: ${ bundle.parameters.openai_model } | ||
backendConfig: | ||
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } | ||
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } | ||
container_name: ${ bundle.parameters.tfstate_container_name } | ||
key: tre-workspace-service-openai-${ bundle.parameters.id } | ||
outputs: | ||
- name: openai_fqdn | ||
- name: openai_deployment_id | ||
upgrade: | ||
- terraform: | ||
description: "Upgrade OpenAI workspace service" | ||
vars: | ||
workspace_id: ${ bundle.parameters.workspace_id } | ||
tre_id: ${ bundle.parameters.tre_id } | ||
tre_resource_id: ${ bundle.parameters.id } | ||
arm_environment: ${ bundle.parameters.arm_environment } | ||
is_exposed_externally: ${ bundle.parameters.is_exposed_externally } | ||
openai_model: ${ bundle.parameters.openai_model } | ||
backendConfig: | ||
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } | ||
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } | ||
container_name: ${ bundle.parameters.tfstate_container_name } | ||
key: tre-workspace-service-openai-${ bundle.parameters.id } | ||
outputs: | ||
- name: openai_fqdn | ||
- name: openai_deployment_id | ||
uninstall: | ||
- terraform: | ||
description: "Tear down OpenAI workspace service" | ||
vars: | ||
workspace_id: ${ bundle.parameters.workspace_id } | ||
tre_id: ${ bundle.parameters.tre_id } | ||
tre_resource_id: ${ bundle.parameters.id } | ||
arm_environment: ${ bundle.parameters.arm_environment } | ||
is_exposed_externally: ${ bundle.parameters.is_exposed_externally } | ||
openai_model: ${ bundle.parameters.openai_model } | ||
backendConfig: | ||
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } | ||
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } | ||
container_name: ${ bundle.parameters.tfstate_container_name } | ||
key: tre-workspace-service-openai-${ bundle.parameters.id } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/sql/template_schema.json", | ||
"type": "object", | ||
"title": "OpenAI Workspace Service", | ||
"description": "Provides OpenAI within the workspace", | ||
"required": [], | ||
"properties": { | ||
"display_name": { | ||
"type": "string", | ||
"title": "Name for the workspace service", | ||
"description": "The name of the workspace service to be displayed to users", | ||
"default": "Azure OpenAI Service", | ||
"updateable": true | ||
}, | ||
"description": { | ||
"type": "string", | ||
"title": "Description of the workspace service", | ||
"description": "Description of the workspace service", | ||
"default": "Build your own copilot and generative AI applications", | ||
"updateable": true | ||
}, | ||
"overview": { | ||
"type": "string", | ||
"title": "Workspace Service Overview", | ||
"description": "Long form description of the workspace service, in markdown syntax", | ||
"default": "Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-4, GPT-4 Turbo with Vision, GPT-3.5-Turbo, and Embeddings model series. For more information, see the [Azure OpenAI Service documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview).", | ||
"updateable": true | ||
}, | ||
"is_exposed_externally": { | ||
"$id": "#/properties/is_exposed_externally", | ||
"type": "boolean", | ||
"title": "Expose externally", | ||
"description": "Should the OpenAI instance be publicly accessible?", | ||
"default": false, | ||
"updateable": true | ||
}, | ||
"openai_model": { | ||
"$id": "#/properties/openai_model", | ||
"type": "string", | ||
"title": "OpenAI Model", | ||
"description": "Which OpenAI Model should be used? (be mindful of subscription limits)", | ||
"enum": [ | ||
"gpt-35-turbo | 0301", | ||
"gpt-35-turbo | 1106", | ||
"gpt-35-turbo | 0163", | ||
"gpt-35-turbo | 0125", | ||
"gpt-4 | 0613", | ||
"gpt-4 | turbo-2024-04-09", | ||
"gpt-4o | 2024-05-13" | ||
], | ||
"default": "gpt-35-turbo | 0301", | ||
"updateable": true | ||
} | ||
} | ||
} |
Oops, something went wrong.