{"id":17917378,"url":"https://github.com/pushkarm029/task_scheduler_py","last_synced_at":"2026-05-05T14:33:35.480Z","repository":{"id":226711483,"uuid":"769309320","full_name":"Pushkarm029/Task_Scheduler_Py","owner":"Pushkarm029","description":"Python script || K8s jobs provides a simple task scheduling service using MariaDB as the backend database. It allows users to create, read, update, and delete tasks with optional recurrence settings.","archived":false,"fork":false,"pushed_at":"2024-03-12T09:22:55.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T07:44:47.175Z","etag":null,"topics":["docker","helm","kubernetes","mariadb","python"],"latest_commit_sha":null,"homepage":"","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/Pushkarm029.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":"2024-03-08T19:24:32.000Z","updated_at":"2024-07-09T05:05:25.000Z","dependencies_parsed_at":"2024-12-16T03:42:27.571Z","dependency_job_id":"a0a7ef5d-ee46-4596-951d-51fb4e684be6","html_url":"https://github.com/Pushkarm029/Task_Scheduler_Py","commit_stats":null,"previous_names":["pushkarm029/task_scheduler_py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pushkarm029/Task_Scheduler_Py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pushkarm029%2FTask_Scheduler_Py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pushkarm029%2FTask_Scheduler_Py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pushkarm029%2FTask_Scheduler_Py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pushkarm029%2FTask_Scheduler_Py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pushkarm029","download_url":"https://codeload.github.com/Pushkarm029/Task_Scheduler_Py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pushkarm029%2FTask_Scheduler_Py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32653584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","helm","kubernetes","mariadb","python"],"created_at":"2024-10-28T20:06:35.118Z","updated_at":"2026-05-05T14:33:35.460Z","avatar_url":"https://github.com/Pushkarm029.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Task-Scheduler.Py\nThis Python script provides a simple task scheduling service using MariaDB as the backend database. It allows users to create, read, update, and delete tasks with optional recurrence settings.:\n\n## Features\n- Task Management: Create, read, update, and delete tasks.\n- Recurrence Support: Tasks can be set to recur daily, weekly, or monthly.\n- Execution: Automatically executes tasks at their scheduled times.\n\n## Tech Stack\n- Python\n- Helm\n- Kubernetes\n- Docker\n\n## How to run?\n\n### Locally (Challenge 1 (Programming))\n```bash\n# install all required dependencies\npip install --no-cache-dir -r requirements.txt\n\n# Start mariadb container\ndocker compose up\n\n# Create Task\npython task_scheduler.py create \u003cname\u003e \u003cscheduled_time\u003e [recurrence]\n\n# Example\npython task_scheduler.py create \"Task Name\" \"2024-03-13 10:00:00\" daily\n\n# Read Tasks\npython task_scheduler.py read\n\n# Delete Task\npython task_scheduler.py delete \u003ctask_id\u003e\n\n# Example\npython task_scheduler.py delete '0a9c0a93-f8df-43d5-8b00-e0340bc78e65'\n\n# Update Task\npython task_scheduler.py update \u003ctask_id\u003e \u003cnew_name\u003e \u003cnew_scheduled_time\u003e [recurrence]\n\n# Example\npython task_scheduler.py update '2cadf6af-a941-4321-98cb-7d4aac68e54d' pm \"2024-03-13 10:00:00\" monthly\n```\n\n### K8s Environment (Challenge 2 (Helm))\n```bash\n# Start k8s cluster locally\nminikube start\n\n# Deploy MariaDB HELM chart\nhelm install my-release oci://registry-1.docker.io/bitnamicharts/mariadb\n\n# wait for MariaDB to start\nkubectl get pods -w --namespace default -l app.kubernetes.io/instance=my-release\n\n# password setup\nchmod +x update-passwords.sh # give permission to script file\n\n./setpass.sh # run script to set password\n\n# Create Task\nhelm install -f ./createjob/values.yaml createjob ./createjob --set taskName=example-task,scheduledTime=\"2024-03-13 10:00:00\",recurrence=daily\n\n# Read Task\nhelm install -f ./readjob/values.yaml readjob ./readjob\n\n# Delete Task\nhelm install -f ./deletejob/values.yaml deletejob ./deletejob --set taskId=2cadf6af-a941\n\n# Update Task\nhelm install -f ./updatejob/values.yaml updatejob ./updatejob --set taskId=2cadf6af-a941,newName=example-task2,newScheduledTime=\"2024-03-13 10:00:00\",newRecurrence=daily\n```\n\n### Build Docker Image\n```bash\ndocker build -t pushkarm029/my-task-scheduler .\n```\n\n## How It Works\n### Task Creation:\n\n- Users can create tasks by providing a name, scheduled time, and optional recurrence setting (daily, weekly, monthly).\n- Tasks are stored in a MySQL database with a unique identifier (id), name, scheduled time, and recurrence information.\n\n### Task Execution: \n- The service continuously checks for tasks scheduled to be executed.\n- Upon reaching their scheduled time, tasks are automatically executed.\n- Execution involves a simulated delay of random duration (1 to 5 seconds) to mimic task processing.\n\n### Recurrence Handling:\n\n- Recurring tasks are automatically updated with their next scheduled time after execution.\n- Daily tasks increment their scheduled time by 24 hours.\n- Weekly tasks increment their scheduled time by 7 days.\n- Monthly tasks move to the next month's equivalent date.\n\n### User Interaction:\n\nUsers can interact with the service through command-line commands (create, read, update, delete).\nThese commands allow users to manage tasks effectively, including viewing, updating, and deleting tasks.\n\n### Environment Configuration:\n\n- The service can adapt to different environments by reading environment variables for database connection settings.\n- In a Kubernetes environment, it dynamically fetches database connection details from environment variables (CLUSTER_ENV, MARIADB_USER, MARIADB_PASSWORD, MARIADB_HOST, MARIADB_PORT).\n\n### Charts Configuration:\nCreated 4 different helm charts \n- createjob\n- deletejob\n- readjob\n- updatejob\n\nThis service offers a simple yet effective solution for task scheduling, ensuring timely execution and easy management of tasks with minimal user intervention.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushkarm029%2Ftask_scheduler_py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushkarm029%2Ftask_scheduler_py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushkarm029%2Ftask_scheduler_py/lists"}