{"id":26864403,"url":"https://github.com/ad4gd/sta-generationservice","last_synced_at":"2025-03-31T03:39:09.133Z","repository":{"id":277163787,"uuid":"931535700","full_name":"AD4GD/STA-GenerationService","owner":"AD4GD","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-12T13:02:43.000Z","size":2020,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T13:59:36.177Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AD4GD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/_audits_environment","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T12:51:42.000Z","updated_at":"2025-02-12T13:02:47.000Z","dependencies_parsed_at":"2025-02-12T14:09:51.397Z","dependency_job_id":null,"html_url":"https://github.com/AD4GD/STA-GenerationService","commit_stats":null,"previous_names":["ad4gd/sta-generationservice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AD4GD%2FSTA-GenerationService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AD4GD%2FSTA-GenerationService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AD4GD%2FSTA-GenerationService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AD4GD%2FSTA-GenerationService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AD4GD","download_url":"https://codeload.github.com/AD4GD/STA-GenerationService/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413263,"owners_count":20773053,"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-03-31T03:39:08.500Z","updated_at":"2025-03-31T03:39:09.112Z","avatar_url":"https://github.com/AD4GD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Environment setup\n\n#### First run\n\nRun following command:\n\n    ./devstack config\n\nIt will create `compose/.env` file after prompting to specify docker registry to use, etc.\nIt will also create empty `compose/local.yaml` file.\n\nIn fact running any compose script will create those file if they are missing.\n\nOne should read carefully output of `./devstack config` to check resolved parameters correctness.\n\n#### Environment variables\n\nDocker compose files are expecting the following environment variables:\n\n* REGISTRY_DOMAIN -- most likely `registry.paas.psnc.pl`\n* IMAGE_TAG -- most likely `branch-develop`\n* REPO_DIR -- location of the repo (when using docker-machine it should be path inside virtual machine)\n\nThis variables should be defined in [`compose/.env`][1] file.\nTheir definition in some kind of shell alias or script is probably also possible but not officialy supported.\n\n#### IMAGE_TAG\n\nIMAGE_TAG environment variable can be filled for:\n* specific remote branch, e.g. for branch \"test_solution\" IMAGE_TAG shoud be set to \"branch-test_solution\",\n* specific commit from repository, e.g. for commit hash \"1f6876ec4785a3f8de65287bd58d962f562ecfb1\" IMAGE_TAG should be set to \"commit-1f6876ec4785a3f8de65287bd58d962f562ecfb1\",\n* image built locally, that won't be pushed to registry - IMAGE_TAG should be set to \"local-build\".\n\nFor IMAGE_TAG variable slashes (\"/\") should be replaced with dashes (\"-\"), e.g. for branch \"test/solution\" IMAGE_TAG should be set to \"branch-test-solution\".\n\n#### Instance settings\n\nOne may use `compose/local.yaml` file, where should go every runtime parameters specific to the local instance.\nFile must be proper compose file, which must include at least version numer. This file is not tracked in git.\nThis file is automatically created on first run.\n\n#### Domain name\n\nOne must setup local domain name resolution for the project's domain. It could be done by adding docker machine IP address to the _hosts_ file:\n\n* `/etc/hosts` -- on unix;\n* `c:\\windows\\system32\\drivers\\etc\\hosts` -- on windows.\n\n\n    # check machines IP address\n    $ docker-machine ip [machine name]\n    192.168.99.100\n\n    # line to add to hosts file\n    192.168.99.100  localhost.sta\n\n\n## Running development stack\n\n    cd bin\n    ./devstack up\n\nAfter above command is run, server should listen at: http://localhost.sta.\nAny changes made in the source files will be available without a need for restarting containers.\n\n#### First run\n\nAfter first project start-up, database migration could be needed:\n\n    ./devstack exec django manage migrate\n\n## Running tests\n\nRun default tests with code coverage:\n\n    cd bin\n    ./devtests run django\n\n#### Additional py.test arguments\n\n    ./devtests run django py.test -vv -x -k some_test\n\n#### Running test coverage (also accepts py.test arguments)\n\n    ./devtests run django test.coverage -vv -x\n\n#### Interactive shell\n\n    ./devtests run django bash\n\n\n## Code audit\n\n#### Code quality audit\nCode audit command is used to keep good code quality during development.\nAudit can be run locally by executing below command. Existing problems will be printed out to the standard output.\n\n    source venv/bin/activate\n    pip install pre-commit\n    pre-commit run -a\nConfuguration of pre-commit tool is done in file .pre-commit-config.yaml.\n\n#### Packages dependencies compatibility\nCompatibility of required packages' dependencies could be checked with command:\n\n    ./devaudit run dependencies-pip-check\n\n#### Vulnerability check\nIt is possible to find known vulnerabilities for current project (requirements file).\nPython package \"safety\" (https://github.com/pyupio/safety) is used with default vulnerabilities database from https://pyup.io/\nVulnerability check can be run by typing:\n\n    ./devaudit run vulnterability-check\n\n#### Django deployment potential problems detection\n\nPotential django problems with deployment settings can be detected by typing:\n\n    ./devaudit run manage-check\n\n#### Check packages licenses\n\nConfig file licenses.ini contains list of authorized license types for installed python packages. You can perform licenses audit for project by typing:\n\n    ./devaudit run license-check\n\nAll available licenses can be found here: https://pypi.org/pypi?%3Aaction=list_classifiers\nEdit licenses.ini file to add new authorized license type.\n\n#### Security check\n\nSecurity audit for current project can be run by typing\n\n    ./devtests run security-check\n\nConfig file bandit.ini contains test types that should be run or skipped. Test types are available here: https://bandit.readthedocs.io/en/stable/plugins/index.html#complete-test-plugin-listing\n\n## Openshift deployment\n\n### Prerequisites\n\nDeployment configurations requires kubernetes cluster with configured dynamic volume provisioning.\n\nDeployment is based on ansible playbooks -- every ansible command requires inventory file\nwhich can be specified with environment variable:\n\n    export ANSIBLE_INVENTORY=\u003cabsolute path to inventory file\u003e\n\n### First time configuration\n\nConfigure docker secret for pulling images in openshift project:\n\n    oc create secret docker-registry regcred --docker-server=registry.paas.psnc.pl --docker-username=\u003c...\u003e --docker-password=\u003c...\u003e\n    oc secrets add serviceaccount/default secrets/regcred --for=pull\n\nSet name of the secret created above in the inventory as `image_pull_secret`.\n\n### Code deployment\n\nFirst and each subsequent deployment is run performed using command:\n\n    ansible-playbook -i \u003cinventory-file\u003e -e image_tag=\u003c...\u003e deploy-all-and-test.yaml\n\nDuring deployment process playbook checks for existance of some global settings (like docker registry secret) and if those settings are not provided, it will stop and ask for action.\n\nSee [docs/deployment.md](docs/deployment.md) more information.\n\n### Certificates\nTO DO\n\n### License \u003ca name=\"license\"\u003e\u003c/a\u003e\n\nThe Linked Data Pipelines has an MIT License, as found in the [LICENSE](LICENSE) file.\n\n![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/License_icon-mit.svg/384px-License_icon-mit.svg.png)\n\n## References\n\n[1]: https://docs.docker.com/compose/env-file/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad4gd%2Fsta-generationservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad4gd%2Fsta-generationservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad4gd%2Fsta-generationservice/lists"}