Add Cloud Agent development environment - #560
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thedev/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 (formysqlclient/numpy/pandas), MySQL server, and Elasticsearch 7.10.1..cursor/install.sh— creates the virtualenv, installsrequirements.txt, runscollectstatic(idempotent)..cursor/start.sh— starts MySQL + Elasticsearch, applies migrations, and ensures theorganizations-v2index exists (idempotent; ES stdio is detached so the per-bootstartstep 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.ymlThe Cloud Agent VM has no Docker daemon, and the committed compose file isn't self-contained for a headless/fresh checkout (the
dbservice needsMYSQL_*vars the documented.envdoesn't define; theelasticsearch7healthcheck targets the wrong host/port; thewebimage needs aGITHUB_TOKENto 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 checkandmakemigrations --check --dry-run: clean.manage.py test rorapi.tests.tests_unit: 114 passed.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):
pip checkclean;manage.py checkclean.start.shbrings up MySQL + Elasticsearch and returns cleanly (~14s, exit 0, no hang)./v2/heartbeat→200;/v2/organizations→ results returned.