I'm in the process of implementing the first user story, Delayed Launch,
per the Redmine page below . I've pulled out the relevant section of
the page for quick reference below. I'm also adding what views I
believe will be edited along the way. I figure soliciting comments and
suggestions before getting too far is a good idea...
1. As a user I want to launch a deployment at a specified time.
Delayed_job can be used for this (we already have it integrated). It
could work as follows:
1. a user sets launch time on a deployment launch page
2. after checking permissions (same as for common launching),
deployment+instances objects are created in conductor's DB (both
deployment and instances stay in 'NEW' state)
3. we check if match is found at this point, if not, warning is
displayed to user, but he is allowed to continue in delayed launch
4. launch request is queued in delayed_job queue with appropriate delay
(delay = current time - launch time set by user)
5. delayed_job invokes launch request which: checks again permissions,
finds a match and launches the deployment. If match is not found,
deployment is not deleted but failed status is set both for deployment
Deployment model in conductor would be extended with attribute
"launch_at", this attribute would be set for delayed launches and would
be displayed in UI.
Deployments which are waiting for launch can be deleted, in such case
delayed_job's job should be removed from queue -> another "job_id"
attribute would be needed for keeping this id.
Deployments which are waiting for launch can have their launch time
edited. One of two scenario's would occur then:
1. Update the delay of the job in the queue of delayed_job
2. Duplicate the request currently queued in delayed_job, issue a new
request to delayed_job and delete the original request.
Both of these scenarios would also require a "job_id" attribute be
created to keep the delayed_job id.