OBJECTIVES
author viric <viriketo@gmail.com>
Sun, 20 Mar 2016 11:25:53 +0100
changeset 346 90545736507e
parent 165 7b914d4003c2
permissions -rw-r--r--
Description: Fix typo Author: Alexander Inyukhin <shurick@sectorb.msk.ru> Last-Update: 2016-03-20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
165
7b914d4003c2 Fixing licenses in some files, and updating some documents.
viric@mandarina
parents: 0
diff changeset
     1
Introduction
7b914d4003c2 Fixing licenses in some files, and updating some documents.
viric@mandarina
parents: 0
diff changeset
     2
---------------------------
7b914d4003c2 Fixing licenses in some files, and updating some documents.
viric@mandarina
parents: 0
diff changeset
     3
This file was written before even the first implementation of 'ts',
7b914d4003c2 Fixing licenses in some files, and updating some documents.
viric@mandarina
parents: 0
diff changeset
     4
and it's kept in the repository for historical reasons.
7b914d4003c2 Fixing licenses in some files, and updating some documents.
viric@mandarina
parents: 0
diff changeset
     5
0
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     6
Tool objectives
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     7
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
     8
- 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
     9
  stored in a queue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    10
- Control what to do with the input/output of those programs
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    11
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    12
Limits
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    13
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    14
- One queue system per user per system
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    15
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    16
Interface
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    17
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    18
The user should see a single command: ts
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    19
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
    20
default queue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    21
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    22
Job execution
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    23
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    24
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
    25
queued on.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    26
The errorlevels, and maybe some statistical information (times, bytes in/out)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    27
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
    28
the jobs at any time.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    29
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
    30
shell parser.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    31
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    32
Queues
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    33
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    34
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
    35
default with one quue.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    36
Each queue will have jobs in different states:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    37
- running
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    38
- queued
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    39
- blocked (wrong errorlevel on the previous job? optional)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    40
- finished (the user can see the errorlevel,etc.)
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    41
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    42
Input/output
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    43
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    44
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
    45
- Where the output goes. As flags:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    46
  - store: put it into a file in /tmp (or similar).
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    47
  - 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
    48
  - gzip: directly gzip the output
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    49
  - tail: store in a buffer the last 10 lines
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    50
  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
    51
  "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
    52
  tailing available.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    53
- What to do with the input: opened/closed
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    54
  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
    55
  process'.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    56
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    57
Job management
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    58
---------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    59
- Shutdown: stop all the background processes related to the queues.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    60
- tail (id): 'tail' the last lines of a process' output.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    61
- list: list the queues, with relevant information
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    62
- wait (id)*: block until some processes dies
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    63
- remove (id)+: remove jobs from the queue
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    64
- clear: remove the information about dead jobs (errorlevels, etc.)
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
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
Implementation
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    69
------------------------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    70
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    71
Client/Server
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    72
----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    73
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
    74
and all the clients will tell what to do through it.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    75
This daemon will be started , if a client cannot find it.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    76
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
    77
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
    78
dialog will be correct.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    79
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    80
Connections
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    81
-----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    82
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
    83
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
    84
Let's say, /tmp/ts-$USER-0.socket
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    85
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    86
Protocol
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    87
-----------------------
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    88
The clients should pass messages to the server, and vicerveza.
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    89
Some messages should allow:
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    90
- new job
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    91
- list jobs
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    92
- input data
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    93
- tail data
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    94
- get job info
fe34481ad1b0 I added the explanation of the project
viric@vicerveza
parents:
diff changeset
    95
- wait job