{"id":19040878,"url":"https://github.com/cloudfoundry/cloud_controller_ng","last_synced_at":"2025-05-15T04:07:21.280Z","repository":{"id":3673909,"uuid":"4743255","full_name":"cloudfoundry/cloud_controller_ng","owner":"cloudfoundry","description":"Cloud Foundry Cloud Controller","archived":false,"fork":false,"pushed_at":"2025-05-13T08:54:17.000Z","size":65954,"stargazers_count":197,"open_issues_count":138,"forks_count":364,"subscribers_count":150,"default_branch":"main","last_synced_at":"2025-05-13T09:32:25.825Z","etag":null,"topics":["cloudfoundry","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"krobertson/deb-s3","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-06-21T19:14:32.000Z","updated_at":"2025-05-12T11:49:31.000Z","dependencies_parsed_at":"2023-01-16T21:01:03.375Z","dependency_job_id":"ea0dcedc-9eb9-4d5e-a63d-2bff6e973fe2","html_url":"https://github.com/cloudfoundry/cloud_controller_ng","commit_stats":{"total_commits":13462,"total_committers":858,"mean_commits":15.68997668997669,"dds":0.9627841331154361,"last_synced_commit":"a50f15dafb64a7a5d1e45dd4fd8a77a04d957b45"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcloud_controller_ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcloud_controller_ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcloud_controller_ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fcloud_controller_ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry","download_url":"https://codeload.github.com/cloudfoundry/cloud_controller_ng/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"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","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":["cloudfoundry","ruby"],"created_at":"2024-11-08T22:25:54.053Z","updated_at":"2025-05-15T04:07:16.270Z","avatar_url":"https://github.com/cloudfoundry.png","language":"Ruby","readme":"[![Code Climate](https://api.codeclimate.com/v1/badges/aa47fb93c59ced5fcc4f/maintainability)](https://codeclimate.com/github/cloudfoundry/cloud_controller_ng)\n[![Code Climate](https://api.codeclimate.com/v1/badges/aa47fb93c59ced5fcc4f/test_coverage)](https://codeclimate.com/github/cloudfoundry/cloud_controller_ng)\n[![slack.cloudfoundry.org](https://slack.cloudfoundry.org/badge.svg)](https://cloudfoundry.slack.com/messages/capi/)\n\n# Welcome to the Cloud Controller\n\n## Helpful Resources\n\n* [V3 API Docs](http://v3-apidocs.cloudfoundry.org)\n* [V2 API Docs](http://v2-apidocs.cloudfoundry.org)\n* [Continuous Integration Pipelines](https://concourse.app-runtime-interfaces.ci.cloudfoundry.org/teams/capi-team)\n* [Notes on V3 Architecture](https://github.com/cloudfoundry/cloud_controller_ng/wiki/Notes-on-V3-Architecture)\n* [capi-release](https://github.com/cloudfoundry/capi-release) - The bosh release used to deploy cloud controller\n\n## Components\n\n### Cloud Controller\n\nThe Cloud Controller provides REST API endpoints to create and manage apps, services, user roles, and more!\n\n### Database\n\nThe Cloud Controller supports Postgres and Mysql.\n\n### Blobstore\n\nThe Cloud Controller manages a blobstore for:\n\nAll Platforms:\n* Resource cache: During package upload resource matching, Cloud Controller will only upload files it doesn't already have in this cache.\n\nWhen deployed via capi-release only:\n* App packages: Unstaged files for an application\n* Droplets: An executable containing an app and its runtime dependencies\n* Buildpacks: Set of programs that transform packages into droplets\n* Buildpack cache: Cached dependencies and build artifacts to speed up future staging\n \nCloud Controller currently supports [webdav](http://www.webdav.org/) and the following [fog](http://fog.io) connectors: \n\n* Alibaba Cloud (Experimental)\n* Azure\n* Openstack\n* Local (NFS)\n* Google\n* AWS\n\n### Runtime\n\nThe Cloud Controller on VMs uses [Diego](https://github.com/cloudfoundry/diego-release) to stage and run apps and tasks.\nSee [Diego Design Notes](https://github.com/cloudfoundry/diego-design-notes) for more details.\n\n## Contributing\n\nPlease read the [contributors' guide](https://github.com/cloudfoundry/cloud_controller_ng/blob/main/CONTRIBUTING.md) and the [Cloud Foundry Code of Conduct](https://cloudfoundry.org/code-of-conduct/)\n### Predefined Development Environment\n\nTo commence your work in a fully equipped development environment, you have two main options:\n\n1. **GitHub Codespaces**: GitHub Codespaces provisions a virtual machine with essential core services, such as S3 Blobstore, Database, and NGINX. It also establishes a connection that your IDE can use (VSCode is recommended). To initiate a codespace, click on the green button within the GitHub UI(upper right corner) and select the 'Codespaces' tab.\n\n2. **Local Environment**: This option allows you to establish an environment on your local machine with the same core services as GitHub Codespaces, using Docker.\n\nA script in the project's root directory provides convenient shortcuts to set up an environment locally:\n\n```\nUsage: ./devenv.sh COMMAND\n\nCommands:\n  create     - Setting up the development environment(containers)\n  start      - Starting the development environment(containers), an existing fully set up set of containers must exist.\n  stop       - Stopping but not removing the development environment(containers)\n  destroy    - Stopping and removing the development environment(containers)\n  runconfigs - Copies matching run configurations for intellij and vscode into the respective folders\n  help       - Print this help text\n```\n\nTo run this script, ensure the following are installed on your local system:\n\n- Ruby (Refer to the .ruby-version file for the correct version)\n- [Bundler](https://bundler.io/)\n- [Docker](https://www.docker.com/) (Feature \"Allow privileged port mapping\" must be enabled in Avanced Options on Docker Desktop for Mac, docker must be accessable without root permissions)\n- [Docker Compose](https://github.com/docker/compose)\n- [PSQL CLI](https://www.postgresql.org/docs/current/app-psql.html)\n- [MYSQL CLI](https://dev.mysql.com/doc/refman/8.0/en/mysql.html)\n- [UAAC](https://github.com/cloudfoundry/cf-uaac)\n- [yq 4+](https://github.com/mikefarah/yq)\n\nUpon executing `./devenv.sh create`, the necessary containers will be set up and the databases will be initialized and migrated. \n\nAs an optional step, execute `./devenv.sh runconfigs` to copy predefined settings and run configurations for this project into `.vscode` and `.idea` directories for VSCode and IntelliJ/RubyMine/JetBrains IDEs. These configurations are opinionated and, hence, not provided by default, but they do offer common configurations to debug `rspecs`, `cloud_controller`, `local_worker`, and `generic_worker`.\n\n#### Credentials\n\nThis Setup automatically creates a user in UAA for login in the cloud_controller, and sets Passwords for Postgres and Mysql.\nIn case you need them to configure them somewhere else (e.g. database visualizers):\n- Postgres: postgres:supersecret@localhost:5432\n- MySQL: root:supersecret@127.0.0.1:3306\n- UAA Admin: \n```bash\nuaac target http://localhost:8080\nuaac token client get admin -s \"adminsecret\"\n```\n- CF Admin:\n```bash\ncf api http://localhost\ncf login -u ccadmin -p secret\n```\n\n#### Starting the Cloud Controller locally\n\nWhen the Docker containers have been set up as described above, you can start the cloud controller locally. Start the main process with:\n```\nDB_CONNECTION_STRING=mysql2://root:supersecret@127.0.0.1:3306/ccdb ./bin/cloud_controller -c ./tmp/cloud_controller.yml\n```\nThen start a local worker:\n```\nDB_CONNECTION_STRING=mysql2://root:supersecret@127.0.0.1:3306/ccdb CLOUD_CONTROLLER_NG_CONFIG=./tmp/cloud_controller.yml bundle exec rake jobs:local\n```\nStart a delayed_job worker:\n```\nDB_CONNECTION_STRING=mysql2://root:supersecret@127.0.0.1:3306/ccdb CLOUD_CONTROLLER_NG_CONFIG=./tmp/cloud_controller.yml bundle exec rake jobs:generic\n```\nAnd finally start the scheduler:\n```\nDB_CONNECTION_STRING=mysql2://root:supersecret@127.0.0.1:3306/ccdb CLOUD_CONTROLLER_NG_CONFIG=./tmp/cloud_controller.yml bundle exec rake clock:start\n```\n\nKnown limitations:\n- The [uaa_client_manager](https://github.com/cloudfoundry/cloud_controller_ng/blob/96c729fd116843ce06f40e7325a89f59b64d5f86/lib/services/sso/uaa/uaa_client_manager.rb#L29) requires SSL for UAA connections. The UAA instance in the Docker container provides however only plain http connections. You can set `http.use_ssl` to `false` as workaround.\n\n### Unit Tests\n**TLDR:** Always run `bundle exec rake` before committing\n\nTo maintain a consistent and effective approach to testing, please refer to [the spec README](spec/README.md) and\nkeep it up to date, documenting the purpose of the various types of tests.\n\nBy default `rspec` will randomly pick between postgres and mysql.\n\nIf postgres is not running on your OSX machine, you can start up a server by doing the following:\n```\nbrew services start postgresql\ncreateuser -s postgres\nDB=postgres rake db:create\n```\n\nIt will try to connect to those databases with the following connection string:\n\n* postgres: `postgres://postgres@localhost:5432/cc_test`\n* mysql: `mysql2://root:password@localhost:3306/cc_test`\n\nTo specify a custom username, password, host, or port for either database type, you can override the default\nconnection string prefix (the part before the `cc_test` database name) by setting the `MYSQL_CONNECTION_PREFIX`\nand/or `POSTGRES_CONNECTION_PREFIX` variables. Alternatively, to override the full connection string, including \nthe database name, you can set the `DB_CONNECTION_STRING` environment variable.  This will restrict you to only \nrunning tests in serial, however.\n\nFor example, to run unit tests in parallel with a custom mysql username and password, you could execute:\n```\nMYSQL_CONNECTION_PREFIX=mysql2://custom_user:custom_password@localhost:3306 bundle exec rake\n```\n\nThe following are examples of completely fully overriding the database connection string:\n\n    DB_CONNECTION_STRING=\"postgres://postgres@localhost:5432/cc_test\" DB=postgres rake spec:serial\n    DB_CONNECTION_STRING=\"mysql2://root:password@localhost:3306/cc_test\" DB=mysql rake spec:serial\n\nIf you are running the integration specs (which are included in the full rake),\nand you are specifying `DB_CONNECTION_STRING`, you will also\nneed to have a second test database with `_integration_cc` as the name suffix.\n\nFor example, if you are using:\n\n    DB_CONNECTION_STRING=\"postgres://postgres@localhost:5432/cc_test\"\n\nYou will also need a database called:\n\n    `cc_test_integration_cc`\n\nThe command\n```\nrake db:create\n```\nwill create the above database when the `DB` environment variable is set to postgres or mysql.\nYou should run this before running rake in order to ensure that the `cc_test` database exists.\n\n#### Running tests on a single file\n\nThe development team typically will run the specs to a single file as (e.g.)\n\n    bundle exec rspec spec/unit/controllers/runtime/users_controller_spec.rb\n\n#### Running all the unit tests\n\n    bundle exec rake spec\n\nNote that this will run all tests in parallel by default. If you are setting a custom `DB_CONNECTION_STRING`,\nyou will need to run the tests in serial instead:\n\n    bundle exec rake spec:serial\n\nTo be able to run the unit tests in parallel and still use custom connection strings, use the\n`MYSQL_CONNECTION_PREFIX` and `POSTGRES_CONNECTION_PREFIX` environment variables described above.\n\n#### Running static analysis\n\n    bundle exec rubocop\n\n#### Running both unit tests and rubocop\n\nBy default, `bundle exec rake` will run the unit tests first, and then `rubocop` if they pass. To run `rubocop` first, run:\n\n    RUBOCOP_FIRST=1 bundle exec rake\n\n## Logs\n\nCloud Controller uses [Steno](http://github.com/cloudfoundry/steno) to manage its logs.\nEach log entry includes a \"source\" field to designate which module in the code the\nentry originates from.  Some of the possible sources are 'cc.app', 'cc.app_stager',\nand 'cc.healthmanager.client'.\n\nHere are some use cases for the different log levels:\n* `error` - the CC received a malformed HTTP request, or a request for a non-existent droplet\n* `warn` - the CC failed to delete a droplet, CC received a request with an invalid auth token\n* `info` - CC received a token from UAA, CC received a NATS request\n* `debug2` - CC created a service, updated a service\n* `debug` - CC syncs resource pool, CC uploaded a file\n\n## Configuration\n\nThe Cloud Controller uses a YAML configuration file. For an example, see `config/cloud_controller.yml`.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fcloud_controller_ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry%2Fcloud_controller_ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fcloud_controller_ng/lists"}