Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit ab620dd

Browse files
trlyampcode-com
andcommitted
feat: implement overmind-based demo manager
- Convert all demo.yaml configs to Procfile + .env format - Maintain all existing functionality while leveraging overmind features The new system provides: - Better process management with overmind - Uses the standard Procfile format - Simplified maintenance and debugging - Color-coded logs and improved UX - Easiliy add DB functionality to individual apps Amp-Thread-ID: https://ampcode.com/threads/T-e1bc82e9-1bdd-44ec-94cb-6e5d264984f6 Co-authored-by: Amp <amp@ampcode.com>
1 parent e99c498 commit ab620dd

File tree

20 files changed

+383
-286
lines changed

20 files changed

+383
-286
lines changed

AGENTS.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
## Build/Test Commands
44

55
- `./install.sh` - Initialize workstation with development tools (bootstrap)
6+
- `./install.sh --install-path /custom/path` - Install to custom directory
67
- `./revenue init` - Initialize workstation (alternative method)
8+
- `./revenue init --install-path /custom/path` - Initialize with custom installation path
79
- `./revenue update` - Update existing tools and packages
810
- `./revenue help` - Show usage help
911
- `revenue init|update|demo` - Global command after setup
1012

1113
## Demo Management Commands
1214

1315
- `revenue demo start <language> <framework>` - Start a demo application
16+
- `revenue demo start all` - Start all demo applications
1417
- `revenue demo stop <language> <framework>` - Stop a specific demo
1518
- `revenue demo stop all` - Stop all running demos
19+
- `revenue demo logs <language> <framework>` - View logs from a running demo
20+
- `revenue demo connect <language> <framework>` - Connect to a running demo session
1621
- `revenue demo list` - List all available demos
1722
- `revenue demo running` - List currently running demos
1823
- `revenue demo clean --confirm` - Reset demo directory
@@ -26,32 +31,38 @@ Key components:
2631

2732
- `revenue` - Single, self-contained setup script with all logic integrated
2833
- `Brewfile` - Homebrew dependency management (formulae, casks, VS Code extensions)
29-
- `amp_demos/demo` - Demo application manager using tmux sessions
34+
- `amp_demos/demo` - Demo application manager using Overmind process manager
3035

3136
### Demo System Architecture
3237

33-
The demo system manages multiple language/framework combinations using a config-based approach:
38+
The demo system manages multiple language/framework combinations using an Overmind-based approach:
3439

35-
- **Discovery**: Scans `amp_demos/` for directories containing `demo.yaml` configuration files
36-
- **Session Management**: Uses tmux with server name "revenue-demo" to isolate sessions
37-
- **Tool Management**: Integrates with `mise` for per-demo tool installation and YAML parsing
38-
- **Directory Structure**: `amp_demos/<language>/<framework>/demo.yaml`
40+
- **Discovery**: Scans `amp_demos/` for directories containing `Procfile` configuration files
41+
- **Process Management**: Uses Overmind with tmux sessions to manage demo processes
42+
- **Tool Management**: Integrates with `mise` for per-demo tool installation
43+
- **Directory Structure**: `amp_demos/<language>/<framework>/Procfile`
3944

4045
Each demo application must have:
41-
- `demo.yaml` - Configuration file specifying how to start the application
46+
- `Procfile` - Standard Heroku-style process definition file
47+
- `.env` - Environment variables (PORT, LANGUAGE, FRAMEWORK)
4248
- Optional: `.mise.toml` or `.tool-versions` for tool requirements
4349

4450
#### Demo Configuration Format
4551

46-
```yaml
47-
language: javascript # Language identifier
48-
framework: react # Framework identifier
49-
port: 3000 # Application port (for URL display)
50-
install: pnpm install --silent # Optional: dependency installation command
51-
start: pnpm start # Required: command to start the application
52+
##### Procfile (standard Procfile format)
53+
```Procfile
54+
setup: pnpm install --silent # Optional: dependency installation command
55+
web: pnpm start # Required: command to start the web process
5256
```
5357

54-
Demo sessions are named as `<language>-<framework>` and run in tmux for easy management.
58+
##### .env (environment variables)
59+
```env
60+
PORT=3000
61+
LANGUAGE=javascript
62+
FRAMEWORK=react
63+
```
64+
65+
Demo sessions are named as `<language>-<framework>` and managed by Overmind using tmux for process isolation.
5566

5667
## Code Style
5768

Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ brew "jq"
88
brew "mise"
99
brew "python"
1010
brew "tmux"
11+
brew "overmind"
1112
brew "tree"
1213
brew "yq"
1314

DETAILS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
This list is everything that will be installed on your workstation when running
44
the installer. All dependencies are managed via [Brewfile](/Brewfile).
55

6+
By default, the repository is installed to `~/revenue`, but you can customize this
7+
with the `--install-path` flag:
8+
9+
```bash
10+
./install.sh --install-path /custom/path
11+
# or
12+
revenue init --install-path /custom/path
13+
```
14+
615
To update existing installed tools, run `revenue update`
716

817
## Editors and IDEs
@@ -61,6 +70,12 @@ Command-line interface for Amp AI coding assistant
6170
mise allows you to easily install additional developer tools as well a manage
6271
multiple versions of tools globally or,specific to individual projects.
6372

73+
### overmind
74+
75+
overmind is a process manager for Procfile-based applications and tmux sessions. It provides a simple way to manage multiple processes during development with features like process restart, log aggregation, and easy process interaction.
76+
77+
[Learn more](https://github.com/DarthSim/overmind)
78+
6479
```bash
6580
revenue on main [!?] took 12s
6681
❯ mise list

README.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Sourcegraph Revenue Team Workstation Setup
22

3-
Complete macOS workstation setup for Revenue team members. Installs all tools needed for demos and development.
3+
Complete macOS workstation setup for Revenue team members. Installs all tools
4+
needed for demos and development.
45

56
## Quick Start
67

@@ -12,7 +13,7 @@ Complete macOS workstation setup for Revenue team members. Installs all tools ne
1213

1314
**That's it!** The installer will:
1415

15-
- Download this repository to `~/revenue`
16+
- Download this repository to `~/revenue` (customizable with `--install-path`)
1617
- Install all necessary tools (VS Code, Python, Java, etc.)
1718
- Set up demo applications
1819
- Take about 15-30 minutes
@@ -25,29 +26,7 @@ Once setup is complete, you can use the `revenue` command:
2526
revenue demo list # See available demo apps
2627
revenue demo start python flask # Start a specific demo
2728
revenue update # Update tools to latest versions
28-
```
29-
30-
## Demo Applications
31-
32-
Quick commands for managing demo applications:
33-
34-
```bash
35-
# Start any demo
36-
revenue demo start <language> <framework>
37-
revenue demo start python flask
38-
revenue demo start javascript react
39-
40-
# Stop demos
41-
revenue demo stop python flask
42-
revenue demo stop all
43-
44-
# View available demos
45-
revenue demo list
46-
revenue demo running
47-
48-
# View logs and attach to sessions
49-
revenue demo logs python flask
50-
revenue demo attach python flask
29+
revenue init --install-path /custom/path # Reinstall to custom location
5130
```
5231

5332
See [amp_demos/README.md](amp_demos/README.md) for complete demo documentation.
@@ -56,21 +35,21 @@ See [amp_demos/README.md](amp_demos/README.md) for complete demo documentation.
5635

5736
### Common Issues
5837

59-
**"Command not found: revenue"**
38+
#### "Command not found: revenue"
6039

6140
- Close and reopen Terminal, or run: `source ~/.zshrc`
6241

63-
**"Cannot clone repository"**
42+
#### "Cannot clone repository"
6443

6544
- Ensure you have access to GitHub and the Sourcegraph organization
66-
- Ask in [#ask-tech-ops](https://sourcegraph.slack.com/archives/C01CSS3TC75) for repository access
45+
- Ask in [#ask-tech-ops](https://sourcegraph.slack.com/archives/C01CSS3TC75)
6746

68-
**Installation fails with network errors**
47+
#### Installation fails with network errors
6948

7049
- Check VPN/proxy settings
7150
- Rerun the installer - it's safe to run multiple times
7251

73-
**"Xcode Command Line Tools required"**
52+
#### "Xcode Command Line Tools required"
7453

7554
- Run: `xcode-select --install`
7655
- Wait for installation to complete, then rerun the installer
@@ -81,7 +60,8 @@ If you're stuck:
8160

8261
1. Check the error message for specific guidance
8362
2. Try running the installer again (it's safe to repeat)
84-
3. Ask in [#ask-tech-ops](https://sourcegraph.slack.com/archives/C01CSS3TC75) with the error details
63+
3. Ask in [#discuss-field-engineering](https://sourcegraph.slack.com/archives/C095PTMTS31)
64+
with the error details
8565

8666
## Manual Setup (Alternative)
8767

@@ -95,7 +75,24 @@ xcode-select --install
9575
git clone https://github.com/sourcegraph/revenue.git ~/revenue
9676
cd ~/revenue
9777

98-
# 3. Run setup
78+
# 3. Run setup (default location)
79+
./install.sh
80+
81+
# OR: Custom installation path
82+
./install.sh --install-path /custom/path
83+
```
84+
85+
### Custom Installation Path
86+
87+
To install the repository to a different location:
88+
89+
```bash
90+
# Download installer directly
91+
curl -fsSL https://raw.githubusercontent.com/sourcegraph/revenue/main/install.sh | bash -s -- --install-path /custom/path
92+
93+
# Or clone first and run locally (recommended for custom paths)
94+
git clone https://github.com/sourcegraph/revenue.git /custom/path
95+
cd /custom/path
9996
./install.sh
10097
```
10198

amp_demos/README.md

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
11
# Demo Application Manager
22

3-
The demo application manager allows running multiple language/framework demos in
4-
isolated tmux sessions using configuration files.
3+
The demo application manager allows running multiple language/framework demos
4+
using [Overmind](https://github.com/DarthSim/overmind)
55

66
## Directory Structure
77

88
The script expects demo applications to be organized as:
99

10-
```
10+
```text
1111
amp_demos/
12-
├── demo
12+
├── demo # Overmind-based demo manager
1313
├── <language>/
1414
│ └── <framework>/
15-
│ ├── demo.yaml # Required configuration file
16-
│ ├── .mise.toml # Optional: tool requirements
17-
│ └── ... # Your demo files
15+
│ ├── Procfile # Required: Overmind process definition
16+
│ ├── .env # Required: Environment variables (PORT, etc.)
17+
│ ├── .mise.toml # Optional: tool requirements
18+
│ └── ... # Your demo files
1819
```
1920

20-
Only directories containing `demo.yaml` are recognized as valid demos.
21+
Only directories containing `Procfile` are recognized as valid demos.
2122

2223
## Configuration Format
2324

24-
Each demo requires a `demo.yaml` configuration file:
25+
Each demo requires a `Procfile` and `.env` file:
26+
27+
### [Procfile](https://devcenter.heroku.com/articles/procfile) (standard Procfile format)
28+
29+
```Procfile
30+
setup: pnpm install --silent
31+
web: pnpm start
32+
```
33+
34+
#### .env (environment variables)
2535

26-
```yaml
27-
language: javascript # Language identifier
28-
framework: react # Framework identifier
29-
port: 3000 # Application port (for URL display)
30-
install: pnpm install --silent # Optional: dependency installation command
31-
start: pnpm start # Required: command to start the application
36+
```env
37+
PORT=3000
38+
LANGUAGE=javascript
39+
FRAMEWORK=react
3240
```
3341

34-
The `install` field is optional and runs before the `start` command. The `port` field is used to display the application URL.
42+
The `setup` process is optional and runs before starting the `web` process. The
43+
`PORT` variable is used to display the application URL.
3544

3645
## Usage
3746

@@ -80,8 +89,8 @@ cd amp_demos
8089
### View and Interact with Demos
8190

8291
```bash
83-
./demo logs <language> <framework> # View current logs from a running demo
84-
./demo attach <language> <framework> # Attach to a running demo session
92+
./demo logs <language> <framework> # View logs from a running demo
93+
./demo connect <language> <framework> # Connect to a running demo session
8594
```
8695

8796
### List Demos
@@ -99,11 +108,12 @@ cd amp_demos
99108

100109
## How It Works
101110

102-
1. **Discovery**: Scans subdirectories for `demo.yaml` configuration files
111+
1. **Discovery**: Scans subdirectories for `Procfile` configuration files
103112
2. **Environment**: Runs `mise install` in each demo directory (if available)
104-
3. **Config Parsing**: Reads the demo configuration using `yq`
105-
4. **Session Management**: Creates isolated tmux sessions named `<language>-<framework>`
106-
5. **Execution**: Runs install and start commands within the mise environment
113+
3. **Config Parsing**: Uses standard Procfile format and `.env` files
114+
4. **Process Management**: Uses Overmind to manage processes with tmux sessions
115+
named `<language>-<framework>`
116+
5. **Execution**: Runs setup and web processes as defined in Procfile
107117

108118
## Examples
109119

@@ -117,8 +127,8 @@ cd amp_demos
117127
# View logs from a running demo
118128
./demo logs python flask
119129

120-
# Attach to running demo
121-
./demo attach python flask
130+
# Connect to running demo
131+
./demo connect python flask
122132

123133
# Stop all demos
124134
./demo stop all
@@ -127,12 +137,17 @@ cd amp_demos
127137
./demo list
128138
```
129139

130-
## Tmux Session Management
140+
## Process Management
131141

132-
All demos run in a shared tmux server named `revenue-demo`. Sessions are automatically named using the pattern `<language>-<framework>`.
142+
Overmind manages all demos using tmux sessions named using the pattern
143+
`<language>-<framework>`. Each demo runs its processes as defined in the Procfile.
133144

134-
To manually attach to a running demo:
145+
To manually connect to a running demo process:
135146

136147
```bash
137-
tmux -L revenue-demo attach -t <session-name>
138-
```
148+
cd <language>/<framework>
149+
overmind connect web -s <language>-<framework>
150+
151+
# Or using tmux directly
152+
tmux attach -t <language>-<framework>
153+

0 commit comments

Comments
 (0)