{"id":19347191,"url":"https://github.com/dcos/cosmos","last_synced_at":"2025-04-23T05:31:49.507Z","repository":{"id":57726604,"uuid":"47585661","full_name":"dcos/cosmos","owner":"dcos","description":"Provides an API for the orderly, harmonious, and complete management of DC/OS service packages","archived":false,"fork":false,"pushed_at":"2020-11-10T02:27:45.000Z","size":2546,"stargazers_count":57,"open_issues_count":3,"forks_count":24,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-04-09T22:30:07.929Z","etag":null,"topics":["cosmos","dcos","dcos-orchestration-guild","packaging","scala","universe"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":false,"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/dcos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.markdown","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T23:23:49.000Z","updated_at":"2024-04-06T22:32:25.000Z","dependencies_parsed_at":"2022-09-26T21:50:56.470Z","dependency_job_id":null,"html_url":"https://github.com/dcos/cosmos","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fcosmos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fcosmos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fcosmos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcos%2Fcosmos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcos","download_url":"https://codeload.github.com/dcos/cosmos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223909905,"owners_count":17223592,"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":["cosmos","dcos","dcos-orchestration-guild","packaging","scala","universe"],"created_at":"2024-11-10T04:14:54.207Z","updated_at":"2024-11-10T04:14:54.842Z","avatar_url":"https://github.com/dcos.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DC/OS Package Manager (Cosmos)\n\nProvides an API for the [orderly, harmonious, and complete](http://www.thefreedictionary.com/cosmos)\nmanagement of DC/OS service packages.\n\n\nTeamcity CI : [Build \u0026 Compile](https://teamcity.mesosphere.io/viewType.html?buildTypeId=DcosIo_Cosmos_Ci\u0026guest=1) and [Integration Tests](https://teamcity.mesosphere.io/viewType.html?buildTypeId=DcosIo_Cosmos_FullClusterIntegrationTests\u0026guest=1)\n\n#### Table of Contents\n- [Running tests](#running-tests)\n  - [Scala style checks](#scala-style-checks)\n  - [Unit Tests](#unit-tests)\n    - [Scoverage](#scoverage)\n  - [Integration Tests](#integration-tests)\n    - [Scoverage](#scoverage)\n    - [Requirements](#requirements)\n    - [Running the tests](#running-the-tests)\n      - [Example configurations](#example-configurations)\n- [Running Cosmos](#running-cosmos)\n  - [Cosmos Admin Portal](#cosmos-admin-portal)\n- [Project structure](#project-structure)\n  - [RPC Conventions](#rpc-conventions)\n- [Versions \u0026 Compatibility](#versions--compatibility)\n  - [DC/OS](#dcos)\n  - [Universe](#universe)\n    - [Repository Format](#repository-format)\n    - [Packaging Version](#packaging-version)\n- [API Documentation](#api-documentation)\n  - [Cosmos Version 0.3.x](#cosmos-version-03x)\n- [Reporting Problems](#reporting-problems)\n\n## Running tests\n\n### Scala style checks\nThis project enforces certain scalastyle rules. To run those check against the code run:\n\n```bash\nsbt scalastyle\n```\n\n### Unit Tests\nThere is a suite of unit tests that can be ran by running `sbt clean test:test`\n\n#### Scoverage\n\nTo generate an [scoverage](https://github.com/scoverage/scalac-scoverage-plugin) report for unit\ntests run the following command:\n\n```bash\nsbt clean coverage test:test coverageReport coverageAggregate\n```\n\nThe generated report can then be found at `target/scala-2.12/scoverage-report/index.html`\n\n_NOTE_: You should never run coverage at the same time as one-jar because the produced one-jar will\ncontains scoverage instrumented class files and will fail to run.\n\n### Integration Tests\nThere is a suite of integration tests that can be ran by running `sbt clean it:test`\n\n#### Scoverage\n\nAt this time it is not possible to easily generate an scoverage report for the integration suite\nin `cosmos-server`. This is due to some classpath scoping issues related to the cosmos server\nbeing forked before the integration suite is ran.\n\n#### Requirements\n\n- A running DC/OS cluster\n\n#### Running the tests\n\nThe integration tests support three ways of configuring the tests. This is done using the following\nsystem properties:\n\n1. `com.mesosphere.cosmos.dcosUri` - Location of the DC/OS cluster as an HTTP URL.\n1. `com.mesosphere.cosmos.boot` - If `true` or undefined the integration tests will automatically\nexecute the Cosmos defined in this repository. If `false` then the integration tests will not\nexecute a Cosmos.\n1. `com.mesosphere.cosmos.test.CosmosIntegrationTestClient.CosmosClient.uri` - This property is not\nrequired. If set to a URL, it will override the default value. The integration tests assume that\nthe Cosmos described in this system property is configured to control the same cluster described in\n`com.mesosphere.cosmos.dcosUri`\n\n##### Example configurations\n\n1. Run the integration tests against the Cosmos implemented in this repo. This is done by\nautomatically starting an in process ZooKeeper cluster and a Cosmos server that controls a DC/OS\ncluster. This configuration can be enabled by setting the `com.mesosphere.cosmos.dcosUri`\nsystem property.\n\n```bash\nexport COSMOS_AUTHORIZATION_HEADER=\"token=$(http --ignore-stdin \u003cdcos-host-url\u003e/acs/api/v1/auth/login uid=\u003cdcos-user\u003e password=\u003cuser-password\u003e | jq -r \".token\")\"\nsbt -Dcom.mesosphere.cosmos.dcosUri=\u003cdcos-host-url\u003e \\\n    clean it:test\n```\n\n2. Run the integration tests against the Cosmos running in a DC/OS cluster. This configuration can\nbe enabled by setting the `com.mesosphere.cosmos.dcosUri` and `com.mesosphere.cosmos.boot=false`\nsystem properties.\n\n```bash\nexport COSMOS_AUTHORIZATION_HEADER=\"token=$(http --ignore-stdin \u003cdcos-host-url\u003e/acs/api/v1/auth/login uid=\u003cdcos-user\u003e password=\u003cuser-password\u003e | jq -r \".token\")\"\nsbt -Dcom.mesosphere.cosmos.dcosUri=\u003cdcos-host-url\u003e \\\n    -Dcom.mesosphere.cosmos.boot=false \\\n    clean it:test\n```\n\n3. Run the integration tests against a Cosmos already configured to control a DC/OS cluster. This\nconfiguration can be enabled by setting the `com.mesosphere.cosmos.dcosUri`,\n`com.mesosphere.cosmos.boot=false` and\n`com.mesosphere.cosmos.test.CosmosIntegrationTestClient.CosmosClient.uri` system properties.\n\n```bash\nexport COSMOS_AUTHORIZATION_HEADER=\"token=$(http --ignore-stdin \u003cdcos-host-url\u003e/acs/api/v1/auth/login uid=\u003cdcos-user\u003e password=\u003cuser-password\u003e | jq -r \".token\")\"\nsbt -Dcom.mesosphere.cosmos.dcosUri=\u003cdcos-host-url\u003e \\\n    -Dcom.mesosphere.cosmos.boot=false \\\n    -Dcom.mesosphere.cosmos.test.CosmosIntegrationTestClient.CosmosClient.uri=http://localhost:7070 \\\n    clean it:test\n```\n\nTo run a single test, something like the following can be used in the sbt console:\n```bash\n# to run a single test suite\nit:testOnly *ServiceUpdateSpec\n# To run a single test from a single suite\nit:testOnly *ServiceUpdateSpec -- -z \"user should be able to update a service via custom manager\"\n```\n\n## Running Cosmos\n\nCosmos requires a ZooKeeper instance to be available. It looks for one at\n`zk://localhost:2181/cosmos` by default; to override with an alternate `\u003czk-uri\u003e`, specify the flag\n`-com.mesosphere.cosmos.zookeeperUri \u003czk-uri\u003e` on the command line when starting Cosmos (see\nbelow).\n\nWe also need a One-JAR to run Cosmos:\n\n```bash\nsbt oneJar\n```\n\nThe jar will be created in the `cosmos-server/target/scala-2.12/` directory. This can be executed\nwith:\n\n```bash\njava -jar cosmos-server/target/scala-2.12/cosmos-server_2.12-\u003cversion\u003e-SNAPSHOT-one-jar.jar \\\n     -com.mesosphere.cosmos.dcosUri \u003cdcos-host-url\u003e\n```\n\nIt can also be executed with ZooKeeper authentication with:\n\n```bash\nexport ZOOKEEPER_USER \u003cuser\u003e\nexport ZOOKEEPER_SECRET \u003csecret\u003e\njava -jar cosmos-server/target/scala-2.12/cosmos-server_2.12-\u003cversion\u003e-SNAPSHOT-one-jar.jar \\\n     -com.mesosphere.cosmos.dcosUri \u003cdcos-host-url\u003e\n```\n\n### Cosmos Admin Portal\n\nCosmos exposes an admin portal at `http://\u003ccosmos-host\u003e:9990/admin`. If Cosmos is running locally\nand you are just interested in the metrics run the following command.\n\n```bash\ncurl http://localhost:9990/admin/metrics.json\n```\n\n## Project structure\n\nThe code is organized into several subprojects, each of which has a JAR published to the\nSonatype OSS repository. Here's an overview:\n\n* `cosmos-test-common`\n    * `src/main` directory: defines the code and resources used by both the unit and integration\n    tests.\n    * `src/test` directory: defines the unit tests and any resources they require.\n* `cosmos-integration-tests`\n    * `src/main` directory: defines the integration tests and any resources they require.\n* The remaining subprojects define the main code for Cosmos, always within their `src/main`\ndirectories.\n\n### RPC Conventions\n\nAll the list of RPCs that cosmos supports are located in `com/mesosphere/cosmos/rpc` package in the\n`cosmos-common` module. The RPC's are structured according to their version like `v1`, `v2` and so on.\nAs `cosmos` grows, only the two most recent versions of rpc will be supported. Every time a new rpc is\nadded, the oldest rpc will be removed if there are more than two versions. In essence, this means\nthat the tail version should always be considered as deprecated.\n\n## Versions \u0026 Compatibility\n\n### DC/OS\n\nThe following table outlines which version of Cosmos is bundled with each version of DC/OS\n\n| DC/OS Release Version | Cosmos Version |\n|-----------------------|----------------|\n| \u0026ge; 1.6.1            | 0.1.2          |\n| \u0026ge; 1.7.0            | 0.1.5          |\n| \u0026ge; 1.8.0            | 0.2.0          |\n| \u0026ge; 1.8.9            | 0.2.2          |\n| \u0026ge; 1.9.0            | 0.3.0          |\n| \u0026ge; 1.9.1            | 0.3.1          |\n| \u0026ge; 1.10.0           | 0.4.0          |\n\n### Universe\n\n#### Repository Format\n\nThe below table is a compatibility matrix between Cosmos and Universe repository consumption\nformat.\n\n*Rows represent Cosmos versions, columns represent repository formats.*\n\n|       | Version 2 | Version 3     | Version 4     |\n| ----- | ----------|-------------- | --------------|\n| 0.1.x | Supported | Not Supported | Not Supported |\n| 0.2.x | Supported | Supported     | Not Supported |\n| 0.3.x | Supported | Supported     | Not Supported |\n| 0.4.x | Supported | Supported     | Supported     |\n\n\n#### Packaging Version\n\nThe below table is a compatibility matrix between Cosmos and Universe packaging versions.\n\n*Rows represent Cosmos versions, columns represent packaging versions.*\n\n|       |    2.0    |      3.0      |      4.0      |\n| ----- | --------- | ------------- | ------------- |\n| 0.1.x | Supported | Not Supported | Not Supported |\n| 0.2.x | Supported | Supported     | Not Supported |\n| 0.3.x | Supported | Supported     | Not Supported |\n| 0.4.x | Supported | Supported     | Supported     |\n\n## API Documentation\n\n### [Cosmos Version 0.3.x Docs](https://docs.mesosphere.com/1.10/deploying-services/package-api/)\n\n### [Cosmos Version 0.4.x Docs](https://docs.mesosphere.com/1.11/deploying-services/package-api/)\n\nThe tooling for packaging docs is at [mesosphere/packaging-docs](https://github.com/mesosphere/packaging-docs)\n\n## Reporting Problems\n\nIf you encounter a problem that seems to be related to a Cosmos bug, please create an issue at\n[DC/OS Jira](https://jira.mesosphere.com/). To create an issue click on the\n`Create` button at the top and add `cosmos` to the component field.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcos%2Fcosmos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcos%2Fcosmos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcos%2Fcosmos/lists"}