Project

General

Profile

Reusable tasks » History » Version 1

Tom Clegg, 10/06/2014 03:00 PM

1 1 Tom Clegg
{{>toc}}
2
3
h1=. Reusable tasks
4
5
p>. *"Tom Clegg":mailto:tom@curoverse.com
6
Last Updated: October 6, 2014*
7
8
h2. Overview
9
10
h3. Objective
11
12
Say jobs A and B, although not identical, have some tasks in common. Job A is complete. Job B starting now. They use the same script, version, docker image, etc. The only difference between A and B is that B's input collection has one more file; the rest of the files are identical. The script processes each input file independently, and it is a pure function (re-computing the same files will produce the same result). This means most of Job B's work has already been done. Task re-use will allow Arvados to recognize this condition and re-use the outputs of Job A's tasks instead of recomputing them.
13
14
Task re-use will not attempt to detect equivalence conditions like differently-encoded collection manifests with identical data, differing git commits with identical trees, and differing docker images with functionally equivalent content.
15
16
The intended audience for this document is software engineers.
17
18
h3. Background
19
20
_The background section should contain information the reader needs to know to understand the problem being solved. This can be a combination of text and links to other documents._
21
22
h3. Alternatives
23
24
_This section contains alternative solutions to the stated objective, as well as explanations for why they weren't used. In the planning stage, this section is useful for understanding the value added by the proposed solution. Once the system has been implemented, this section will inform readers of alternative solutions so they can find the best system to address their needs._
25
26
h3. Tradeoffs
27
28
_What tradeoffs were made in this design and *why*. Types of tradeoffs can include: different approaches that could have been taken (e.g. storing data in memory/on disk/on network), or design decisions such as optimizing for latency vs throughput. The important part is to explain your reasoning for making the choice you did (or admitting if you felt the choice was arbitrary)._
29
30
h3. High Level Design
31
32
_A high-level description of the system. This is the most valuable section of the document and will probably receive the most attention. You should explain, at a high level, how your system will work. Don't get bogged down with details, those belong later in the document._
33
34
_A diagram showing how the major components communicate is very useful and a great way to start this section. If this system is intended to be a component in a larger system, a diagram showing how it fits in to the larger system will also be appreciated by your readers._
35
36
_Most diagrams will need to be updated over time as the design evolves, so please create your diagrams with a program that is easily (and freely) available and attach the diagram source to the document to make it easy for a future maintainer (who could be you) to update the diagrams along with the document._
37
38
h2. Specifics
39
40
_Nothing goes here; all the content belongs in the subsections._
41
42
h3. Detailed Design
43
44
_Designs that are too detailed for the above [[Design_Doc_Template#High-Level-Design|High Level Design]] section belong here. Anything that will require a day or more of work to implement, should be described here._
45
46
_This is a great place to put APIs, communication protocols, file formats and the like._
47
48
_It is important to include assumptions about what external systems will provide. For example if this system has a method that takes a user id as input, will your implementation assume that the user id is valid? Or if a method has a string parameter, does it assume that the parameter has been sanitized against injection attacks? Having such assumptions explicitly spelled out here before you start implementing increases the chances that misunderstandings will be caught by a reviewer before they lead to bugs or vulnerabilities. Please reference the external system's documentation justifying your assumption whenever possible (and if such documentation doesn't exist, ask the external system's author to document the behavior or at least confirm it in an email)._
49
50
_Here's an easy rule of thumb for deciding what to write here: Think of anything that would be a pain to change if you were requested to do so in a code review. If you put that implementation detail in here, you'll be less likely to be asked to change it once you've written all the code._
51
52
h3. Code Location
53
54
_The path of the source code in the repository._
55
56
h3. Testing Plan
57
58
_How you will verify the behavior of your system. Once the system is written, this section should be updated to reflect the current state of testing and future aspirations._
59
60
h3. Logging
61
62
_What your system will record and how._
63
64
h3. Debugging
65
66
_How users can debug interactions with your system. When designing a system it's important to think about what tools you can provide to make debugging problems easier. Sometimes it's unclear whether the problem is in your system at all, so a mechanism for isolating a particular interaction and examining it to see if your system behaved as expected is very valuable. Once a system is in use, this is a great place to put tips and recipes for debugging. If this section grows too large, the mechanisms can be summarized here and individual tips can be moved to another document._
67
68
h3. Caveats
69
70
_Gotchas, differences between the design and implementation, other potential stumbling blocks for users or maintainers, and their implications and workarounds. Unless something is known to be tricky ahead of time, this section will probably start out empty._
71
72
_Rather than deleting it, it's recommended that you keep this section with a simple place holder, since caveats will almost certainly appear down the road._
73
74
To be determined.
75
76
h3. Security Concerns
77
78
_This section should describe possible threats (denial of service, malicious requests, etc) and what, if anything, is being done to protect against them. Be sure to list concerns for which you don't have a solution or you believe don't need a solution. Security concerns that we don't need to worry about also belong here (e.g. we don't need to worry about denial of service attacks for this system because it only receives requests from the api server which already has DOS attack protections)._
79
80
h3. Open Questions and Risks
81
82
_This section should describe design questions that have not been decided yet, research that needs to be done and potential risks that could make make this system less effective or more difficult to implement._
83
84
_Some examples are: Should we communicate using TCP or UDP? How often do we expect our users to interrupt running jobs? This relies on an undocumented third-party API which may be turned off at any point._
85
86
_For each question you should include any relevant information you know. For risks you should include estimates of likelihood, cost if they occur and ideas for possible workarounds._
87
88
h3. Work Estimates
89
90
_Split the work into milestones that can be delivered, put them in the order that you think they should be done, and estimate roughly how much time you expect it each milestone to take. Ideally each milestone will take one week or less._
91
92
h3. Future Work
93
94
_Features you'd like to (or will need to) add but aren't required for the current release. This is a great place to speculate on potential features and performance improvements._
95
96
h3. Revision History
97
98
|_.Date            |_.Revisions Made |_.Author            |_.Reviewed By     |
99
| October 6, 2014 | Initial Draft         | Tom Clegg |=. ----              |