{"id":24641203,"url":"https://github.com/elixir-cloud-aai/mock-drs","last_synced_at":"2025-10-07T02:30:48.805Z","repository":{"id":45233759,"uuid":"190434418","full_name":"elixir-cloud-aai/mock-DRS","owner":"elixir-cloud-aai","description":"Connexion-based mock-up service implementing the GA4GH Data Repository Service API schema","archived":false,"fork":false,"pushed_at":"2023-08-15T11:15:10.000Z","size":98,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":19,"default_branch":"dev","last_synced_at":"2023-08-15T12:40:58.108Z","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/elixir-cloud-aai.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":"2019-06-05T16:57:03.000Z","updated_at":"2023-02-20T09:54:49.000Z","dependencies_parsed_at":"2023-01-31T09:16:06.165Z","dependency_job_id":null,"html_url":"https://github.com/elixir-cloud-aai/mock-DRS","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fmock-DRS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fmock-DRS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fmock-DRS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cloud-aai%2Fmock-DRS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-cloud-aai","download_url":"https://codeload.github.com/elixir-cloud-aai/mock-DRS/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235575672,"owners_count":19012159,"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":[],"created_at":"2025-01-25T12:12:38.210Z","updated_at":"2025-10-07T02:30:43.457Z","avatar_url":"https://github.com/elixir-cloud-aai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mock-DRS\n\n[![Apache License](https://img.shields.io/badge/license-Apache%202.0-orange.svg?style=flat\u0026color=important)](http://www.apache.org/licenses/LICENSE-2.0)\n\n[Connexion]-based mockup service implementing parts of the GA4GH [Data Repository\nService] (DRS) API schema. The service was developed to implement and test\n[TEStribute], a task distribution logic package for TES instances.\n\n## Usage\n\nOnce deployed and started ([see below](#Deployment)), the service is available at:  \n\u003chttp://localhost:9101/ga4gh/drs/v1/\u003e\n\nYou can explore the service via the Swagger UI:\n\n```bash\nfirefox http://localhost:9101/ga4gh/drs/v1/ui/\n```\n\nThe specifications, in JSON format, can be retrieved with:\n\n```bash\nwget http://localhost:9101/ga4gh/drs/v1/swagger.json\n```\n\n\u003e Note that host and port can be set manually in the [config] file. In that\n\u003e case, the values in the URLs above need to be replaced as well.\n\nThe client [DRS-cli] can be used to send requests to the service.\n\n## Deployment\n\n`mock-DRS` can be deployed via containers (preferred) or after manual\ninstallation of all dependencies.\n\nIn both cases, the repository first needs to be cloned with:\n\n```bash\ngit clone git@github.com:elixir-europe/mock-DRS.git\n```\n\nAfterwards traverse to the repository's root directory:\n\n```bash\ncd mock-DRS\n```\n\n### Containerized Deployment\n\n\u003e \"Production-like\" containerized deployment without HTTP server/load balancer\n\u003e etc.\n\n#### Requirements (containerized deployment)\n\n- [Git] (tested with version 2.17.1)\n- [Docker] (tested with version 18.09.6)\n- [docker-compose] (tested with version 1.24.0)\n\n#### Building \u0026 starting the service\n\n```bash\n# Build application image\n# [NOTE] Image re-building is not always necessary. Inspect the `Dockerfile`\n#        to check which changes will need re-building.\ndocker-compose build\n# Start service\ndocker-compose up -d\n```\n\n#### Other useful commands\n\n```bash\n# Check logs\ndocker-compose logs\n# Shut down service\ndocker-compose down\n```\n\n### Non-containerized deployment\n\n\u003e Deployment for local development without containers, HTTP server/load\n\u003e balancer etc.\n\n#### Requirements (non-containerized deployment)\n\n- [Git] (tested with version 2.17.1)\n- [Python] (tested with versions 2.7.15+ \u0026 3.6.8)\n- [pip] (tested with version 19.1.1)\n- [virtualenv] (tested with version 15.1.0)\n\n#### Installing \u0026 starting the service\n\n```bash\n# Set up Python virtual environment\nvirtualenv -p `which python3` venv\nsource venv/bin/activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Install app\npython setup.py develop\n\n# Run service\npython mock_drs/Server.py\n```\n\n\u003e **IMPORTANT:** You will also need to replace host `mongo` with `localhost` in\n\u003e the `database` section of the [config] file.\n\n## Implementation details\n\nNote that only those parts of the service are implemented that are required for\ndeveloping, testing and debugging [TEStribute]. For all other endpoints only\nstubs are implemented that return the most basic valid response (typically an\n\"empty\" JSON object).\n\n### Assumptions not warranted by DRS specifications\n\n- As the current [DRS specifications] do not provide a means to identify\n  identical objects across DRS instances (e.g., via a mandatory checksum),\n  [TEStribute] assumes that DRS identifiers (property `id` of `Object` model)\n  are globally unique across the network of DRS instances. While this assumption\n  is not warranted by the specifications, it might perhaps be possible to\n  enforce a common naming scheme at least within a given organization, until a\n  more sustainable solution arises.\n\n### The DRS Database\n\nWhen starting the service, the DRS is automatically populated with a set of\nobjects from a [data objects] file. The identifiers of the objects that the\ndatabase is populated with are in turn specified in the [config] file.\n\n#### Custom data objects\n\n\u003e **IMPORTANT:** When populating DRS instances for the use with [TEStribute]\n\u003e in the manner described here, you **must** ensure that all object identfiers\n\u003e are globally unique across the entire network of connected/used DRS services.\n\u003e See the section on [assumptions not warranted by DRS\n\u003e specifications](#assumptions-not-warranted-by-drs-specifications) for\n\u003e details.\n\nThe service can be configured to be started with different data objects by\nfirst editing/amending the [data objects] file and then editing the\n`database -\u003e objects` section of the [config] file before starting the service.\nOnly objects specified in [data objects] are available to the DRS service at\nstartup, so make sure that any object that is added to the [config] file has a\ncorresponding entry in the [data objects] file.\n\nAlternatively (and preferably), objects available to the DRS can be modified\nin the running service via the `/update-db` endpoint, which is particularly\nuseful for setting up environments for various testing scenarios for\n[TEStribute]. The endpoint is defined in a dedicated [OpenAPI] [specification]:\n\n```yaml\n    /update-db:\n    post:\n      summary: Object id's in the array that need to be added to the db\n      operationId: updateDatabaseObjects\n      consumes:\n        - application/json\n      produces:\n        - application/json\n      parameters:\n        - name: body\n          in: body\n          description: ''\n          schema:\n            $ref: '#/definitions/UpdateObject'\n          required: true\n      responses:\n        200:\n          description: \"200 response\"\n          schema:\n              $ref: '#/definitions/UpdatedDB'\n      tags:\n        - DataRepositoryService\n      x-swagger-router-controller: ga4gh.drs.server\n```\n\nIt relies on the following models:\n\n```yaml\nUpdatedDB:\n  type: object\n  properties:The service can be configured with different unit costs for CPU and memory\n    objects:\n      type: ausage, data transfer and storage. Default values for the corresponding\n      items:\n        type:parameters are listed in `task_info` section of the service's [config] and they\nUpdateObject:can be edited by the user before starting the service.\n  type: object\n  properties:\n    clear:\n      type: boolean\n    data_objects:\n      type: array\n      items:\n        $ref: '#/definitions/Object'\n```\n\nThe model `UpdateObject` in turn relies on the `Object` model of the [DRS\nspecifications], commit [`cd0186f`], a [snapshot] of which is also shipped with\nthis repository.\n\n[DRS-cli] can be used to communicate with the `/update-db` endpoint.\n\n\u003e Note that while the `/update-db` endpoint can be accessed via the same root\n\u003e URI (and explored via the Swagger UI), it was not included in the [DRS\n\u003e specifications], but rather is added to it _on the fly_ when the service\n\u003e service is started.  \n\n## Contributing\n\nThis project is a community effort and lives off your contributions, be it in\nthe form of bug reports, feature requests, discussions, or fixes and other code\nchanges. Please read the [contributing guidelines] if you want to contribute.\nAnd please mind the [code of conduct] for all interactions with the community.\n\n## Versioning\n\nDevelopment of the app is currently still in alpha stage, and current versioning\nis for internal use only. In the future, we are aiming to adopt [semantic\nversioning] that is synchronized to the versioning of [TEStribute] and\n[DRS-cli] in order to ensure that these apps will be compatible as long as both\ntheir major and minor versions match.\n\n## License\n\nThis project is covered by the [Apache License 2.0] also available [shipped\nwith this repository](LICENSE).\n\n## Contact\n\nPlease contact the [project leader](mailto:alexander.kanitz@sib.swiss) for\ninquiries, proposals, questions etc. that are not covered by the\n[Contributing](#Contributing) section.\n\n## Acknowledgments\n\nThe project is a collaborative effort under the umbrella of the [ELIXIR Cloud\nand AAI] group. It was started during the [2019 Google Summer of Code] as part\nof the [Global Alliance for Genomics and Health] [organization].\n\n![logo banner]\n\n[2019 Google Summer of Code]: \u003chttps://summerofcode.withgoogle.com/projects/#6613336345542656\u003e\n[Apache License 2.0]: \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e\n[`cd0186f`]: \u003chttps://github.com/ga4gh/data-repository-service-schemas/blob/cd0186fa9b7763bdb15175e6615ff4a42c1b85c3/openapi/data_repository_service.swagger.yaml\u003e\n[code of conduct]: CODE_OF_CONDUCT.md\n[config]: mock_drs/config/app_config.yaml\n[Connexion]: \u003chttps://github.com/zalando/connexion\u003e\n[data objects]: mock_drs/database/data_objects.json\n[Docker]: \u003chttps://docs.docker.com/install/\u003e\n[docker-compose]: \u003chttps://docs.docker.com/compose/install/\u003e\n[specification]: mock_drs/specs/schema.data_repository_service.update_db.openapi.yaml\n[contributing guidelines]: CONTRIBUTING.md\n[Data Repository Service]: \u003chttps://github.com/ga4gh/data-repository-service-schemas\u003e\n[DRS-cli]: \u003chttps://github.com/elixir-europe/DRS-cli\u003e\n[DRS specifications]: \u003chttps://github.com/ga4gh/data-repository-service-schemas\u003e\n[ELIXIR Cloud and AAI]: \u003chttps://elixir-europe.github.io/cloud/\u003e\n[snapshot]: mock_drs/specs/schema.data_repository_service.cd0186f.openapi.yaml\n[Git]: \u003chttps://git-scm.com/book/en/v2/Getting-Started-Installing-Git\u003e\n[Global Alliance for Genomics and Health]: \u003chttps://www.ga4gh.org/\u003e\n[logo banner]: logos/logo-banner.svg\n[OpenAPI]: \u003chttps://swagger.io/specification/\u003e\n[organization]: \u003chttps://summerofcode.withgoogle.com/organizations/6643588285333504/\u003e\n[pip]: \u003chttps://pip.pypa.io/en/stable/installing/\u003e\n[Python]: \u003chttps://www.python.org/downloads/\u003e\n[semantic versioning]: \u003chttps://semver.org/\u003e\n[TEStribute]: \u003chttps://github.com/elixir-europe/TEStribute\u003e\n[virtualenv]: \u003chttps://virtualenv.pypa.io/en/stable/installation/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cloud-aai%2Fmock-drs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-cloud-aai%2Fmock-drs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cloud-aai%2Fmock-drs/lists"}