autogen/docs/github-flow-getting-started.md
Kosta Petan d6b917faf4 Add service to enable github issues workflow (#1)
* big bang gitub workflows

* add missing settings in local.settings.json

* config refactor

* fix devlead plan response

* swap cosmos to table storage for metadata storage

* unify config via options

* azd-ify WIP

* add qdrant bicep WIP

* working azd provision setup

* consolidate SK version in projects

* replace localhost :)

* add fqdn to options

* httpclient fixes

* add managed identity to the function and assign contrib role

* qdrant endpoint setting

* add container instances cleanup code + wait on termination to upload to Github

* formatting fixes

* add tables in bicep

* local getting started WIP

* add azure setup instructions

* add the load-waf bits

* docs WIP

---------

Co-authored-by: Kosta Petan <Kosta.Petan@microsoft.com>
2023-08-28 20:57:56 +02:00

3.9 KiB

Prerequisites

How do I setup the Github app?

  • Register a Github app.
  • Setup the following permissions
    • Repository
      • Contents - read and write
      • Issues - read and write
      • Metadata - read only
      • Pull requests - read and write
  • Subscribe to the following events:
    • Issues
    • Issue comment
  • Allow this app to be installed by any user or organization
  • Add a dummy value for the webhook url, we'll come back to this setting
  • After the app is created, generate a private key, we'll use it later for authentication to Github from the app

Which labels should I create?

In order for us to know which skill and persona we need to talk with, we are using Labels in Github Issues

The default bunch of skills and personnas are as follows:

  • PM.Readme
  • PM.BootstrapProject
  • Do.It
  • DevLead.Plan
  • Developer.Implement

Once you start adding your own skills, just remember to add the corresponding Label!

How do I run this locally?

Codespaces are preset for this repo.

Create a codespace and once the codespace is created, make sure to fill in the local.settings.json file.

There is a local.settings.template.json you can copy and fill in, containing comments on the different config values.

Hit F5 and go to the Ports tab in your codespace, make sure you make the :7071 port publically visible. How to share port?

Copy the local address (it will look something like https://foo-bar-7071.preview.app.github.dev) and append /api/github/webhooks at the end. Using this value, update the Github App's webhook URL and you are ready to go!

Before you go and have the best of times, there is one last thing left to do load the WAF into the vector DB

How do I deploy this to Azure?

This repo is setup to use azd to work with the Azure bits. azd is installed in the codespace.

Let's start by logging in to Azure using

azd auth login

After we've logged in, we need to create a new environment and setup the OpenAI and GithubApp config.

azd env new dev
azd env set -e dev GH_APP_ID replace_with_gh_app_id
azd env set -e dev GH_APP_INST_ID replace_with_inst_id
azd env set -e dev GH_APP_KEY replace_with_gh_app_key
azd env set -e dev OAI_DEPLOYMENT_ID replace_with_deployment_id
azd env set -e dev OAI_EMBEDDING_ID replace_with_embedding_id
azd env set -e dev OAI_ENDPOINT replace_with_oai_endpoint
azd env set -e dev OAI_KEY replace_with_oai_key
azd env set -e dev OAI_SERVICE_ID replace_with_oai_service_id
azd env set -e dev OAI_SERVICE_TYPE AzureOpenAI

Now that we have all that setup, the only thing left to do is run

azd up -e dev

and wait for the azure components to be provisioned and the app deployed.

As the last step, we also need to load the WAF into the vector DB

Load the WAF into Qdrant.

If you are running the app locally, we have Qdrant setup in the Codespace and if you are running in Azure, Qdrant is deployed to ACA. The loader is a project in the util folder, called seed-memory. We need to fill in the appsettings.json file in the config folder with the OpenAI details and the Qdrant endpoint, then just run the loader with dotnet run and you are ready to go.