diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..f455f4d60 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +{ + "name": "Multi Agent Custom Automation Engine Solution Accelerator", + "image": "mcr.microsoft.com/devcontainers/python:3.10", + "features": { + "ghcr.io/devcontainers/features/azure-cli:1.0.8": {}, + "ghcr.io/azure/azure-dev/azd:latest": {}, + "ghcr.io/rchaganti/vsc-devcontainer-features/azurebicep:1.0.5": {} + }, + + + "postCreateCommand": "sudo chmod +x .devcontainer/setupEnv.sh && ./.devcontainer/setupEnv.sh", + + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.azure-dev", + "ms-azuretools.vscode-bicep", + "ms-python.python" + ] + }, + "codespaces": { + "openFiles": [ + "README.md" + ] + } + }, + + "remoteUser": "vscode", + "hostRequirements": { + "memory": "8gb" + } +} diff --git a/.devcontainer/setupEnv.sh b/.devcontainer/setupEnv.sh new file mode 100644 index 000000000..49ac9df2d --- /dev/null +++ b/.devcontainer/setupEnv.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +pip install --upgrade pip + + +(cd ./src/frontend; pip install -r requirements.txt) + +(cd ./src/backend; pip install -r requirements.txt) diff --git a/documentation/LocalDeployment.md b/documentation/LocalDeployment.md index 03fd9ba2d..0fb65b902 100644 --- a/documentation/LocalDeployment.md +++ b/documentation/LocalDeployment.md @@ -6,6 +6,44 @@ - Azure CLI, and an Azure Subscription - Visual Studio Code IDE +# Local setup + +> **Note for macOS Developers**: If you are using macOS on Apple Silicon (ARM64) the DevContainer will **not** work. This is due to a limitation with the Azure Functions Core Tools (see [here](https://github.com/Azure/azure-functions-core-tools/issues/3112)). We recommend using the [Non DevContainer Setup](./NON_DEVCONTAINER_SETUP.md) instructions to run the accelerator locally. + +The easiest way to run this accelerator is in a VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers): + +1. Start Docker Desktop (install it if not already installed) +1. Open the project: + [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator) + +1. In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window + +## Detailed Development Container setup instructions + +The solution contains a [development container](https://code.visualstudio.com/docs/remote/containers) with all the required tooling to develop and deploy the accelerator. To deploy the Chat With Your Data accelerator using the provided development container you will also need: + +* [Visual Studio Code](https://code.visualstudio.com) +* [Remote containers extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + +If you are running this on Windows, we recommend you clone this repository in [WSL](https://code.visualstudio.com/docs/remote/wsl) + +```cmd +git clone https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator +``` + +Open the cloned repository in Visual Studio Code and connect to the development container. + +```cmd +code . +``` + +!!! tip + Visual Studio Code should recognize the available development container and ask you to open the folder using it. For additional details on connecting to remote containers, please see the [Open an existing folder in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container) quickstart. + +When you start the development container for the first time, the container will be built. This usually takes a few minutes. **Please use the development container for all further steps.** + +The files for the dev container are located in `/.devcontainer/` folder. + ## Local deployment and debugging: 1. **Clone the repository.** @@ -59,8 +97,8 @@ **Using a Different Database in Cosmos:** You can set the solution up to use a different database in Cosmos. For example, you can name it something like autogen-dev. To do this: - 1. Change the environment variable **COSMOSDB_DATABASE** to the new database name. - 2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled “_+ New Container_” and provide all the necessary details. + 1. Change the environment variable **COSMOSDB_DATABASE** to the new database name. + 2. You will need to create the database in the Cosmos DB account. You can do this from the Data Explorer pane in the portal, click on the drop down labeled “_+ New Container_” and provide all the necessary details. 6. **Create a `.env` file:**