{"id":17114485,"url":"https://github.com/anthonychu/pycon-build-2024","last_synced_at":"2025-04-13T04:07:00.850Z","repository":{"id":240296304,"uuid":"797076525","full_name":"anthonychu/pycon-build-2024","owner":"anthonychu","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-15T15:04:42.000Z","size":733,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T04:06:57.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthonychu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T06:41:30.000Z","updated_at":"2024-05-23T04:25:05.000Z","dependencies_parsed_at":"2024-05-17T21:24:43.307Z","dependency_job_id":"568dc2ce-5991-4441-a4ff-a03e7f7e7ed4","html_url":"https://github.com/anthonychu/pycon-build-2024","commit_stats":null,"previous_names":["anthonychu/pycon-build-2024"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fpycon-build-2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fpycon-build-2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fpycon-build-2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonychu%2Fpycon-build-2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonychu","download_url":"https://codeload.github.com/anthonychu/pycon-build-2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661705,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:17:19.320Z","updated_at":"2025-04-13T04:07:00.831Z","avatar_url":"https://github.com/anthonychu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n```bash\nRESOURCE_GROUP=demo-may-2024\nLOCATION=westus3\nENVIRONMENT_NAME=demo-may-2024\nACR_NAME=demomay2024\nJOB_NAME=indexer-job\nQDRANT_NAME=qdrantdb\nCHATAPP_NAME=chatapp\nOPENAI_NAME=openai-acapms\nOPENAI_RESOURCE_GROUP_NAME=openai-demo\nSTORAGE_ACCOUNT_NAME=demomay2024\nSESSION_POOL_NAME=code-interpreter\nSESSION_POOL_LOCATION=eastasia\n\naz group create --name $RESOURCE_GROUP --location $LOCATION\n\naz containerapp env create --name $ENVIRONMENT_NAME --resource-group $RESOURCE_GROUP --location $LOCATION \\\n    --enable-dedicated-gpu\n\naz acr create --name $ACR_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --sku Standard --admin-enabled true\n\naz acr build -r $ACR_NAME -t chatapp:1.4 .\n\naz storage account create --name $STORAGE_ACCOUNT_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --sku Standard_LRS\n\nFILE_SHARE_NAME=pdfs\naz storage share create --name $FILE_SHARE_NAME --account-name $STORAGE_ACCOUNT_NAME\n\naz storage file upload --share-name $FILE_SHARE_NAME --source ./more-data/azure-container-apps.pdf --account-name $STORAGE_ACCOUNT_NAME\naz storage file upload --share-name $FILE_SHARE_NAME --source ./more-data/azure-azure-functions.pdf --account-name $STORAGE_ACCOUNT_NAME\n\nSTORAGE_KEY=`az storage account keys list --account-name $STORAGE_ACCOUNT_NAME --query \"[0].value\" -o tsv`\n\naz containerapp env storage set --name $ENVIRONMENT_NAME --resource-group $RESOURCE_GROUP \\\n    --storage-name $STORAGE_ACCOUNT_NAME --access-mode ReadOnly --azure-file-account-key $STORAGE_KEY \\\n    --azure-file-account-name $STORAGE_ACCOUNT_NAME --azure-file-share-name $FILE_SHARE_NAME\n\naz containerapp job create --name $JOB_NAME --resource-group $RESOURCE_GROUP \\\n    --image $ACR_NAME.azurecr.io/chatapp:1.4 --environment $ENVIRONMENT_NAME \\\n    --cpu 2 --memory 4 \\\n    --registry-server $ACR_NAME.azurecr.io \\\n    --trigger-type manual \\\n    --env-vars \"QDRANT_HOST=qdrantdb\" \"QDRANT_PORT=6333\" \\\n    --args \"indexer_job\"\n\naz containerapp job update --name $JOB_NAME --resource-group $RESOURCE_GROUP --yaml ./indexer-job.yaml\n\naz containerapp job start --name $JOB_NAME --resource-group $RESOURCE_GROUP\n\naz containerapp add-on qdrant create \\\n    --environment $ENVIRONMENT_NAME \\\n    --resource-group $RESOURCE_GROUP \\\n    --name $QDRANT_NAME\n\naz containerapp update  \\\n    --resource-group $RESOURCE_GROUP \\\n    --name $QDRANT_NAME \\\n    --min-replicas 1 \\\n    --max-replicas 1\n\nOPENAI_ENDPOINT=`az cognitiveservices account show --name $OPENAI_NAME --resource-group $OPENAI_RESOURCE_GROUP_NAME --query properties.endpoint -o tsv`\n\nOPENAI_RESOURCE_ID=`az cognitiveservices account show --name $OPENAI_NAME --resource-group $OPENAI_RESOURCE_GROUP_NAME --query id -o tsv`\n\n\naz containerapp create --name $CHATAPP_NAME --resource-group $RESOURCE_GROUP \\\n    --image $ACR_NAME.azurecr.io/chatapp:1.4 --environment $ENVIRONMENT_NAME \\\n    --cpu 2 --memory 4 \\\n    --registry-server $ACR_NAME.azurecr.io \\\n    --env-vars \"QDRANT_HOST=qdrantdb\" \"QDRANT_PORT=6333\" \"AZURE_OPENAI_ENDPOINT=https://$OPENAI_NAME.openai.azure.com/\" \"POOL_MANAGEMENT_ENDPOINT=https://eastasia.acasessions.io/subscriptions/30501c6c-81f6-41ac-a388-d29cf43a020d/resourceGroups/demo-may-2024/sessionPools/code-interpreter\" \\\n    --args \"chat_app\" \\\n    --ingress external --target-port 8000 --system-assigned \\\n    --min-replicas 1 --max-replicas 1\n\nCONTAINER_APP_MI_ID=`az containerapp show --name $CHATAPP_NAME --resource-group $RESOURCE_GROUP --query identity.principalId -o tsv`\n\n# assign \"Cognitive Services OpenAI User\" role to container app identity\naz role assignment create --role \"Cognitive Services OpenAI User\" --assignee $CONTAINER_APP_MI_ID --scope $OPENAI_RESOURCE_ID\n\n\naz containerapp sessionpool create \\\n    --name $SESSION_POOL_NAME \\\n    --resource-group $RESOURCE_GROUP \\\n    --location $SESSION_POOL_LOCATION \\\n    --container-type PythonLTS \\\n    --max-sessions 100 \\\n    --cooldown-period 300\n\nPOOL_RESOURCE_ID=`az containerapp sessionpool show --name $SESSION_POOL_NAME --resource-group $RESOURCE_GROUP --query id -o tsv`\n\n# give CLI user access to the session pool\naz role assignment create \\\n    --role \"0fb8eba5-a2bb-4abe-b1c1-49dfad359bb0\" \\\n    --assignee `az account show --query user.name -o tsv` \\\n    --scope $POOL_RESOURCE_ID\n\n# give container app identity access to the session pool\naz role assignment create \\\n    --role \"0fb8eba5-a2bb-4abe-b1c1-49dfad359bb0\" \\\n    --assignee $CONTAINER_APP_MI_ID \\\n    --scope $POOL_RESOURCE_ID\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonychu%2Fpycon-build-2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonychu%2Fpycon-build-2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonychu%2Fpycon-build-2024/lists"}