LowerEarthOrbiters / Lower_Earth_Orbiters

Template for capstone projects
https://lower-earth-orbiters-frontend.vercel.app
MIT License
1 stars 1 forks source link

Research into Agenda and Cron Scheduling #113

Closed Umang-Rajkarnikar closed 7 months ago

Umang-Rajkarnikar commented 8 months ago

Description: The MIST application must schedule commands using a queue. Based on the date and time of the overpasses, a queue of tasks need to run which can be achieved through an asynchronous job.

Look into Agenda which is a node.js scheduling tool which also persists jobs to MongoDB: https://hokify.github.io/agenda/agenda/6.x/

quinnha commented 8 months ago

Related: #109

Umang-Rajkarnikar commented 8 months ago

UML diagram describing relations between Satellite, Command (previously named as Scheduling), and Logs schemas. https://drive.google.com/file/d/1PLmMVWE4ht9ASTp434nA2R-Oi-UvP6TZ/view?pli=1

Operator Shceduling

  1. Schedule command sequence(s) for a satellite by providing overpass date (ie id of Schedule record) and command(s) a. Create schedule record in COMMAND Table and update record in SCHEDULE table to include command(s)
  2. Instant command sequence, treat as scheduled command sequence but the overpass date is set to earliest overpass

Setting up the queue After each overpass, append to queueCmd all commands scheduled for the next overpass:

During the overpass: For each object in queueCmd:

  1. Execute command
  2. Update command record status
  3. Record log

If there are leftovers, for each object in queueCmd which is a field in a Satellite record:

quinnha commented 8 months ago

need access to the drive link, but some initial questions:

setting up the queue is only done once right? so as new overpasses are predicted (assume we run /getnextpasses or whatever api call) itll just add to the schedule db?

what if someone wants to run a schedule immediately/next? how will that work?

quinnha commented 8 months ago

uml looks good to me, should we have a schedule object which has a list of commands, with a total output log? this prevents operators from having to go into every single command, and instead see it at a glance -> could also be good for organizational purposes

Umang-Rajkarnikar commented 8 months ago

uml looks good to me, should we have a schedule object which has a list of commands, with a total output log? this prevents operators from having to go into every single command, and instead see it at a glance -> could also be good for organizational purposes

Would each schedule obj represent an overpass date and it would have all commands executed for that overpass? Btw in the UML diagram, the Schedule schema was renamed to Commands

Umang-Rajkarnikar commented 8 months ago

Currently with the way it's set up, all the logs for an operator can be fetched based on the userId and satelliteId, but I think we can add in another relation with a Schedule schema. Each record represents an overpass date and each command record would also reference some overpass date, which shows the overpass date it was executed on

quinnha commented 8 months ago

yep sounds good to me

Umang-Rajkarnikar commented 8 months ago

Flow for frontend

image
quinnha commented 8 months ago

image thoughts on something like this for the satellite page? @Umang-Rajkarnikar

quinnha commented 8 months ago

image and detailed display

Umang-Rajkarnikar commented 8 months ago

image thoughts on something like this for the satellite page? @Umang-Rajkarnikar

Yeah that looks awesome! Really like the layout of information in this page

For the Schedule Queue section, that is showing the commands scheduled for the next three overpasses right? Also, was thinking if we should add a "View All" button in the bottom right of each schedule, what do you think?

quinnha commented 8 months ago

yea maybe a view all would make sense, and then our main action button would be add schedule? right now theres lots of ways for our user to go, but we can also confirm with austin and the crew for what their most commonly used action will be