-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patharchitecture.html
304 lines (188 loc) · 14.6 KB
/
architecture.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Architecture — Digdag 0.10.5 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Concepts" href="concepts.html" />
<link rel="prev" title="Getting started" href="getting_started.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Digdag
</a>
<div class="version">
0.10
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Architecture</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#automating-workflow-with-digdag">Automating workflow with Digdag</a></li>
<li class="toctree-l2"><a class="reference internal" href="#organizing-tasks-by-groups">Organizing tasks by groups</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#parameters">Parameters</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#workflow-as-code">Workflow as code</a></li>
<li class="toctree-l2"><a class="reference internal" href="#running-with-local-mode">Running with local mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="#running-on-a-server">Running on a server</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#running-tasks-on-docker">Running tasks on Docker</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#next-steps">Next steps</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="concepts.html">Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="workflow_definition.html">Workflow definition</a></li>
<li class="toctree-l1"><a class="reference internal" href="scheduling_workflow.html">Scheduling workflow</a></li>
<li class="toctree-l1"><a class="reference internal" href="operators.html">Operators</a></li>
<li class="toctree-l1"><a class="reference internal" href="command_reference.html">Command reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="python_api.html">Language API - Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="ruby_api.html">Language API - Ruby</a></li>
<li class="toctree-l1"><a class="reference internal" href="rest_api.html">REST API</a></li>
<li class="toctree-l1"><a class="reference internal" href="command_executor.html">Command Executor</a></li>
<li class="toctree-l1"><a class="reference internal" href="internal.html">Internal architecture</a></li>
<li class="toctree-l1"><a class="reference internal" href="metrics.html">Digdag metrics (experimental)</a></li>
<li class="toctree-l1"><a class="reference internal" href="community_contributions.html">Community Contributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="logo.html">Logo</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Digdag</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Architecture</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/architecture.md.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="architecture">
<h1>Architecture<a class="headerlink" href="#architecture" title="Permalink to this headline">¶</a></h1>
<div class="section" id="automating-workflow-with-digdag">
<h2>Automating workflow with Digdag<a class="headerlink" href="#automating-workflow-with-digdag" title="Permalink to this headline">¶</a></h2>
<p>A workflow automates any kinds of manual operations. You’ll define a sequence of tasks as workflow, then Digdag keeps running it for you. Tasks are defined using operator plugins so that you can control various kinds of systems from the central workflow engine (see also <a class="reference external" href="operators.html">list of built-in operator plugins</a>).</p>
<p>As the runtime framework of the plugins, Digdag takes care of the rest of issues around workload automation so that you can focus on automation. If a task fails, Digdag sends an alerts. If the workflow doesn’t finish within expected amount of time, Digdag sends a notification. Digdag starts workflow automatically based on scheduling options.</p>
<p>Tasks can run on local machine, distributed servers, or in a Docker container.</p>
</div>
<div class="section" id="organizing-tasks-by-groups">
<h2>Organizing tasks by groups<a class="headerlink" href="#organizing-tasks-by-groups" title="Permalink to this headline">¶</a></h2>
<p>As you automate complex workflow, the definition becomes complicated quickly. Using Digdag, you can organize tasks into groups. When you review the definition, you will see from a bird’s view, then dive in to details. It makes it easy to debug and review your workflow during development. In production environment, it helps administrators to know what’s happening and how to fix problems.</p>
<p><img alt="_images/grouping-tasks.png" src="_images/grouping-tasks.png" />Grouping tasks</p>
<p>A task starts if there’re no dependent siblings, or all of them successfully completed. When a parent of a group runs, it runs its children. When all of them completed successfully, their parent also completes successfully. But when a child failed, the failed child and its parent also fails. The entire execution finishes when the root task completes or fails.</p>
<div class="section" id="parameters">
<h3>Parameters<a class="headerlink" href="#parameters" title="Permalink to this headline">¶</a></h3>
<p>Grouping tasks is used also for passing parameters between tasks. A parent task can export variables for children tasks (as like UNIX shell’s <em>export</em> command sets environment variables). A parent can generate children tasks at run time so that it can run different tasks depending on the results of previous tasks. See <a class="reference external" href="workflow_definition.html#defining-variables">defining variables</a> section for details.</p>
<p><img alt="_images/export-params.png" src="_images/export-params.png" />Exporting parameters</p>
<p>See <a class="reference external" href="workflow_definition.html">workflow definition</a> section for the definition syntax.</p>
</div>
</div>
<div class="section" id="workflow-as-code">
<h2>Workflow as code<a class="headerlink" href="#workflow-as-code" title="Permalink to this headline">¶</a></h2>
<p><img alt="_images/workflow-as-code.png" src="_images/workflow-as-code.png" />Workflow as code</p>
<p>Digdag workflow is defined as code. This brings best practice of software development: version management, code review, tests, and collaboration using pull-requests. You can push a workflow to a git repository, and anyone can pull it to reproduce the same results with you.</p>
</div>
<div class="section" id="running-with-local-mode">
<h2>Running with local mode<a class="headerlink" href="#running-with-local-mode" title="Permalink to this headline">¶</a></h2>
<p>Digdag is a single-file executable command. Creating and running a new workflow is as easy as Makefile.</p>
<p>Files with <code class="docutils literal notranslate"><span class="pre">*.dig</span></code> suffix are used for workflow definitions. <code class="docutils literal notranslate"><span class="pre">digdag</span> <span class="pre">run</span> <span class="pre">my_workflow.dig</span></code> command runs the workflow.</p>
<p>Once you developed and tested a workflow on a local machine, you will want to push it to a server so that the workflow runs periodically.</p>
</div>
<div class="section" id="running-on-a-server">
<h2>Running on a server<a class="headerlink" href="#running-on-a-server" title="Permalink to this headline">¶</a></h2>
<p>Files with <code class="docutils literal notranslate"><span class="pre">*.dig</span></code> suffix and other files at the same directory are called <strong>project</strong>. You can push an entire project to a Digdag server so that Digdag server runs workflows on the server.</p>
<div class="section" id="running-tasks-on-docker">
<h3>Running tasks on Docker<a class="headerlink" href="#running-tasks-on-docker" title="Permalink to this headline">¶</a></h3>
<p>You can use <a class="reference external" href="https://www.docker.com/">Docker</a> to run tasks in a container. If <code class="docutils literal notranslate"><span class="pre">docker</span></code> option is set, tasks run in a docker container.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">_export</span><span class="p">:</span>
<span class="n">docker</span><span class="p">:</span>
<span class="n">image</span><span class="p">:</span> <span class="n">ubuntu</span><span class="p">:</span><span class="mf">14.04</span>
<span class="o">+</span><span class="n">step1</span><span class="p">:</span>
<span class="n">py</span><span class="o">></span><span class="p">:</span> <span class="n">tasks</span><span class="o">.</span><span class="n">MyWorkflow</span><span class="o">.</span><span class="n">step1</span>
</pre></div>
</div>
<p>Digdag caches pulled image and reuses it. By default, currently, Digdag uses the cached image consistently even if there is an update. You can set <code class="docutils literal notranslate"><span class="pre">pull_always:</span> <span class="pre">true</span></code> option so that Digdag checks update and pulls the latest image of the tag every time when a task starts.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">_export</span><span class="p">:</span>
<span class="n">docker</span><span class="p">:</span>
<span class="n">image</span><span class="p">:</span> <span class="n">ubuntu</span><span class="p">:</span><span class="n">latest</span>
<span class="n">pull_always</span><span class="p">:</span> <span class="n">true</span>
<span class="o">+</span><span class="n">step1</span><span class="p">:</span>
<span class="n">py</span><span class="o">></span><span class="p">:</span> <span class="n">tasks</span><span class="o">.</span><span class="n">MyWorkflow</span><span class="o">.</span><span class="n">step1</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="next-steps">
<h2>Next steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><a class="reference external" href="concepts.html">Concepts</a></p></li>
<li><p><a class="reference external" href="scheduling_workflow.html">Getting started</a></p></li>
<li><p><a class="reference external" href="operators.html">More choices of operators</a></p></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="concepts.html" class="btn btn-neutral float-right" title="Concepts" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="getting_started.html" class="btn btn-neutral float-left" title="Getting started" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2016-2024, Digdag Project
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<br/>
<br/>
<p><a href="https://digdag.io/">Digdag</a> is an open source project, invented and sponsored by <a href="https://www.treasuredata.com/">Treasure Data, Inc.</a> under the Apache 2.0 Licence.</p>
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>