Team ID: AWS-T1 | Team Members: Pushpendra kumar, Shantanu Sharma
- Backend : Express, MongoDB
- Frontend : Bootstrap, Javascript, HTML, CSS
Task scheduler library, which exposes REST APIs that can be accessed to schedule, modify, retrieve and delete tasks which are Lambda functions (a serverless service by AWS which allows you to run snippets of code without needing server deployment.). Tasks here are the api endpoint url of the AWS lambda. Example API Endpoint URL - https://a6ilch6fb5.execute-api.ap-south-1.amazonaws.com/default/trial
Users can use these endpoints to schedule/retrieve/modify and cancel tasks(lambda functions).
- Accepts endpoint URL for Lambda Task, Date and time at which the task is to be scheduled
- Accepts the number of retries and the duration between retries for a Task. If the task fails, the task is re-triggered based on the details passed by the user till it succeeds or retries expires.
- schedules the task returns the created Task Id
- Accepts taskState(scheduled,running,completed,cancelled,All)
- Retrieves a list of tasks based on current status of the task.
- taskState
- All : retrieves all tasks created by any user irrespective of task-state
- scheduled : retrieves all tasks created by logged in user in scheduled state
- running : retrieves all tasks created by logged in user in running state
- completed : retrieves all tasks created by logged in user in completed state
- cancelled : retrieves all tasks created by logged in user in cancelled state
- failed : retrieves all tasks created by logged in user in failed state
- Accepts Task Id, modified date and time
- Only the tasks in scheduled state can be modified
- It re-schedules the task at the (modified date and time) else returns that task cannot be modified.
- Accepts taskId of the task to be cancelled
- Only the tasks in scheduled state can be cancelled
- It cancels task and Returns a boolean value to confirm the task has been cancelled, else returns that task cannot be cancelled.
- User provides sequence of tasks and an additional condition check task as input to the Orchestrator library. These need to be scheduled in sequence. All the tasks and the condition check task will be in the form of lambda functions. User will also provide initial delay for the first Task.
- The Orchestrator library will schedule these tasks (and the condition check task) as a Task Set and return the Task Set Id to the user.
- Workflow: The Orchestrator library will execute the first task from the sequence of tasks after the initial delay expires. It will then execute the condition check task after an delay of conditionCheckTaskDelay and check its status. If success, it will execute the second task in the sequence else it will re-trigger condition check url till it succeeds or conditionCheckRetries expires. If retries expires, fallback task gets executed else orchestrator moves to the next task in sequence.
- Explanation taskStates orchestration
- scheduled: First task is yet to be executed i.e initial delay has not expired
- running: Executing a task from the sequence of orchestration tasks or executing the condition check task
- success: successfully executed all the tasks in the orchestration sequence
- cancelled: User cancelled the task before the first task in sequence got triggered.
- failed: If any one of task in orchestration sequence failed or condition check failed(even after all retries expired)
Users can use these endpoints to schedule/retrieve/ and cancel orchestrations(lambda functions).
- Accepts sequence of lambda Tasks to orchestrate, condition check lambda url, initial delay(time delay after which first task in sequence gets triggered), timeDelayForConditionCheck(conditionCheckTask will be scheduled to be executed after timeDelayForConditionCheck)
- Accepts the number of conditionCheckRetries and the duration between retries. If the condition check task fails, the condition check task is re-triggered until it succeeds or number of retries expires.
- Accepts fallback task. If the conditionCheckTask doesn’t return Success even after conditionCheckRetries, the fallbackTask shall be executed.
- schedules the orchestration returns the created Task Id
- Accepts taskState(scheduled,running,completed,cancelled,All)
- Retrieves a list of tasks based on current status of the task.
- taskState
- All : retrieves all tasks created by any user irrespective of task-state
- scheduled : retrieves all tasks created by logged in user in scheduled state
- running : retrieves all tasks created by logged in user in running state
- completed : retrieves all tasks created by logged in user in completed state
- cancelled : retrieves all tasks created by logged in user in cancelled state
- Accepts taskId of the task to be cancelled
- Only the orchestrations in scheduled state can be cancelled i.e first task has not executed yet.
- It cancels task and Returns a boolean value to confirm the task has been cancelled, else returns that task cannot be cancelled.