{"id":31702100,"url":"https://github.com/instruct-br/grua","last_synced_at":"2025-10-08T21:11:45.971Z","repository":{"id":41947202,"uuid":"146492434","full_name":"instruct-br/grua","owner":"instruct-br","description":"Generic Resource Unifier and Allocator (Puppet Node Classifier)","archived":false,"fork":false,"pushed_at":"2022-12-08T03:12:54.000Z","size":887,"stargazers_count":16,"open_issues_count":27,"forks_count":7,"subscribers_count":14,"default_branch":"master","last_synced_at":"2023-03-07T14:48:05.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instruct-br.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-28T18:52:20.000Z","updated_at":"2022-06-20T16:20:12.000Z","dependencies_parsed_at":"2023-01-24T09:00:38.175Z","dependency_job_id":null,"html_url":"https://github.com/instruct-br/grua","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/instruct-br/grua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instruct-br%2Fgrua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instruct-br%2Fgrua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instruct-br%2Fgrua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instruct-br%2Fgrua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instruct-br","download_url":"https://codeload.github.com/instruct-br/grua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instruct-br%2Fgrua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000716,"owners_count":26082837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-08T21:11:44.342Z","updated_at":"2025-10-08T21:11:45.962Z","avatar_url":"https://github.com/instruct-br.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Logo](https://i.imgur.com/l1yzk4N.png) GRUA (Generic Resources Unifier and Allocator)\n![License](https://img.shields.io/badge/license-Apache%202-blue.svg)\n\nGRUA is a *[Puppet External Node Classifier (ENC)][ENC]* application. Here are some of its key features:\n\n- **Multi-tenant support:** It is possible to manage multiple Puppet Servers (called Master Zones) with a single GRUA application;\n- **Multi-environments support:** GRUA supports multiple Puppet Servers environments and it can automatically sync information about them; \n- **Access control:** It is possible to establish selective restrictions of access to Master Zone, depending on the user permissions. Also, GRUA's API is protected and requires authentication; \n- **Group-orientation**: Nodes can only be associated to groups. And groups are abstractions that are associated with a Puppet Server and one of its environments, that may contain classes and parameters.\n\n## Tech\n\nGRUA uses the following technologies:\n\n- **Database:** *[PostgreSQL 9.6.9][POSTGRESQL]*\n- **Backend:** *[Python 3.6][PYTHON]* + *[Django 2][DJANGO]* + *[Django Rest][DJANGO_REST]*;\n- **Frontend:** *[HTML5][HTML5]* + *[Sass][SASS]* + *[JS][JS]* (*[ES6][ES6]* + *[Babel][BABEL]*) + *[Gulp][GULP]*.\n- **Docker image:** *[postgres][POSTGRES_DOCKER]* + *[contribsys/faktory][FAKTORY_DOCKER]* + *[python:3-alpine][PYTHON_DOCKER]*\n\n## How to run (with Docker)\n\nGRUA is very easy to install and deploy in Docker containers, through Docker Compose.\n\nSet environment variables on `docker-compose.yml` on `scheduler` and `worker` services:\n```yaml\n  ...\n  scheduler:\n    ...\n    environment:\n      - WEBAPP_USER=\u003cusername to be created\u003e\n      - WEBAPP_PASS=\u003cuser pass to be created\u003e\n  ... \n  worker:\n    ...\n    environment:\n      - WEBAPP_USER=\u003cusername to be created\u003e\n      - WEBAPP_PASS=\u003cuser pass to be created\u003e\n  ...\n```\n\nBuild the containers with:\n```bash\ndocker-compose build\n```\n\nApply database migrations with:\n```bash\ndocker-compose run webapp python manage.py migrate\n```\n\nCreate an admin user with the information provided in `WEBAPP_USER` and `WEBAPP_PASS`:\n```bash\ndocker-compose run webapp python manage.py shell -c \"from django.contrib.auth.models import User; User.objects.create_superuser('\u003cchosen username\u003e', '\u003cuser email\u003e', '\u003cchosen password\u003e')\"\n```\n\nSpin up the containers with:\n```bash\ndocker-compose up\n```\n\nBy default, the Docker will expose port 8080.\nTherefore, you can access the main webapp at *[localhost:8000][GRUA_URL]*.\n\n## Usage and documentation\n\nA more complete documentation of GRUA can be found on our *[wiki][WIKI]*.\n\n### Setting up a Puppet Server to communicate with GRUA\n\nIn order to a Puppet Server correctly communicate with GRUA there are two viable options:\n\n1. Use our *[puppet-grua module][MODULE]* on each Puppet Server on your infrastructure that should be communicating with GRUA;\n2. Manually perform the following actions:\n   1. Create a Master Zone for the Puppet Server: ![Creating a Master Zone](https://i.imgur.com/vLyKAwk.gif)\n   2. Obtain the Master Zone id (UUID) via GRUA's API (on *[/api/master_zones][MASTER_ZONES_URL]*): ![Obtaining Master Zone's UUID](https://i.imgur.com/iEtSqQb.gif)\n   3. Access the Puppet Server responsible for the Puppet CA;\n   4. Generate a certificate for GRUA via Puppet CA;\n   5. Sign this certificate via Puppet CA;\n   6. Create/obtain a token on GRUA's admin page for an admin user (on *[/admin/authtoken/token/add/][TOKEN_URL]*): ![Creating a new GRUA auth token](https://i.imgur.com/rKJ4fki.gif)\n   7. Config Puppet Server's API permissions to allow requests with the generated certificate on the classes/environments endpoints (using Master Zone's UUID value and GRUA's auth token);\n   8. Restart the Puppet Server;\n   9. Upload the certificate file and the key file for the PuppetServer (Master Zone) via a PUT on GRUA API (on *[/api/master_zones/\u003cmaster_zone_id\u003e][MASTER_ZONE_PUT_URL]*): ![Uploagind Master Zone's certificate files](https://i.imgur.com/39HYlqd.gif)\n   10. Create a file on the Puppet Server to consult GRUA's API node_classifier endpoint (on *[/api/nodes/node_classifier/?certname=\u003cnode_certname\u003e\u0026master_id=\u003cmaster_zone_id\u003e][NODE_CLASSIFIER_URL]*); \n   11. Restart the Puppet Server\n   12. Repeat steps 9, 10 and 11 for each compiler on a non-monolithic server architecture.\n\nWe absolutely recommend you to choose the first option, as it is much easier and the straight-forward one to go with.\n\n\n### API\n\nOur API is documented using *[Swagger][SWAGGER]* and can be accessed on GRUA via *[/docs/ URL path][DOCS_URL]*.\n\n### Release History\n\n- 0.1.0\n  - Public release\n- 0.1.1\n  - Fix node-sass version on package.json\n  - Update info about environment variables `WEBAPP_USER` and `WEBAPP_PASS`\n\n\n## Meta\n\nDistributed under the Apache 2 license. See *[LICENSE][LICENCE]* for more information.\n\n### Author\n\n- Oscar Esgalha (oscar at instruct dot com dot br)\n\n### Contributors\n\n- Aurora Wang (aurora dot wang at instruct dot com dot br);\n- Dirceu Silva (dirceu dot silva at instruct dot com dot br);\n- Fabio Iassia (fabio at instruct dot com dot br);\n- Joao Nascimento (joao dot nascimento at instruct dot com dot br);\n- João Sizílio (joao dot sizílio at instruct dot com dot br);\n- Luana Lima (luana dot lima at instruct dot com dot br);\n- Thiago Pena (thiagopena at instruct dot com dot br);\n- Jeferson Costa (jeferson dot costa at instruct dot com dot br);\n\n[ENC]: https://puppet.com/docs/puppet/5.5/nodes_external.html\n[WIKI]: https://github.com/instruct-br/grua/wiki\n[MODULE]: https://github.com/instruct-br/puppet-grua/\n[MASTER_ZONES_URL]: http://localhost:8000/api/master_zones/\n[TOKEN_URL]: http://localhost:8000/admin/authtoken/token/add/\n[MASTER_ZONE_PUT_URL]: http://localhost:8000/api/master_zones/\u003cmaster_zone_id\u003e/\n[NODE_CLASSIFIER_URL]: http://localhost:8000/api/nodes/node_classifier/?certname=\u003cnode_certname\u003e\u0026master_id=\u003cmaster_zone_id\u003e\n[POSTGRESQL]: https://www.postgresql.org/\n[PYTHON]: https://www.python.org/download/releases/3.0/\n[DJANGO]: https://docs.djangoproject.com/en/2.1/releases/2.0/\n[DJANGO_REST]: https://www.django-rest-framework.org/\n[HTML5]: https://www.w3.org/TR/html5/\n[SASS]: https://sass-lang.com/\n[JS]: https://www.javascript.com/\n[ES6]: http://es6-features.org/\n[BABEL]: https://babeljs.io/\n[GULP]: https://gulpjs.com/\n[POSTGRES_DOCKER]: https://hub.docker.com/_/postgres/\n[FAKTORY_DOCKER]: https://hub.docker.com/r/contribsys/faktory/\n[PYTHON_DOCKER]: https://hub.docker.com/_/python/\n[GRUA_URL]: http://localhost:8000/\n[SWAGGER]: https://swagger.io/\n[DOCS_URL]: http://localhost:8000/docs/\n[LICENCE]: https://github.com/instruct-br/grua/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstruct-br%2Fgrua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstruct-br%2Fgrua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstruct-br%2Fgrua/lists"}