-
Create IP address az network public-ip create --resource-group resources_ml-aks-uks_ml-aks-uks --name pip-ml-aks-uks --sku Standard --allocation-method static --query publicIp.ipAddress -o ts
-
Create a namespace for your ingress resources kubectl create namespace nginx-ingress
-
Add the official stable repository helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo add stable https://charts.helm.sh/stable
helm repo update
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
public async Task<ChromaDbResult> QueryByTextAsync(string queryText) | |
{ | |
try | |
{ | |
var payload = new { parameters = new { query_text = queryText, n_results = 2 } }; | |
string jsonPayload = JsonConvert.SerializeObject(payload); | |
var requestContent = new StringContent(jsonPayload, System.Text.Encoding.UTF8, "application/json"); | |
var response = await _client.PostAsync("query", requestContent); |
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
var url = _configuration.GetValue<string>("AzureOpenAiApi:Endpoint"); | |
var key = _configuration.GetValue<string>("AzureOpenAiApi:SubscriptionKey"); | |
var openAIClient = new OpenAIClient(new Uri(url), new AzureKeyCredential(key)); | |
Response<ChatCompletions> responseWithoutStream = | |
await openAIClient.GetChatCompletionsAsync( | |
new ChatCompletionsOptions() | |
{ | |
Messages = | |
{ |
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
//https://youropenaiinstance.openai.azure.com/ | |
//c# | |
// Note: The Azure OpenAI client library for .NET is in preview. | |
// Install the .NET library via NuGet: dotnet add package Azure.AI.OpenAI --version 1.0.0-beta.5 | |
using Azure; | |
using Azure.AI.OpenAI; | |
OpenAIClient client = new OpenAIClient( | |
new Uri("https://youropenaiinstance.openai.azure.com/"), | |
new AzureKeyCredential(Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"))); |
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
# Deployment | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: chromadb | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: chromadb |
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
# Use the official chromadb image | |
FROM chromadb/chroma:0.4.21 | |
# Set environment variables | |
ENV FLASK_APP=app.py | |
ENV FLASK_RUN_HOST=0.0.0.0 | |
ENV FLASK_RUN_PORT=8000 | |
# Set the working directory | |
WORKDIR /app |
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
from flask import Flask, request | |
from flask_restful import Api, Resource | |
import requests | |
import os | |
import json | |
import traceback | |
import chromadb | |
from openai import AzureOpenAI | |
import chromadb.utils.embedding_functions as embedding_functions |
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
1. Set default context | |
kubectl config set-context --current --namespace=my-namespace | |
2. Exec in to pod | |
kubectl exec -it my-pod -- /bin/sh (may have to exec on cloud cli) | |
Actual repo is here: https://github.com/kubernetes/dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
kubectl apply -f https://gist.githubusercontent.com/dahlsailrunner/bbd453f3bb6259b66c08a70d0908283f/raw/5727723217e2df4b65d8933adf04d009cfb0fe3f/local-dashboard-account.yml
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
/// filters out dependencies like polling queues that are not attached to any larger operation. | |
public class AzureDependencyFilterTelemetryProcessor : ITelemetryProcessor | |
{ | |
private readonly ITelemetryProcessor _inner; | |
public AzureDependencyFilterTelemetryProcessor(ITelemetryProcessor inner) | |
{ | |
_inner = inner; | |
} |
NewerOlder