OBJECTIVES
author viric@llimona
Mon, 12 Nov 2007 09:57:46 +0100
changeset 140 0b99d94818d1
parent 0 fe34481ad1b0
child 165 7b914d4003c2
permissions -rw-r--r--
Added the web page.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     1
Tool objectives
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     2
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     3
- Be able to send commands to the computer, so that they run one after another,
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     4
  stored in a queue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     5
- Control what to do with the input/output of those programs
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     6
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     7
Limits
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     8
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     9
- One queue system per user per system
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    10
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    11
Interface
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    12
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    13
The user should see a single command: ts
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    14
The default action (maybe on "ts - ...") should be appending a job to the
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    15
default queue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    16
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    17
Job execution
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    18
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    19
The jobs should receive the proper environment from the shell/parent they were
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    20
queued on.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    21
The errorlevels, and maybe some statistical information (times, bytes in/out)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    22
should be stored in the queue. The user should be able to check the result of
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    23
the jobs at any time.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    24
We should fork a '$SHELL' and run the job command, because a user may expect his
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    25
shell parser.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    26
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    27
Queues
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    28
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    29
There should be different queues, each with an id. The command will work by
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    30
default with one quue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    31
Each queue will have jobs in different states:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    32
- running
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    33
- queued
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    34
- blocked (wrong errorlevel on the previous job? optional)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    35
- finished (the user can see the errorlevel,etc.)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    36
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    37
Input/output
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    38
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    39
The user, when adding a job to the queue, should be able to choose:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    40
- Where the output goes. As flags:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    41
  - store: put it into a file in /tmp (or similar).
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    42
  - mail: put it into a file in /tmp, and send it by mail (maybe gzipped)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    43
  - gzip: directly gzip the output
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    44
  - tail: store in a buffer the last 10 lines
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    45
  A user may choose "mail || gzip", and the file should be mailed gzipped. Or
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    46
  "gzip || tail", and the file should be stored directly gzipped, although with
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    47
  tailing available.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    48
- What to do with the input: opened/closed
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    49
  If opened, the user should be able to connect its current stdin to the
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    50
  process'.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    51
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    52
Job management
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    53
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    54
- Shutdown: stop all the background processes related to the queues.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    55
- tail (id): 'tail' the last lines of a process' output.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    56
- list: list the queues, with relevant information
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    57
- wait (id)*: block until some processes dies
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    58
- remove (id)+: remove jobs from the queue
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    59
- clear: remove the information about dead jobs (errorlevels, etc.)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    60
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    61
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    62
----------------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    63
Implementation
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    64
------------------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    65
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    66
Client/Server
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    67
----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    68
A central server daemon will have the main list of jobs, will open a socket,
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    69
and all the clients will tell what to do through it.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    70
This daemon will be started , if a client cannot find it.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    71
The client will go immediatly to background when the user adds a new job.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    72
A minimum version control should be done between client/server, to assure the
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    73
dialog will be correct.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    74
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    75
Connections
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    76
-----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    77
The connections could go through a Unix socket in /tmp, as X windows.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    78
An env variable could have a preference for a socket other than the default.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    79
Let's say, /tmp/ts-$USER-0.socket
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    80
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    81
Protocol
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    82
-----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    83
The clients should pass messages to the server, and vicerveza.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    84
Some messages should allow:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    85
- new job
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    86
- list jobs
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    87
- input data
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    88
- tail data
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    89
- get job info
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    90
- wait job