{"id":21495713,"url":"https://github.com/deepgram/devops-onsite","last_synced_at":"2025-03-17T12:14:27.651Z","repository":{"id":105856357,"uuid":"455585087","full_name":"deepgram/devops-onsite","owner":"deepgram","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-12T18:19:19.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-23T21:51:18.094Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepgram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-02-04T14:51:00.000Z","updated_at":"2022-02-04T14:51:28.000Z","dependencies_parsed_at":"2023-06-14T13:00:41.332Z","dependency_job_id":null,"html_url":"https://github.com/deepgram/devops-onsite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdevops-onsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdevops-onsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdevops-onsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdevops-onsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepgram","download_url":"https://codeload.github.com/deepgram/devops-onsite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031153,"owners_count":20386534,"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":"2024-11-23T16:13:01.346Z","updated_at":"2025-03-17T12:14:27.638Z","avatar_url":"https://github.com/deepgram.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevOps at Deepgram\n\nThanks for your interest in devops at Deepgram! This is a template project that we will experiment\nwith during your on-site interview.\n\n# Setup and Installation\n\nCreate/activate a virtual environment, then:\n\n```bash\n$ pip install -e .\n```\n\nAn obsolete way of installing is:\n\n```bash\n$ python setup.py install\n```\n\nAnd an obsolete way of install dependencies is:\n\n```bash\n$ pip install -r requirements.txt\n```\n\n# Running the Service\n\n```bash\n$ gram\n```\n\n# Description\n\nThe project is a simple web server, powered by the Tornado web framework.\n\nTo register a new route handlers, we derive from Tornado's `RequestHandler`.\nShared application state can be handed off to Tornado when the request handlers\nare registered. Registration occurs in `src/gram/__main__.py:main`.\n\nWe create a custom global state object (`State`), defined in `src/gram/state.py`. This can be used\nfor holding global application state (number of active requests, etc.).\n\nIn order to make dependency injection easy, we create our own base class for our request handlers.\nThis `BaseHandler`, defined in `src/gram/handlers/__init__.py`, derives from Tornado's\n`RequestHandler`. This centralizes some simple tasks, such as reporting to the `Status` object,\nwhich helps us not to repeat ourselves.\n\nThe handlers themselves live in `src/gram/handlers` and do a number of things:\n\n- `/` (`MainHandler`): just returns a static message with a 200 response code.\n- `/sleep/{sleep}` (`SleepHandler`): sleeps for `sleep` milliseconds and then returns a 200.\n- `/code/{code}` (`CodeHandler`): immediately returns a `code` status code.\n- `/work` (`WorkHandler`): mimics a fallible workload by sleeping for a random duration and then\n  returning a weighted, random status code.\n- `/status` (`StatusHandler`): a TODO handler for querying service metrics.\n- `/health` (`HealthHandler`): a TODO handler for returning service health.\n\n# Docker\n\nA Dockerfile is provided for containerizing the service. To build it:\n\n```\n$ docker build -t deepgram/devops-onsite:latest .\n```\n\nAnd to run it:\n\n```\n$ docker run --rm -p 8080:8080 deepgram/devops-onsite:latest\n```\n\n# Tests\n\nThis is set up for testing using `pytest`.\n\nFirst, install `pytest`:\n\n```bash\n$ pip install pytest\n```\n\nThen you can do:\n\n```bash\n$ pytest\n```\n\nor\n\n```bash\n$ python -m pytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fdevops-onsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepgram%2Fdevops-onsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fdevops-onsite/lists"}