# Pipeline Validator
## Install
You can install the file by using `pip install bbp-atlas-pipeline-validator`
## Examples
You can use the validator in the following way:
```python
from pipeline_validator.pipeline_validator import pipeline_validator
path_to_file = "./my_config.json"
token = "THIS_IS_MY_NEXUS_TOKEN"
whitelisted_vars = ["var1", "var2"]
pipeline_validator(path_to_file, token, whitelisted_vars)
```
where:
- `path_to_file` is the relative path to the configuration
- `token` is a valid nexus token
- `whitelisted_vars` is an array of accepted variables
## Configuration Format
The JSON configuration file should be in the following format:
```json
{
"rules":[
{
"rule": "<NAME_OF_RULE_1>",
"execute":
[
{
"brainRegion": "http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_1>",
"container": "docker://<PATH_TO_DOCKER_IMAGE>",
"command": "<THE COMMAND TO BE EXECUTED>"
},
{
"brainRegion": "http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_2>",
"container": "docker://<PATH_TO_DOCKER_IMAGE>",
"command": "<THE COMMAND TO BE EXECUTED>"
}
]
},
{
"rule": "<NAME_OF_RULE_2>",
"execute":
[
{
"brainRegion": "http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_1>",
"container": "docker://<PATH_TO_DOCKER_IMAGE>",
"command": "<THE COMMAND TO BE EXECUTED>"
},
{
"brainRegion": "http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_2>",
"container": "docker://<PATH_TO_DOCKER_IMAGE>",
"command": "<THE COMMAND TO BE EXECUTED>"
}
]
}
]
}
```
## Validation Criteria
The following criteria need to be met in order for the configuration to be validated:
- The configuration need to follow the above JSON schema
- Brain region ID should be valid (exist in brain region ontology)
- Within each rule, each brain region need to be followed by brain region that are not related or that they are descendants in the ontology
- For each command, the variables passed need to be part of the whitelisted variables
## Funding & Acknowledgment
The development of this software was supported by funding to the Blue Brain Project, a
research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss
government’s ETH Board of the Swiss Federal Institutes of Technology.
Copyright © 2023-2024 Blue Brain Project/EPFL
Raw data
{
"_id": null,
"home_page": null,
"name": "bbp-atlas-pipeline-validator",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Blue Brain Project, EPFL",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/da/c2/542dcee3428fc4dc91d2868b5cfcbe0180c31f1d117684bdea1653d4a50e/bbp_atlas_pipeline_validator-0.4.0.tar.gz",
"platform": null,
"description": "# Pipeline Validator\n\n\n## Install\n\nYou can install the file by using `pip install bbp-atlas-pipeline-validator`\n\n\n## Examples\n\nYou can use the validator in the following way:\n\n```python\nfrom pipeline_validator.pipeline_validator import pipeline_validator\n\npath_to_file = \"./my_config.json\"\ntoken = \"THIS_IS_MY_NEXUS_TOKEN\"\nwhitelisted_vars = [\"var1\", \"var2\"]\n\npipeline_validator(path_to_file, token, whitelisted_vars)\n```\n\nwhere:\n\n- `path_to_file` is the relative path to the configuration\n- `token` is a valid nexus token\n- `whitelisted_vars` is an array of accepted variables\n\n\n## Configuration Format\n\nThe JSON configuration file should be in the following format:\n\n```json\n{\n \"rules\":[\n {\n \"rule\": \"<NAME_OF_RULE_1>\",\n \"execute\":\n [\n {\n \"brainRegion\": \"http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_1>\",\n \"container\": \"docker://<PATH_TO_DOCKER_IMAGE>\",\n \"command\": \"<THE COMMAND TO BE EXECUTED>\"\n },\n {\n \"brainRegion\": \"http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_2>\",\n \"container\": \"docker://<PATH_TO_DOCKER_IMAGE>\",\n \"command\": \"<THE COMMAND TO BE EXECUTED>\"\n }\n ]\n },\n {\n \"rule\": \"<NAME_OF_RULE_2>\",\n \"execute\":\n [\n {\n \"brainRegion\": \"http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_1>\",\n \"container\": \"docker://<PATH_TO_DOCKER_IMAGE>\",\n \"command\": \"<THE COMMAND TO BE EXECUTED>\"\n },\n {\n \"brainRegion\": \"http://api.brain-map.org/api/v2/data/Structure/<BRAIN_REGION_ID_2>\",\n \"container\": \"docker://<PATH_TO_DOCKER_IMAGE>\",\n \"command\": \"<THE COMMAND TO BE EXECUTED>\"\n }\n ]\n }\n ]\n}\n```\n\n\n## Validation Criteria\n\nThe following criteria need to be met in order for the configuration to be validated:\n\n- The configuration need to follow the above JSON schema\n- Brain region ID should be valid (exist in brain region ontology)\n- Within each rule, each brain region need to be followed by brain region that are not related or that they are descendants in the ontology\n- For each command, the variables passed need to be part of the whitelisted variables\n\n\n## Funding & Acknowledgment\n\nThe development of this software was supported by funding to the Blue Brain Project, a \nresearch center of the \u00c9cole polytechnique f\u00e9d\u00e9rale de Lausanne (EPFL), from the Swiss \ngovernment\u2019s ETH Board of the Swiss Federal Institutes of Technology.\n\nCopyright \u00a9 2023-2024 Blue Brain Project/EPFL\n",
"bugtrack_url": null,
"license": null,
"summary": "A pipeline validator for Blue Brain Project",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/BlueBrain/bbp-atlas-pipeline-validator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9a6777aed96ffb73071cb91d461ed78c40e5cecc29a71a6b22a776da1b6beec0",
"md5": "a47a2449e1fe8bee45249b443beeb0cb",
"sha256": "b536004a199c3d6752681d0b2eba01e37d4e80cf4b5fc3acb1081af57e29bd3c"
},
"downloads": -1,
"filename": "bbp_atlas_pipeline_validator-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a47a2449e1fe8bee45249b443beeb0cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17073,
"upload_time": "2024-10-03T15:00:50",
"upload_time_iso_8601": "2024-10-03T15:00:50.494422Z",
"url": "https://files.pythonhosted.org/packages/9a/67/77aed96ffb73071cb91d461ed78c40e5cecc29a71a6b22a776da1b6beec0/bbp_atlas_pipeline_validator-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dac2542dcee3428fc4dc91d2868b5cfcbe0180c31f1d117684bdea1653d4a50e",
"md5": "42d998896b7c38c3e2a1d5be29df01d3",
"sha256": "6722dbe1d10f5b1cdd4b16e2901f439ef647fb89711315a17e9337903a721019"
},
"downloads": -1,
"filename": "bbp_atlas_pipeline_validator-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "42d998896b7c38c3e2a1d5be29df01d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15417,
"upload_time": "2024-10-03T15:00:51",
"upload_time_iso_8601": "2024-10-03T15:00:51.965244Z",
"url": "https://files.pythonhosted.org/packages/da/c2/542dcee3428fc4dc91d2868b5cfcbe0180c31f1d117684bdea1653d4a50e/bbp_atlas_pipeline_validator-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-03 15:00:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "BlueBrain",
"github_project": "bbp-atlas-pipeline-validator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bbp-atlas-pipeline-validator"
}