Skip to content

Commit

Permalink
PoC dev container
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Forngren <[email protected]>
  • Loading branch information
JohanForngren committed Jan 13, 2025
1 parent 312717f commit 596663f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
46 changes: 46 additions & 0 deletions python/packages/autogen-studio/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"installYarnUsingApt": true,
"version": "lts",
"pnpmVersion": "latest",
"nvmVersion": "latest"
}
},

"portsAttributes": {
"8000": {
"label": "Frontend develop"
},
"8081": {
"label": "AutoGen Studio"
}
},

// Performance optimizations for Windows
"mounts": [
"source=${localWorkspaceFolderBasename}-node_modules,target=/workspace/frontend/node_modules,type=volume",
"source=${localWorkspaceFolderBasename}-yarn-cache,target=/usr/local/share/.cache/yarn,type=volume"
],
"containerEnv": {
"npm_config_cache": "/tmp/.npm",
"YARN_CACHE_FOLDER": "/tmp/.yarn-cache",
"PYTHONUNBUFFERED": "1",
"PIP_NO_CACHE_DIR": "false",
// Use this to enable Gatsby polling when Docker is used
"CHOKIDAR_USEPOLLING":"true",
// This is used for Hot Module + Reloading with Gatsby
"INTERNAL_STATUS_PORT":"5001"
},
// Add workspaceMount for better performance
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",

// Use 'postCreateCommand' to install dependencies after the container is created.
"postCreateCommand": "mkdir -p frontend/node_modules && sudo chown vscode frontend/node_modules && pip install --upgrade pip gunicorn && pip install -e . && npm install -g gatsby-cli && cd frontend && yarn install --cache-folder /tmp/.yarn-cache"
}
28 changes: 26 additions & 2 deletions python/packages/autogen-studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ Project Structure:

There are two ways to install AutoGen Studio - from PyPi or from source. We **recommend installing from PyPi** unless you plan to modify the source code.

1. **Install from PyPi**
#### 1. Install from PyPi

We recommend using a virtual environment (e.g., conda) to avoid conflicts with existing Python packages. With Python 3.10 or newer active in your virtual environment, use pip to install AutoGen Studio:

```bash
pip install autogenstudio
```

2. **Install from Source**
#### 2. Install from Source

> Note: This approach requires some familiarity with building interfaces in React.

Expand Down Expand Up @@ -68,6 +68,30 @@ For Windows users, to build the frontend, you may need alternative commands to b

```

#### 3. Install from Source using dev container

> Note: This approach requires some familiarity with building interfaces in React.

If you prefer to install from source, ensure you have Python 3.10+ and Node.js (version above 14.15.0) installed. Here's how you get started:

1. Clone the AutoGen Studio repository.
2. Navigate to the `python/packages/autogen-studio/` directory
3. Open in devcontainer
4. Build the UI:

```bash
cd frontend
yarn build
```

For Windows users, to build the frontend, you may need alternative commands to build the frontend.

```bash

gatsby clean && rmdir /s /q ..\\autogenstudio\\web\\ui 2>nul & (set \"PREFIX_PATH_VALUE=\" || ver>nul) && gatsby build --prefix-paths && xcopy /E /I /Y public ..\\autogenstudio\\web\\ui

```

### Running the Application

Once installed, run the web UI by entering the following in your terminal:
Expand Down

0 comments on commit 596663f

Please sign in to comment.