{"id":15906659,"url":"https://github.com/climbsrocks/orchestrator","last_synced_at":"2025-04-02T23:20:28.816Z","repository":{"id":80566144,"uuid":"54686218","full_name":"ClimbsRocks/orchestrator","owner":"ClimbsRocks","description":"A basic task scheduler","archived":false,"fork":false,"pushed_at":"2016-03-28T15:36:36.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-08T13:31:02.327Z","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/ClimbsRocks.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":"2016-03-25T01:42:50.000Z","updated_at":"2016-12-07T23:47:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"b571d413-7dd3-47bf-a566-6e0dbdf79a35","html_url":"https://github.com/ClimbsRocks/orchestrator","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/ClimbsRocks%2Forchestrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Forchestrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Forchestrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClimbsRocks%2Forchestrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClimbsRocks","download_url":"https://codeload.github.com/ClimbsRocks/orchestrator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246906551,"owners_count":20852945,"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-10-06T13:41:12.333Z","updated_at":"2025-04-02T23:20:28.788Z","avatar_url":"https://github.com/ClimbsRocks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# orchestrator\n\u003e Schedule a series of API calls\n\n## Installation\n`pip install -r requirements.txt`\n\n## API\n\n### `orchestrator.schedule`\nArguments:\n- http_address: the http address of the task. `orchestrator` will make a request to this address, and save the results.\n- time_delay: the time delay before this task is run, given in seconds from when `orchestrator.start()` is invoked.\n- does_repeat: boolean value representing whether this task should repeat or not. If it does repeat, we assume it will repeat on a pattern following the same delay given in time_delay.\n\nReturns: \ntaskID. This is a numeric ID for the task that was just scheduled. This ID can be used to retrieve the status/results of the task.\n\n### `orchestrator.getResults`\nArguments:\n- taskID: the ID of a task that was previously scheduled.\n\nReturns:\nA list of results showing the full status of each attempt. This starts with a note saying the task was scheduled, and includes the error or results for each time we attempted to run this task. \n\n### `orchestrator.start`\nArguments: None\nReturns: None\nThis method simply states that we have scheduled our tasks, and are ready to begin running them, after the given delays. This is when the clock starts. \n\n## Example Usage\n1. Save `orchestrator.py` into the desired directory.\n2. Inside your python code, \n```python\nfrom orchestrator import Orchestrator\n\nor1 = Orchestrator()\n\n# attempt a failure case- this URL has a typo\ntaskID1 = or1.schedule('http://presotnparry.com',2)\ntaskID2 = or1.schedule('http://github.com/climbsrocks',1)\n\nor1.start()\nprint taskID1\n\ntask1Results = or1.get_results(taskID1)\nprint task1Results\n\n```\n\n\n### Error Handling\nOrchestrator will continue to run, even if one of the tasks errors out for any reason. A failing task will be retried 3 times. Any errors that are encountered, whether the eventual result is a success or not, will be saved into the results for that task. This gives the user an accurate log, which might be useful to figure out where to put in some maintenance work. Orchestrator will continue to run all other scheduled tasks as normal. \n\n\n#### Assumptions\n\nIf we were in-person and could go back and forth on this rapidly, I would phrase these as questions and test how well we can collaborate. Instead, they will simply be design decisions that could be relatively easily modified if design requirements change. \n\n  1. The user will give us a time (in seconds), representing how far in the future they would like the given task to be run. \n  2. The user will give us the http address of the API endpoint as one of the inputs to the orchestrator.\n  3. Each API request should be a GET request.\n  4. Recurring requests will take in a time (in seconds) between executions of the given task (even though a cron job is mostly likely better suited for this). \n  5. Recurring tasks will recur forever on that same fixed interval.\n  6. A task cannot be canceled once scheduled. \n  7. There is no way to access all tasks at once.\n  8. The user can come back to ask orchestrator for the results of a task. In this way, we avoid introducing asynchronicity to the Python codebase, which likely doesn't have much asynch code yet. If this were in JS, we'd definitely be going asynch and returning promises! \n  9. The http address given by the user will represent the full URL, without needing to add in query parameters or anything else.\n  10. A task that fails will retry 3 times before admitting total defeat. We will save an error message as the \"result\" for this task.\n  11. We are going to assume the user is smart enough to use this in a thread they are not running anything else in, as orchestrator will be blocking in that thread. We could redesign it to be non-blocking, but for now we are deciding that is not in the MVP scope. \n  12. The user will schedule all of their tasks at once.\n  13. All API calls will be GETs. \n  14. The \"results\" of a successfully completed task is the text of the response, while the \"results\" for a failed task is information about the error. \n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimbsrocks%2Forchestrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclimbsrocks%2Forchestrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclimbsrocks%2Forchestrator/lists"}