session-name to allow bulk add of jobs to a session

Registered by Pierre-Arthur MATHIEU

We need to modify the freezer scheduler, the job model and the session model to introduce the concept of session-name.

A session-name allows a job to be added to a session without knowing its session id.

It also allows to join all jobs with the session-name to be joined to the session without having to know their job id.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Pierre-Arthur MATHIEU
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

- We need to add a new flag to the freezer-scheduler job-upload command that should reflect the idea "--create-session-if-not-exist"

- A job definition can now contain a session-name field

- A session definition can now contain a session-name field

Here are some insights on implementation:

CASE 1
Assumptions:
freezer-scheduler job-upload --job-file mysql.json --create-session-if-not-exist session.json
Mysql.json contains a session_name
session.json contains a session_name

FROM the api perspective
IF (session_name provided in mysql.json) and (session_name provided in session.json) are differents
    raise(ERROR)
IF prvided_session_name(session.json) in session_names(that exist in the database):
then:
    pass
else:
    create session
    browse database and add to the session all jobs with session_name = provided_session_name
Analyze mysql.json :
    if it contains a session name :
        if session_name in session_names(that exist in the db):
            add job to session
        else
            pass

CASE 2
Assumptions:
freezer-scheduler job-upload --job-file mysql.json
mysql.json contains a session-name

FROM the api perspective
Analyze mysql.json :
    if it contains a session name :
        if session_name in session_names(that exist in the db):
            add job to session
        else
            pass

CASE 3
Assumptions:
freezer-scheduler session-create --session-file session.json
session.json contains a session name

FROM the api perspective

IF prvided_session_name(session.json) in session_names:
then:
    raise(ERROR)
else:
    create session
    browse database and add to the session all jobs with session_name = provided_session_name

FIRST CASE IS THE EXACT RUNNING OF CASE 3 THEN CASE 2 (you can't update a session using freezer-scheduler job-upload)

CASE 4:
Assumptions:
freezer-scheduler session-create --session-file session.json --update
session.json contains a session name

FROM the api perspective

IF prvided_session_name(session.json) in session_names:
then:
    update the session parameters with provided in session.json
else:
    create session
    browse database and add to the session all jobs with session_name = provided_session_name

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.