Skip to content

Add Cloud Agent development environment - #560

Merged
jrhoads merged 3 commits into
devfrom
cursor-cloud-agent-env-02f1
Sep 25, 2026
Merged

jrhoads merged 3 commits into
devfrom
cursor-cloud-agent-env-02f1

Conversation

@jrhoads

@jrhoads jrhoads commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a reproducible Cursor Cloud Agent development environment under .cursor/ so agents can run, test, and demo the ROR API end to end. The setup mirrors the dev/CI stack: Python 3.12, Django 5.2, Elasticsearch 7.10.1, MySQL 8. No application code is changed.

What's included

  • .cursor/Dockerfile — Ubuntu 24.04 base with Python 3.12, build toolchain (for mysqlclient/numpy/pandas), MySQL server, and Elasticsearch 7.10.1.
  • .cursor/install.sh — creates the virtualenv, installs requirements.txt, runs collectstatic (idempotent).
  • .cursor/start.sh — starts MySQL + Elasticsearch, applies migrations, and ensures the organizations-v2 index exists (idempotent; ES stdio is detached so the per-boot start step returns cleanly).
  • .cursor/environment.json — wires up build/install/start and runs the dev server (runserver 0.0.0.0:9292) as a terminal; exposes ports 9292/9200/3306.
  • .cursor/mysql-init.sql, .cursor/elasticsearch.yml, .cursor/env.example — supporting config (credentials match the CI test workflow).
  • .gitignore — ignore local .venv/ and collected /static/.

Why native services instead of docker-compose.yml

The Cloud Agent VM has no Docker daemon, and the committed compose file isn't self-contained for a headless/fresh checkout (the db service needs MYSQL_* vars the documented .env doesn't define; the elasticsearch7 healthcheck targets the wrong host/port; the web image needs a GITHUB_TOKEN to index data). Running Elasticsearch + MySQL natively matches exactly what CI does in .github/workflows/run_tests.yml (services + native Python 3.12), needs no secrets, and boots faster.

Validation

Local (on the setup VM):

  • pip check: no broken requirements.
  • manage.py check and makemigrations --check --dry-run: clean.
  • manage.py test rorapi.tests.tests_unit: 114 passed.
  • Live API verified against a locally-indexed sample of 21 real ROR records: heartbeat 200, list + type/country facets, search, retrieve by ROR ID, and affiliation matching (EXACT, score 1.0).

Fresh prebuilt-environment build (booted a clean pod from a build of this branch):

  • Python 3.12.3 / Django 5.2.17 / Elasticsearch 7.10.1 / MySQL 8.
  • pip check clean; manage.py check clean.
  • start.sh brings up MySQL + Elasticsearch and returns cleanly (~14s, exit 0, no hang).
  • Unit tests: 114 passed; /v2/heartbeat → 200; /v2/organizations → results returned.
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 22, 2026 10:11
Adds a reproducible .cursor/ environment for the ROR API that mirrors the
CI/dev stack (Python 3.12, Django 5.2, Elasticsearch 7.10.1, MySQL 8):

- .cursor/Dockerfile: system deps, Python 3.12, MySQL, Elasticsearch 7.10.1
- .cursor/install.sh: venv + pip install + collectstatic
- .cursor/start.sh: starts MySQL + Elasticsearch, migrates, creates v2 index
- .cursor/environment.json: build/install/start config + runserver terminal
- .cursor/mysql-init.sql, elasticsearch.yml, env.example: supporting config

Ignore local .venv/ and collected /static/.

Co-authored-by: Joseph Rhoads <jrhoads@users.noreply.github.com>
Launching elasticsearch -d without redirecting its file descriptors left
the daemon holding the start command's stdout pipe open, so the per-boot
start step never returned and could stall boot. Redirect the ES launch
to /dev/null/console log so start.sh completes promptly.

Co-authored-by: Joseph Rhoads <jrhoads@users.noreply.github.com>
@jrhoads
jrhoads marked this pull request as ready for review September 25, 2026 15:03
@jrhoads
jrhoads merged commit f63268f into dev Sep 25, 2026
3 of 4 checks passed
@jrhoads
jrhoads deleted the cursor-cloud-agent-env-02f1 branch September 25, 2026 15:04
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.

2 participants