session-name to allow bulk add of jobs to a session
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
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
- We need to add a new flag to the freezer-scheduler job-upload command that should reflect the idea "--create-
- 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-
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_
then:
pass
else:
create session
browse database and add to the session all jobs with session_name = provided_
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_
then:
raise(ERROR)
else:
create session
browse database and add to the session all jobs with session_name = provided_
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_
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_