Skip to content

Commit

Permalink
added aihub
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jan 25, 2024
1 parent 97cd35b commit f023211
Show file tree
Hide file tree
Showing 44 changed files with 1,591 additions and 413 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: build

on:
push:
branches:
- main
- aihub
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: aihub-prepdocs

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.x'
include-prerelease: true

- name: Setup MinVer
run: |
dotnet tool install --global minver-cli --version 4.3.0
- name: Calculate Version
run: |
echo "MINVERVERSIONOVERRIDE=$($HOME/.dotnet/tools/minver -t v. -m 1.0 -d preview)" >> $GITHUB_ENV
- name: Login to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Lower case REPO
run: |
echo "GITHUB_REPOSITORY_LOWER_CASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./scripts/
file: ./scripts/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/${{ env.IMAGE_NAME }}:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta.outputs.labels }}

4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "azure-search-openai-demo"]
path = azure-search-openai-demo
url = https://github.com/cmendible/azure-search-openai-demo.git
branch = k8s
1 change: 1 addition & 0 deletions azure-search-openai-demo
134 changes: 67 additions & 67 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 1 addition & 36 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,4 @@ terraform apply

## Manual steps

> This is temporal
Clone the GitHub repository [cmendible/azure-search-openai-demo](https://github.com/cmendible/azure-search-openai-demo) and run the following commands to deploy the Azure Search Index and upload the sample documents:

```bash
git clone https://github.com/cmendible/azure-search-openai-demo.git
cd azure-search-openai-demo
git checkout k8s

export AZURE_PRINCIPAL_ID="<principal id>"
export AZURE_RESOURCE_GROUP="<resource group>"
export AZURE_SUBSCRIPTION_ID="<subscription id>"
export AZURE_TENANT_ID="<azure tenant id>"
export AZURE_STORAGE_ACCOUNT="<storage account name>"
export AZURE_STORAGE_CONTAINER="content"
export AZURE_SEARCH_SERVICE="<search service name>"
export OPENAI_HOST="azure"
export AZURE_OPENAI_SERVICE="<openai service name>"
export OPENAI_API_KEY=""
export OPENAI_ORGANIZATION=""
export AZURE_OPENAI_EMB_DEPLOYMENT="text-embedding-ada-002"
export AZURE_OPENAI_EMB_MODEL_NAME="text-embedding-ada-002"
export AZURE_SEARCH_INDEX="gptkbindex"
```

Login to Azure:

```bash
azd auth login --client-id <client-id> --client-secret <client-password> --tenant-id <tenant-id>
```

Deploy the Azure Search Index and upload the sample documents:

```bash
./scripts/prepdocs.sh
```
TODO: Describe these steps
Loading

0 comments on commit f023211

Please sign in to comment.