Skip to content

OmniParser auto-shutdown + discovery#12

Merged
abrichr merged 4 commits intomainfrom
feat/autoshutdown
Mar 30, 2025
Merged

OmniParser auto-shutdown + discovery#12
abrichr merged 4 commits intomainfrom
feat/autoshutdown

Conversation

@abrichr
Copy link
Member

@abrichr abrichr commented Mar 25, 2025

TODO:

  • Docker Registry
(omnimcp) abrichr@MacBook-Pro-5 OmniMCP % python omnimcp/omniparser/server.py history                                        
2025-03-25 19:07:31.691 | INFO     | __main__:history:1389 - Retrieving 7 days of deployment history...                                                                                                                                                   
2025-03-25 19:07:32.462 | INFO     | __main__:history:1408 - Found 2 instances with name tag 'omnimcp'
2025-03-25 19:07:32.463 | INFO     | __main__:history:1413 -                                                                                                                                                                                              
=== Instance State History ===  
2025-03-25 19:07:32.607 | INFO     | __main__:history:1426 - Instance i-04efac4cc5ab4fd32: Current state=running, Launch time=2025-03-25 23:03:24+00:00
2025-03-25 19:07:33.179 | INFO     | __main__:history:1426 - Instance i-02a270cdd4da0d883: Current state=stopped, Launch time=2025-03-25 22:50:32+00:00
2025-03-25 19:07:33.701 | INFO     | __main__:history:1432 - Last console output (truncated):
2025-03-25 19:07:33.701 | INFO     | __main__:history:1436 -   <14>Mar 25 22:53:46 cloud-init: -----END SSH HOST KEY FINGERPRINTS-----
2025-03-25 19:07:33.701 | INFO     | __main__:history:1436 -   <14>Mar 25 22:53:46 cloud-init: #############################################################
2025-03-25 19:07:33.701 | INFO     | __main__:history:1436 -   -----BEGIN SSH HOST KEY KEYS-----
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDgFCWllflN0n5UlrM9aw3quRgf76REt/RNbeagwbQ1VpumVbGYSbR6PFiu7WTp/gY72eh/Dr0y8FeluhPq4ZUg= root@ip-172-31-13-38
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMjQwzrOpvrkDNOto6/w9PP6XkqzGrSie0+2BFfn7MhT root@ip-172-31-13-38
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCfJkXIdyeLAX4D/Pvi+RESpLOns8WQI4LR7qMMZXhNKkMQr6uEydSNRbdrYSHrvjyzVyWHC+gAkom9B1+rMz46LG3tjphySeo3s2V/FOsHoe3/K1iEIZFa3V8qx8y/hPBUNTZpaHmKnuqy0a3UPcW
imdXNkU+qEUJ9uutGofFUZ2BrIEgRT8+5r9alq40Wmdp7h+IH3fQ9JCCN+tUhSKnnWDy0O6GI6YW+LBU6FxIBliib8ghQRK2C7B5qeNU7zTbihRGI1CI1W/Z6bbMioqfnrSnL49KL2tyLGBFFLYtP5H2JRrBz0jNf3RV8rjqI7cs0ANR/8FkednupfD6/w9Zfo1CqWQ6sTqctVrsrgILEBDB6lhyEMrnuoGvBPFPNmbnRh6p/xntDBRzlk
AGYGBoDzf0SNX/dVht2vbu1OyNY3BBaTvPCw9DNrlKdqPX9bjw2gyLSqYbylNqTs9F+0Uv+UOOx2hKGsMHHMkBxwpiQfDFFH/FqT/Kbka95QZrMyhk= root@ip-172-31-13-38
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   -----END SSH HOST KEY KEYS-----                               
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   [  179.125035] cloud-init[1130]: Cloud-init v. 24.3.1-0ubuntu0~22.04.1 finished at Tue, 25 Mar 2025 22:53:46 +0000. Datasource DataSourceEc2Local.  Up 179.12 seconds
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   [  OK  ] Finished Cloud-init: Final Stage.                    
2025-03-25 19:07:33.702 | INFO     | __main__:history:1436 -   [  OK  ] Reached target Cloud-init target.                    
2025-03-25 19:07:33.702 | INFO     | __main__:history:1444 -                                                                 
=== Auto-shutdown Lambda Logs ===                           
2025-03-25 19:07:33.940 | INFO     | __main__:history:1462 - Log stream: 2025/03/25/[$LATEST]6cecb0df8e7d4878907e1013486f977e 
2025-03-25 19:07:34.110 | INFO     | __main__:history:1479 -   2025-03-25 18:58:46.795000: INIT_START Runtime Version: python:3.9.v82   Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:d6dc717114b06da7d4b5a2df328222709ec4fad2853004fac301b8b63a6
5c084                                                                                                                        
                                                                                                                             
2025-03-25 19:07:34.110 | INFO     | __main__:history:1479 -   2025-03-25 18:58:47.082000: START RequestId: 3e07164d-63f7-4858-bed4-e4c7f337e0e0 Version: $LATEST
                                                                                                                             
2025-03-25 19:07:34.110 | INFO     | __main__:history:1479 -   2025-03-25 18:58:50.787000: Stopping instance i-02a270cdd4da0d883 due to inactivity
                                                                                                                             
2025-03-25 19:07:34.110 | INFO     | __main__:history:1479 -   2025-03-25 18:58:51.205000: END RequestId: 3e07164d-63f7-4858-bed4-e4c7f337e0e0
                                                              
2025-03-25 19:07:34.110 | INFO     | __main__:history:1479 -   2025-03-25 18:58:51.206000: REPORT RequestId: 3e07164d-63f7-4858-bed4-e4c7f337e0e0       Duration: 4123.58 ms    Billed Duration: 4124 ms        Memory Size: 128 MB     Max Memory Used: 9
1 MB    Init Duration: 286.37 ms                    
                                                                                                                             
2025-03-25 19:07:34.110 | INFO     | __main__:history:1487 - 
=== API Gateway Access Logs ===                                                                                              
2025-03-25 19:07:34.346 | INFO     | __main__:history:1537 - No API Gateway named omnimcp-discovery found                    
2025-03-25 19:07:34.346 | INFO     | __main__:history:1542 - 
History retrieval complete.              

@abrichr abrichr changed the title Work in progress: auto-shutdown, discovery, Docker registry OmniParser uto-shutdown + discovery Mar 29, 2025
@abrichr abrichr changed the title OmniParser uto-shutdown + discovery OmniParser auto-shutdown + discovery Mar 29, 2025
abrichr added a commit that referenced this pull request Mar 30, 2025
This merges the infrastructure for automated OmniParser server deployment on EC2, including a fix for reliable inactivity-based auto-shutdown using CloudWatch Alarms.

Key additions:
- EC2 instance provisioning, configuration (Docker install), and deployment logic for OmniParser container (`omnimcp/omniparser/server.py`).
- CloudWatch Alarm / Lambda setup for inactivity-based auto-shutdown (replaces previous flawed `rate()` trigger).
- Client logic (`omnimcp/omniparser/client.py`) updated for auto-deployment triggering and reliable initialization after deployment.
- Foundational unit tests for core logic and simulation (`tests/test_core.py`, `tests/synthetic_ui_helpers.py`), which pass.
- End-to-end test structure and files (`tests/test_omnimcp.py`, `tests/test_omniparser_e2e.py`, `tests/test_omnimcp_core.py`).
- Test configuration (`tests/conftest.py`) for managing e2e tests.
- GitHub Actions CI workflow (`.github/workflows/ci.yml`) using `uv` for linting and running passing tests.
- Associated dependency updates in `pyproject.toml`.
- Updated README with badges, demo GIF, setup instructions.

Status:
- Core deployment and client initialization verified via `test_deploy_and_parse.py`.
- Unit tests pass and are checked by CI.
- E2E tests and core tests involving client interaction are included but currently skipped/commented out due to API mismatches requiring refactoring (tracked separately).

Combines and supersedes work from PRs #11 and #12.
@abrichr abrichr merged commit f15270c into main Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant