2.5 KiB
2.5 KiB
🧰 Developers Guide
This guide helps developers set up a local environment for contributing to the project.
Prerequisites
- VS Code
- Docker
- Git
Setup Instructions
-
Clone the repository
git clone https://git.abyres.net/elixier/manager.git cd manager -
Create .env file
FERNET_KEY=secretkey APP_URL=http://localhost:3000 BACKEND_URL=http://localhost:8000 APP_VERSION=1.1.0-build.1887.166b86a9 AGENT_IMAGE=git.abyres.net/elixier/agent:1.1.0-build.1887.166b86a9- Set APP_VERSION to image tag obtained from https://git.abyres.net/elixier/-/packages/container/manager/
- AGENT_IMAGE tag must be same as APP_VERSION
-
Open in VS Code
code . -
Reopen project in devcontainer
Ctrl + Shift + P>Dev Containers: Reopen in container -
Initialize database
reflex db migrate -
Create initial global admin
python cli.py create-admin --email=admin@example.com --password=password -
Generate plugin repository
python cli.py build-repo -
Run web app
Development mode:
Ctrl + Shift + P>Tasks: Run Task>RunProduction mode:
reflex run --env prod
Branching & Workflow
main— stable releasedevelopment— active developmentfeat-*— new featuresfix-*— bug fixes
Pull requests to main branch require at least two approvals before merging.
Running Tests
-
Open project in devcontainer using VS Code
-
Ctrl + Shift + P>Tasks Run Task>Testor run this command in devcontainer:
uv run pytest tests
OpenSearch
List of indexes
- audit_log
- cluster-metrics
- deployment-metrics
- host-metrics
- host-logs
- host-task-log
Delete index
- Delete one index:
curl -X DELETE -u admin:{OPENSEARCH_ADMIN_PASSWORD} -k https://localhost:9200/host-metrics
- Delete multiple indexes:
curl -X DELETE -u admin:{OPENSEARCH_ADMIN_PASSWORD} -k https://localhost:9200/audit_log,cluster-metrics,deployment-metrics,host-metrics,host-logs,host-task-log
Devcontainer Components
| Container | Component | URL |
|---|---|---|
| Reflex | Frontend | http://localhost:3000 |
| Backend | http://localhost:8000 | |
| Swagger | http://localhost:8000/docs | |
| Opensearch | API | https://localhost:9200 |
| Dashboard | http://localhost:5601 | |
| Nginx | Plugin repo | http://localhost:8080 |