aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject svn commit: r1719724 - in /aurora/site: ./ publish/documentation/latest/client-commands/ publish/documentation/latest/configuration-tutorial/ publish/documentation/latest/deploying-aurora-scheduler/ publish/documentation/latest/hooks/ publish/documenta...
Date Sat, 12 Dec 2015 19:29:03 GMT
Author: wfarner
Date: Sat Dec 12 19:29:03 2015
New Revision: 1719724

URL: http://svn.apache.org/viewvc?rev=1719724&view=rev
Log:
Use github styling in code blocks.

Modified:
    aurora/site/config.rb
    aurora/site/publish/documentation/latest/client-commands/index.html
    aurora/site/publish/documentation/latest/configuration-tutorial/index.html
    aurora/site/publish/documentation/latest/deploying-aurora-scheduler/index.html
    aurora/site/publish/documentation/latest/hooks/index.html
    aurora/site/publish/documentation/latest/security/index.html
    aurora/site/publish/documentation/latest/tutorial/index.html

Modified: aurora/site/config.rb
URL: http://svn.apache.org/viewvc/aurora/site/config.rb?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/config.rb (original)
+++ aurora/site/config.rb Sat Dec 12 19:29:03 2015
@@ -60,5 +60,5 @@ activate :blog do |blog|
 end
 
 activate :directory_indexes
-activate :syntax
-activate :livereload
\ No newline at end of file
+activate :syntax, :inline_theme => 'github'
+activate :livereload

Modified: aurora/site/publish/documentation/latest/client-commands/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/client-commands/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/client-commands/index.html (original)
+++ aurora/site/publish/documentation/latest/client-commands/index.html Sat Dec 12 19:29:03 2015
@@ -114,18 +114,18 @@ environment variable is not set. The sec
 
 <p>A cluster configuration is formatted as JSON.  The simplest cluster configuration is one that
 communicates with a single (non-leader-elected) scheduler.  For example:</p>
-<pre class="highlight javascript"><code><span class="p">[{</span>
-  <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"example"</span><span class="p">,</span>
-  <span class="s2">"scheduler_uri"</span><span class="p">:</span> <span class="s2">"localhost:55555"</span><span class="p">,</span>
-<span class="p">}]</span>
+<pre class="highlight javascript"><code><span style="background-color: #f8f8f8">[{</span>
+  <span style="color: #d14">"name"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"example"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"scheduler_uri"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"localhost:55555"</span><span style="background-color: #f8f8f8">,</span>
+<span style="background-color: #f8f8f8">}]</span>
 </code></pre>
 
 <p>A configuration for a leader-elected scheduler would contain something like:</p>
-<pre class="highlight javascript"><code><span class="p">[{</span>
-  <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"example"</span><span class="p">,</span>
-  <span class="s2">"zk"</span><span class="p">:</span> <span class="s2">"192.168.33.7"</span><span class="p">,</span>
-  <span class="s2">"scheduler_zk_path"</span><span class="p">:</span> <span class="s2">"/aurora/scheduler"</span>
-<span class="p">}]</span>
+<pre class="highlight javascript"><code><span style="background-color: #f8f8f8">[{</span>
+  <span style="color: #d14">"name"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"example"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"zk"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"192.168.33.7"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"scheduler_zk_path"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"/aurora/scheduler"</span>
+<span style="background-color: #f8f8f8">}]</span>
 </code></pre>
 
 <p>For more details on cluster configuration see the

Modified: aurora/site/publish/documentation/latest/configuration-tutorial/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/configuration-tutorial/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/configuration-tutorial/index.html (original)
+++ aurora/site/publish/documentation/latest/configuration-tutorial/index.html Sat Dec 12 19:29:03 2015
@@ -580,7 +580,7 @@ variable, in this case <code>name</code>
 
 <p>If a template variable doesn&rsquo;t have a value, when evaluated it&rsquo;s
 replaced with nothing. If we add a binding to give it a value:</p>
-<pre class="highlight json"><code><span class="p">{</span><span class="w"> </span><span class="nt">"name"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"Tom"</span><span class="w"> </span><span class="p">}</span><span class="w">
+<pre class="highlight json"><code><span style="background-color: #f8f8f8">{</span><span style="color: #bbbbbb"> </span><span style="color: #000080">"name"</span><span style="color: #bbbbbb"> </span><span style="background-color: #f8f8f8">:</span><span style="color: #bbbbbb"> </span><span style="color: #d14">"Tom"</span><span style="color: #bbbbbb"> </span><span style="background-color: #f8f8f8">}</span><span style="color: #bbbbbb">
 </span></code></pre>
 
 <p>We&rsquo;d get back:</p>

Modified: aurora/site/publish/documentation/latest/deploying-aurora-scheduler/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/deploying-aurora-scheduler/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/deploying-aurora-scheduler/index.html (original)
+++ aurora/site/publish/documentation/latest/deploying-aurora-scheduler/index.html Sat Dec 12 19:29:03 2015
@@ -130,28 +130,28 @@ sudo ln -nfs "$(ls -dt /usr/local/aurora
 
 <p>Like Mesos, Aurora uses command-line flags for runtime configuration. As such the Aurora
 &ldquo;configuration file&rdquo; is typically a <code>scheduler.sh</code> shell script of the form.</p>
-<pre class="highlight shell"><code><span class="c">#!/bin/bash</span>
-<span class="nv">AURORA_HOME</span><span class="o">=</span>/usr/local/aurora-scheduler
+<pre class="highlight shell"><code><span style="color: #999988;font-style: italic">#!/bin/bash</span>
+<span style="color: #008080">AURORA_HOME</span><span style="color: #000000;font-weight: bold">=</span>/usr/local/aurora-scheduler
 
-<span class="c"># Flags controlling the JVM.</span>
-<span class="nv">JAVA_OPTS</span><span class="o">=(</span>
+<span style="color: #999988;font-style: italic"># Flags controlling the JVM.</span>
+<span style="color: #008080">JAVA_OPTS</span><span style="color: #000000;font-weight: bold">=(</span>
   -Xmx2g
   -Xms2g
-  <span class="c"># GC tuning, etc.</span>
-<span class="o">)</span>
+  <span style="color: #999988;font-style: italic"># GC tuning, etc.</span>
+<span style="color: #000000;font-weight: bold">)</span>
 
-<span class="c"># Flags controlling the scheduler.</span>
-<span class="nv">AURORA_FLAGS</span><span class="o">=(</span>
-  -http_port<span class="o">=</span>8081
-  <span class="c"># Log configuration, etc.</span>
-<span class="o">)</span>
-
-<span class="c"># Environment variables controlling libmesos</span>
-<span class="nb">export </span><span class="nv">JAVA_HOME</span><span class="o">=</span>...
-<span class="nb">export </span><span class="nv">GLOG_v</span><span class="o">=</span>1
-<span class="nb">export </span><span class="nv">LIBPROCESS_PORT</span><span class="o">=</span>8083
+<span style="color: #999988;font-style: italic"># Flags controlling the scheduler.</span>
+<span style="color: #008080">AURORA_FLAGS</span><span style="color: #000000;font-weight: bold">=(</span>
+  -http_port<span style="color: #000000;font-weight: bold">=</span>8081
+  <span style="color: #999988;font-style: italic"># Log configuration, etc.</span>
+<span style="color: #000000;font-weight: bold">)</span>
+
+<span style="color: #999988;font-style: italic"># Environment variables controlling libmesos</span>
+<span style="color: #0086B3">export </span><span style="color: #008080">JAVA_HOME</span><span style="color: #000000;font-weight: bold">=</span>...
+<span style="color: #0086B3">export </span><span style="color: #008080">GLOG_v</span><span style="color: #000000;font-weight: bold">=</span>1
+<span style="color: #0086B3">export </span><span style="color: #008080">LIBPROCESS_PORT</span><span style="color: #000000;font-weight: bold">=</span>8083
 
-<span class="nv">JAVA_OPTS</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">JAVA_OPTS</span><span class="p">[*]</span><span class="k">}</span><span class="s2">"</span> <span class="nb">exec</span> <span class="s2">"</span><span class="nv">$AURORA_HOME</span><span class="s2">/bin/aurora-scheduler"</span> <span class="s2">"</span><span class="k">${</span><span class="nv">AURORA_FLAGS</span><span class="p">[@]</span><span class="k">}</span><span class="s2">"</span>
+<span style="color: #008080">JAVA_OPTS</span><span style="color: #000000;font-weight: bold">=</span><span style="color: #d14">"</span><span style="color: #000000;font-weight: bold">${</span><span style="color: #008080">JAVA_OPTS</span><span style="background-color: #f8f8f8">[*]</span><span style="color: #000000;font-weight: bold">}</span><span style="color: #d14">"</span> <span style="color: #0086B3">exec</span> <span style="color: #d14">"</span><span style="color: #008080">$AURORA_HOME</span><span style="color: #d14">/bin/aurora-scheduler"</span> <span style="color: #d14">"</span><span style="color: #000000;font-weight: bold">${</span><span style="color: #008080">AURORA_FLAGS</span><span style="background-color: #f8f8f8">[@]</span><span style="color: #000000;font-weight: bold">}</span><span style="color: #d14">"</span>
 </code></pre>
 
 <p>That way Aurora&rsquo;s current flags are visible in <code>ps</code> and in the <code>/vars</code> admin endpoint.</p>

Modified: aurora/site/publish/documentation/latest/hooks/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/hooks/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/hooks/index.html (original)
+++ aurora/site/publish/documentation/latest/hooks/index.html Sat Dec 12 19:29:03 2015
@@ -81,17 +81,17 @@ return <code>False</code>. Designers/con
 consider whether or not to error-trap them. You can error trap at the
 highest level very generally and always pass the <code>pre_</code> hook by
 returning <code>True</code>. For example:</p>
-<pre class="highlight python"><code><span class="k">def</span> <span class="nf">pre_create</span><span class="p">(</span><span class="o">...</span><span class="p">):</span>
-  <span class="n">do_something</span><span class="p">()</span>  <span class="c"># if do_something fails with an exception, the create_job is not attempted!</span>
-  <span class="k">return</span> <span class="bp">True</span>
-
-<span class="c"># However...</span>
-<span class="k">def</span> <span class="nf">pre_create</span><span class="p">(</span><span class="o">...</span><span class="p">):</span>
-  <span class="k">try</span><span class="p">:</span>
-    <span class="n">do_something</span><span class="p">()</span>  <span class="c"># may cause exception</span>
-  <span class="k">except</span> <span class="nb">Exception</span><span class="p">:</span>  <span class="c"># generic error trap will catch it</span>
-    <span class="k">pass</span>  <span class="c"># and ignore the exception</span>
-  <span class="k">return</span> <span class="bp">True</span>  <span class="c"># create_job will run in any case!</span>
+<pre class="highlight python"><code><span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">pre_create</span><span style="background-color: #f8f8f8">(</span><span style="color: #000000;font-weight: bold">...</span><span style="background-color: #f8f8f8">):</span>
+  <span style="background-color: #f8f8f8">do_something</span><span style="background-color: #f8f8f8">()</span>  <span style="color: #999988;font-style: italic"># if do_something fails with an exception, the create_job is not attempted!</span>
+  <span style="color: #000000;font-weight: bold">return</span> <span style="color: #999999">True</span>
+
+<span style="color: #999988;font-style: italic"># However...</span>
+<span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">pre_create</span><span style="background-color: #f8f8f8">(</span><span style="color: #000000;font-weight: bold">...</span><span style="background-color: #f8f8f8">):</span>
+  <span style="color: #000000;font-weight: bold">try</span><span style="background-color: #f8f8f8">:</span>
+    <span style="background-color: #f8f8f8">do_something</span><span style="background-color: #f8f8f8">()</span>  <span style="color: #999988;font-style: italic"># may cause exception</span>
+  <span style="color: #000000;font-weight: bold">except</span> <span style="color: #0086B3">Exception</span><span style="background-color: #f8f8f8">:</span>  <span style="color: #999988;font-style: italic"># generic error trap will catch it</span>
+    <span style="color: #000000;font-weight: bold">pass</span>  <span style="color: #999988;font-style: italic"># and ignore the exception</span>
+  <span style="color: #000000;font-weight: bold">return</span> <span style="color: #999999">True</span>  <span style="color: #999988;font-style: italic"># create_job will run in any case!</span>
 </code></pre>
 
 <p><code>post_&lt;method_name&gt;</code>: A <code>post_</code> hook executes after its associated method successfully finishes running. If it fails, the already executed method is unaffected. A <code>post_</code> hook&rsquo;s error is trapped, and any later operations are unaffected.</p>
@@ -201,12 +201,12 @@ returning <code>True</code>. For example
 <p>To summarize, to use hooks for a particular job, you must both activate hooks for your config file as a whole, and for that job. Activating hooks only for individual jobs won&rsquo;t work, nor will only activating hooks for your config file as a whole. You must also specify the hooks&rsquo; defining object in the <code>hooks</code> variable.</p>
 
 <p>Recall that <code>.aurora</code> config files are written in Pystachio. So the following turns on hooks for production jobs at cluster1 and cluster2, but leaves them off for similar jobs with a defined user role. Of course, you also need to list the objects that define the hooks in your config file&rsquo;s <code>hooks</code> variable.</p>
-<pre class="highlight python"><code><span class="n">jobs</span> <span class="o">=</span> <span class="p">[</span>
-        <span class="n">Job</span><span class="p">(</span><span class="n">enable_hooks</span> <span class="o">=</span> <span class="bp">True</span><span class="p">,</span> <span class="n">cluster</span> <span class="o">=</span> <span class="n">c</span><span class="p">,</span> <span class="n">env</span> <span class="o">=</span> <span class="s">'prod'</span><span class="p">)</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="p">(</span><span class="s">'cluster1'</span><span class="p">,</span> <span class="s">'cluster2'</span><span class="p">)</span>
-       <span class="p">]</span>
-<span class="n">jobs</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span>
-   <span class="n">Job</span><span class="p">(</span><span class="n">cluster</span> <span class="o">=</span> <span class="n">c</span><span class="p">,</span> <span class="n">env</span> <span class="o">=</span> <span class="s">'prod'</span><span class="p">,</span> <span class="n">role</span> <span class="o">=</span> <span class="n">getpass</span><span class="o">.</span><span class="n">getuser</span><span class="p">())</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="p">(</span><span class="s">'cluster1'</span><span class="p">,</span> <span class="s">'cluster2'</span><span class="p">))</span>
-   <span class="c"># Hooks disabled for these jobs</span>
+<pre class="highlight python"><code><span style="background-color: #f8f8f8">jobs</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">[</span>
+        <span style="background-color: #f8f8f8">Job</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">enable_hooks</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #999999">True</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">cluster</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">c</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">env</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'prod'</span><span style="background-color: #f8f8f8">)</span> <span style="color: #000000;font-weight: bold">for</span> <span style="background-color: #f8f8f8">c</span> <span style="color: #000000;font-weight: bold">in</span> <span style="background-color: #f8f8f8">(</span><span style="color: #d14">'cluster1'</span><span style="background-colo
 r: #f8f8f8">,</span> <span style="color: #d14">'cluster2'</span><span style="background-color: #f8f8f8">)</span>
+       <span style="background-color: #f8f8f8">]</span>
+<span style="background-color: #f8f8f8">jobs</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">extend</span><span style="background-color: #f8f8f8">(</span>
+   <span style="background-color: #f8f8f8">Job</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">cluster</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">c</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">env</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'prod'</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">role</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">getpass</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">getuser</span><span style="background-color: #f8f8f8">())</span> <span style="color: #000000;font-weight: bold">for</span> <span style="background-color: #f8f8f8">c</span> <span style="color: #000000;font-weight: bold">in</span> <span s
 tyle="background-color: #f8f8f8">(</span><span style="color: #d14">'cluster1'</span><span style="background-color: #f8f8f8">,</span> <span style="color: #d14">'cluster2'</span><span style="background-color: #f8f8f8">))</span>
+   <span style="color: #999988;font-style: italic"># Hooks disabled for these jobs</span>
 </code></pre>
 
 <h2 id="command-line">Command Line</h2>
@@ -226,15 +226,15 @@ returning <code>True</code>. For example
 <p>Note that you can define other methods in the class that its hook methods can call; all the logic of a hook does not have to be in its definition.</p>
 
 <p>The following example defines a class containing a <code>pre_kill_job</code> hook definition that calls another method defined in the class.</p>
-<pre class="highlight python"><code><span class="c"># Defines a method pre_kill_job</span>
-<span class="k">class</span> <span class="nc">KillConfirmer</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
-  <span class="k">def</span> <span class="nf">confirm</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">msg</span><span class="p">):</span>
-    <span class="k">return</span> <span class="nb">raw_input</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s">'yes'</span>
-
-  <span class="k">def</span> <span class="nf">pre_kill_job</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">job_key</span><span class="p">,</span> <span class="n">shards</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
-    <span class="n">shards</span> <span class="o">=</span> <span class="p">(</span><span class="s">'shards </span><span class="si">%</span><span class="s">s'</span> <span class="o">%</span> <span class="n">shards</span><span class="p">)</span> <span class="k">if</span> <span class="n">shards</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="k">else</span> <span class="s">'all shards'</span>
-    <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">confirm</span><span class="p">(</span><span class="s">'Are you sure you want to kill </span><span class="si">%</span><span class="s">s (</span><span class="si">%</span><span class="s">s)? (yes/no): '</span>
-                        <span class="o">%</span> <span class="p">(</span><span class="n">job_key</span><span class="p">,</span> <span class="n">shards</span><span class="p">))</span>
+<pre class="highlight python"><code><span style="color: #999988;font-style: italic"># Defines a method pre_kill_job</span>
+<span style="color: #000000;font-weight: bold">class</span> <span style="color: #445588;font-weight: bold">KillConfirmer</span><span style="background-color: #f8f8f8">(</span><span style="color: #0086B3">object</span><span style="background-color: #f8f8f8">):</span>
+  <span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">confirm</span><span style="background-color: #f8f8f8">(</span><span style="color: #999999">self</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">msg</span><span style="background-color: #f8f8f8">):</span>
+    <span style="color: #000000;font-weight: bold">return</span> <span style="color: #0086B3">raw_input</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">msg</span><span style="background-color: #f8f8f8">)</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">lower</span><span style="background-color: #f8f8f8">()</span> <span style="color: #000000;font-weight: bold">==</span> <span style="color: #d14">'yes'</span>
+
+  <span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">pre_kill_job</span><span style="background-color: #f8f8f8">(</span><span style="color: #999999">self</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">job_key</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">shards</span><span style="color: #000000;font-weight: bold">=</span><span style="color: #999999">None</span><span style="background-color: #f8f8f8">):</span>
+    <span style="background-color: #f8f8f8">shards</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">(</span><span style="color: #d14">'shards </span><span style="color: #d14">%</span><span style="color: #d14">s'</span> <span style="color: #000000;font-weight: bold">%</span> <span style="background-color: #f8f8f8">shards</span><span style="background-color: #f8f8f8">)</span> <span style="color: #000000;font-weight: bold">if</span> <span style="background-color: #f8f8f8">shards</span> <span style="color: #000000;font-weight: bold">is</span> <span style="color: #000000;font-weight: bold">not</span> <span style="color: #999999">None</span> <span style="color: #000000;font-weight: bold">else</span> <span style="color: #d14">'all shards'</span>
+    <span style="color: #000000;font-weight: bold">return</span> <span style="color: #999999">self</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">confirm</span><span style="background-color: #f8f8f8">(</span><span style="color: #d14">'Are you sure you want to kill </span><span style="color: #d14">%</span><span style="color: #d14">s (</span><span style="color: #d14">%</span><span style="color: #d14">s)? (yes/no): '</span>
+                        <span style="color: #000000;font-weight: bold">%</span> <span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">job_key</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">shards</span><span style="background-color: #f8f8f8">))</span>
 </code></pre>
 
 <h3 id="pre_-methods">pre_ Methods</h3>
@@ -270,7 +270,7 @@ returning <code>True</code>. For example
 <h2 id="generic-hooks">Generic Hooks</h2>
 
 <p>There are seven Aurora API Methods which any of the three hook types can attach to. Thus, there are 21 possible hook/method combinations for a single <code>.aurora</code> config file. Say that you define <code>pre_</code> and <code>post_</code> hooks for the <code>restart</code> method. That leaves 19 undefined hook/method combinations; <code>err_restart</code> and the 3 <code>pre_</code>, <code>post_</code>, and <code>err_</code> hooks for each of the other 6 hookable methods. You can define what happens when any of these otherwise undefined 19 hooks execute via a generic hook, whose signature is:</p>
-<pre class="highlight python"><code><span class="n">generic_hook</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hook_config</span><span class="p">,</span> <span class="n">event</span><span class="p">,</span> <span class="n">method_name</span><span class="p">,</span> <span class="n">result_or_err</span><span class="p">,</span> <span class="n">args</span><span class="o">*</span><span class="p">,</span> <span class="n">kw</span><span class="o">**</span><span class="p">)</span>
+<pre class="highlight python"><code><span style="background-color: #f8f8f8">generic_hook</span><span style="background-color: #f8f8f8">(</span><span style="color: #999999">self</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">hook_config</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">event</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">method_name</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">result_or_err</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">args</span><span style="color: #000000;font-weight: bold">*</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">kw</span><span style="color: #000000;font-weight: bold">**</span><span style="background-color: #f8f8f8">)</span>
 </code></pre>
 
 <p>where:</p>
@@ -290,13 +290,13 @@ returning <code>True</code>. For example
 </ul>
 
 <p>Example:</p>
-<pre class="highlight python"><code><span class="c"># Overrides the standard do-nothing generic_hook by adding a log writing operation.</span>
-<span class="kn">from</span> <span class="nn">twitter.common</span> <span class="kn">import</span> <span class="n">log</span>
-  <span class="k">class</span> <span class="nc">Logger</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
-    <span class="s">'''Adds to the log every time a hookable API method is called'''</span>
-    <span class="k">def</span> <span class="nf">generic_hook</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hook_config</span><span class="p">,</span> <span class="n">event</span><span class="p">,</span> <span class="n">method_name</span><span class="p">,</span> <span class="n">result_or_err</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
-      <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">'</span><span class="si">%</span><span class="s">s: </span><span class="si">%</span><span class="s">s_</span><span class="si">%</span><span class="s">s of </span><span class="si">%</span><span class="s">s'</span>
-               <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span> <span class="n">event</span><span class="p">,</span> <span class="n">method_name</span><span class="p">,</span> <span class="n">hook_config</span><span class="o">.</span><span class="n">job_key</span><span class="p">))</span>
+<pre class="highlight python"><code><span style="color: #999988;font-style: italic"># Overrides the standard do-nothing generic_hook by adding a log writing operation.</span>
+<span style="color: #000000;font-weight: bold">from</span> <span style="color: #555555">twitter.common</span> <span style="color: #000000;font-weight: bold">import</span> <span style="background-color: #f8f8f8">log</span>
+  <span style="color: #000000;font-weight: bold">class</span> <span style="color: #445588;font-weight: bold">Logger</span><span style="background-color: #f8f8f8">(</span><span style="color: #0086B3">object</span><span style="background-color: #f8f8f8">):</span>
+    <span style="color: #d14">'''Adds to the log every time a hookable API method is called'''</span>
+    <span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">generic_hook</span><span style="background-color: #f8f8f8">(</span><span style="color: #999999">self</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">hook_config</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">event</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">method_name</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">result_or_err</span><span style="background-color: #f8f8f8">,</span> <span style="color: #000000;font-weight: bold">*</span><span style="background-color: #f8f8f8">args</span><span style="background-color: #f8f8f8">,</span> <span style="color: #000000;font-weight: bold">**</span><span style="background-color: #f8f8f8">kw</span><span style="background-color: #f8f8f8">)</span>
+      <span style="background-color: #f8f8f8">log</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">info</span><span style="background-color: #f8f8f8">(</span><span style="color: #d14">'</span><span style="color: #d14">%</span><span style="color: #d14">s: </span><span style="color: #d14">%</span><span style="color: #d14">s_</span><span style="color: #d14">%</span><span style="color: #d14">s of </span><span style="color: #d14">%</span><span style="color: #d14">s'</span>
+               <span style="color: #000000;font-weight: bold">%</span> <span style="background-color: #f8f8f8">(</span><span style="color: #999999">self</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">__class__</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">__name__</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">event</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">method_name</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">hook_config</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">job_key</span><span style="background-color: #f8f8f8">))</span>
 </code></pre>
 
 <h2 id="hooks-process-checklist">Hooks Process Checklist</h2>
@@ -304,13 +304,13 @@ returning <code>True</code>. For example
 <ol>
 <li>In your <code>.aurora</code> config file, add a <code>hooks</code> variable. Note that you may want to define a <code>.aurora</code> file only for hook definitions and then include this file in multiple other config files that you want to use the same hooks.</li>
 </ol>
-<pre class="highlight python"><code><span class="n">hooks</span> <span class="o">=</span> <span class="p">[]</span>
+<pre class="highlight python"><code><span style="background-color: #f8f8f8">hooks</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">[]</span>
 </code></pre>
 
 <ol>
 <li>In the <code>hooks</code> variable, list all objects that define hooks used by <code>Job</code>s defined in this config:</li>
 </ol>
-<pre class="highlight python"><code><span class="n">hooks</span> <span class="o">=</span> <span class="p">[</span><span class="n">Object_hook_definer1</span><span class="p">,</span> <span class="n">Object_hook_definer2</span><span class="p">]</span>
+<pre class="highlight python"><code><span style="background-color: #f8f8f8">hooks</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">[</span><span style="background-color: #f8f8f8">Object_hook_definer1</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">Object_hook_definer2</span><span style="background-color: #f8f8f8">]</span>
 </code></pre>
 
 <ol>

Modified: aurora/site/publish/documentation/latest/security/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/security/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/security/index.html (original)
+++ aurora/site/publish/documentation/latest/security/index.html Sat Dec 12 19:29:03 2015
@@ -268,24 +268,24 @@ for more information.</p>
 <h2 id="packaging-a-realm-module">Packaging a realm module</h2>
 
 <p>Package your custom Realm(s) with a Guice module that exposes a <code>Set&lt;Realm&gt;</code> multibinding.</p>
-<pre class="highlight java"><code><span class="kn">package</span> <span class="n">com</span><span class="o">.</span><span class="na">example</span><span class="o">;</span>
+<pre class="highlight java"><code><span style="color: #000000;font-weight: bold">package</span> <span style="background-color: #f8f8f8">com</span><span style="color: #000000;font-weight: bold">.</span><span style="color: #008080">example</span><span style="color: #000000;font-weight: bold">;</span>
 
-<span class="kn">import</span> <span class="nn">com.google.inject.AbstractModule</span><span class="o">;</span>
-<span class="kn">import</span> <span class="nn">com.google.inject.multibindings.Multibinder</span><span class="o">;</span>
-<span class="kn">import</span> <span class="nn">org.apache.shiro.realm.Realm</span><span class="o">;</span>
-
-<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyRealmModule</span> <span class="kd">extends</span> <span class="n">AbstractModule</span> <span class="o">{</span>
-  <span class="nd">@Override</span>
-  <span class="kd">public</span> <span class="kt">void</span> <span class="n">configure</span><span class="o">()</span> <span class="o">{</span>
-    <span class="n">Realm</span> <span class="n">myRealm</span> <span class="o">=</span> <span class="k">new</span> <span class="n">MyRealm</span><span class="o">();</span>
-
-    <span class="n">Multibinder</span><span class="o">.</span><span class="na">newSetBinder</span><span class="o">(</span><span class="n">binder</span><span class="o">(),</span> <span class="n">Realm</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">addBinding</span><span class="o">().</span><span class="na">toInstance</span><span class="o">(</span><span class="n">myRealm</span><span class="o">);</span>
-  <span class="o">}</span>
-
-  <span class="kd">static</span> <span class="kd">class</span> <span class="nc">MyRealm</span> <span class="kd">implements</span> <span class="n">Realm</span> <span class="o">{</span>
-    <span class="c1">// Realm implementation.</span>
-  <span class="o">}</span>
-<span class="o">}</span>
+<span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">com.google.inject.AbstractModule</span><span style="color: #000000;font-weight: bold">;</span>
+<span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">com.google.inject.multibindings.Multibinder</span><span style="color: #000000;font-weight: bold">;</span>
+<span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">org.apache.shiro.realm.Realm</span><span style="color: #000000;font-weight: bold">;</span>
+
+<span style="color: #000000;font-weight: bold">public</span> <span style="color: #000000;font-weight: bold">class</span> <span style="color: #445588;font-weight: bold">MyRealmModule</span> <span style="color: #000000;font-weight: bold">extends</span> <span style="background-color: #f8f8f8">AbstractModule</span> <span style="color: #000000;font-weight: bold">{</span>
+  <span style="color: #3c5d5d;font-weight: bold">@Override</span>
+  <span style="color: #000000;font-weight: bold">public</span> <span style="color: #445588;font-weight: bold">void</span> <span style="background-color: #f8f8f8">configure</span><span style="color: #000000;font-weight: bold">()</span> <span style="color: #000000;font-weight: bold">{</span>
+    <span style="background-color: #f8f8f8">Realm</span> <span style="background-color: #f8f8f8">myRealm</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #000000;font-weight: bold">new</span> <span style="background-color: #f8f8f8">MyRealm</span><span style="color: #000000;font-weight: bold">();</span>
+
+    <span style="background-color: #f8f8f8">Multibinder</span><span style="color: #000000;font-weight: bold">.</span><span style="color: #008080">newSetBinder</span><span style="color: #000000;font-weight: bold">(</span><span style="background-color: #f8f8f8">binder</span><span style="color: #000000;font-weight: bold">(),</span> <span style="background-color: #f8f8f8">Realm</span><span style="color: #000000;font-weight: bold">.</span><span style="color: #008080">class</span><span style="color: #000000;font-weight: bold">).</span><span style="color: #008080">addBinding</span><span style="color: #000000;font-weight: bold">().</span><span style="color: #008080">toInstance</span><span style="color: #000000;font-weight: bold">(</span><span style="background-color: #f8f8f8">myRealm</span><span style="color: #000000;font-weight: bold">);</span>
+  <span style="color: #000000;font-weight: bold">}</span>
+
+  <span style="color: #000000;font-weight: bold">static</span> <span style="color: #000000;font-weight: bold">class</span> <span style="color: #445588;font-weight: bold">MyRealm</span> <span style="color: #000000;font-weight: bold">implements</span> <span style="background-color: #f8f8f8">Realm</span> <span style="color: #000000;font-weight: bold">{</span>
+    <span style="color: #999988;font-style: italic">// Realm implementation.</span>
+  <span style="color: #000000;font-weight: bold">}</span>
+<span style="color: #000000;font-weight: bold">}</span>
 </code></pre>
 
 <p>To use your module in the scheduler, include it as a realm module based on its fully-qualified

Modified: aurora/site/publish/documentation/latest/tutorial/index.html
URL: http://svn.apache.org/viewvc/aurora/site/publish/documentation/latest/tutorial/index.html?rev=1719724&r1=1719723&r2=1719724&view=diff
==============================================================================
--- aurora/site/publish/documentation/latest/tutorial/index.html (original)
+++ aurora/site/publish/documentation/latest/tutorial/index.html Sat Dec 12 19:29:03 2015
@@ -89,20 +89,20 @@ this directory is the same as <code>/vag
 
 <!-- NOTE: If you are changing this file, be sure to also update examples/vagrant/test_tutorial.sh.
 -->
-<pre class="highlight python"><code><span class="kn">import</span> <span class="nn">sys</span>
-<span class="kn">import</span> <span class="nn">time</span>
+<pre class="highlight python"><code><span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">sys</span>
+<span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">time</span>
 
-<span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="p">):</span>
-  <span class="n">SLEEP_DELAY</span> <span class="o">=</span> <span class="mi">10</span>
-  <span class="c"># Python ninjas - ignore this blatant bug.</span>
-  <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">xrang</span><span class="p">(</span><span class="mi">100</span><span class="p">):</span>
-    <span class="k">print</span><span class="p">(</span><span class="s">"Hello world! The time is now: </span><span class="si">%</span><span class="s">s. Sleeping for </span><span class="si">%</span><span class="s">d secs"</span> <span class="o">%</span> <span class="p">(</span>
-      <span class="n">time</span><span class="o">.</span><span class="n">asctime</span><span class="p">(),</span> <span class="n">SLEEP_DELAY</span><span class="p">))</span>
-    <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
-    <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">SLEEP_DELAY</span><span class="p">)</span>
+<span style="color: #000000;font-weight: bold">def</span> <span style="color: #990000;font-weight: bold">main</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">argv</span><span style="background-color: #f8f8f8">):</span>
+  <span style="background-color: #f8f8f8">SLEEP_DELAY</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #009999">10</span>
+  <span style="color: #999988;font-style: italic"># Python ninjas - ignore this blatant bug.</span>
+  <span style="color: #000000;font-weight: bold">for</span> <span style="background-color: #f8f8f8">i</span> <span style="color: #000000;font-weight: bold">in</span> <span style="background-color: #f8f8f8">xrang</span><span style="background-color: #f8f8f8">(</span><span style="color: #009999">100</span><span style="background-color: #f8f8f8">):</span>
+    <span style="color: #000000;font-weight: bold">print</span><span style="background-color: #f8f8f8">(</span><span style="color: #d14">"Hello world! The time is now: </span><span style="color: #d14">%</span><span style="color: #d14">s. Sleeping for </span><span style="color: #d14">%</span><span style="color: #d14">d secs"</span> <span style="color: #000000;font-weight: bold">%</span> <span style="background-color: #f8f8f8">(</span>
+      <span style="background-color: #f8f8f8">time</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">asctime</span><span style="background-color: #f8f8f8">(),</span> <span style="background-color: #f8f8f8">SLEEP_DELAY</span><span style="background-color: #f8f8f8">))</span>
+    <span style="background-color: #f8f8f8">sys</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">stdout</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">flush</span><span style="background-color: #f8f8f8">()</span>
+    <span style="background-color: #f8f8f8">time</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">sleep</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">SLEEP_DELAY</span><span style="background-color: #f8f8f8">)</span>
 
-<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">"__main__"</span><span class="p">:</span>
-  <span class="n">main</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
+<span style="color: #000000;font-weight: bold">if</span> <span style="background-color: #f8f8f8">__name__</span> <span style="color: #000000;font-weight: bold">==</span> <span style="color: #d14">"__main__"</span><span style="background-color: #f8f8f8">:</span>
+  <span style="background-color: #f8f8f8">main</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">sys</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">argv</span><span style="background-color: #f8f8f8">)</span>
 </code></pre>
 
 <h2 id="aurora-configuration">Aurora Configuration</h2>
@@ -113,37 +113,37 @@ code in the file <code>hello_world.auror
 
 <!-- NOTE: If you are changing this file, be sure to also update examples/vagrant/test_tutorial.sh.
 -->
-<pre class="highlight python"><code><span class="n">pkg_path</span> <span class="o">=</span> <span class="s">'/vagrant/hello_world.py'</span>
+<pre class="highlight python"><code><span style="background-color: #f8f8f8">pkg_path</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'/vagrant/hello_world.py'</span>
 
-<span class="c"># we use a trick here to make the configuration change with</span>
-<span class="c"># the contents of the file, for simplicity.  in a normal setting, packages would be</span>
-<span class="c"># versioned, and the version number would be changed in the configuration.</span>
-<span class="kn">import</span> <span class="nn">hashlib</span>
-<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">pkg_path</span><span class="p">,</span> <span class="s">'rb'</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
-  <span class="n">pkg_checksum</span> <span class="o">=</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">md5</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">())</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span>
-
-<span class="c"># copy hello_world.py into the local sandbox</span>
-<span class="n">install</span> <span class="o">=</span> <span class="n">Process</span><span class="p">(</span>
-  <span class="n">name</span> <span class="o">=</span> <span class="s">'fetch_package'</span><span class="p">,</span>
-  <span class="n">cmdline</span> <span class="o">=</span> <span class="s">'cp </span><span class="si">%</span><span class="s">s . &amp;&amp; echo </span><span class="si">%</span><span class="s">s &amp;&amp; chmod +x hello_world.py'</span> <span class="o">%</span> <span class="p">(</span><span class="n">pkg_path</span><span class="p">,</span> <span class="n">pkg_checksum</span><span class="p">))</span>
-
-<span class="c"># run the script</span>
-<span class="n">hello_world</span> <span class="o">=</span> <span class="n">Process</span><span class="p">(</span>
-  <span class="n">name</span> <span class="o">=</span> <span class="s">'hello_world'</span><span class="p">,</span>
-  <span class="n">cmdline</span> <span class="o">=</span> <span class="s">'python hello_world.py'</span><span class="p">)</span>
-
-<span class="c"># describe the task</span>
-<span class="n">hello_world_task</span> <span class="o">=</span> <span class="n">SequentialTask</span><span class="p">(</span>
-  <span class="n">processes</span> <span class="o">=</span> <span class="p">[</span><span class="n">install</span><span class="p">,</span> <span class="n">hello_world</span><span class="p">],</span>
-  <span class="n">resources</span> <span class="o">=</span> <span class="n">Resources</span><span class="p">(</span><span class="n">cpu</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="n">ram</span> <span class="o">=</span> <span class="mi">1</span><span class="o">*</span><span class="n">MB</span><span class="p">,</span> <span class="n">disk</span><span class="o">=</span><span class="mi">8</span><span class="o">*</span><span class="n">MB</span><span class="p">))</span>
-
-<span class="n">jobs</span> <span class="o">=</span> <span class="p">[</span>
-  <span class="n">Service</span><span class="p">(</span><span class="n">cluster</span> <span class="o">=</span> <span class="s">'devcluster'</span><span class="p">,</span>
-          <span class="n">environment</span> <span class="o">=</span> <span class="s">'devel'</span><span class="p">,</span>
-          <span class="n">role</span> <span class="o">=</span> <span class="s">'www-data'</span><span class="p">,</span>
-          <span class="n">name</span> <span class="o">=</span> <span class="s">'hello_world'</span><span class="p">,</span>
-          <span class="n">task</span> <span class="o">=</span> <span class="n">hello_world_task</span><span class="p">)</span>
-<span class="p">]</span>
+<span style="color: #999988;font-style: italic"># we use a trick here to make the configuration change with</span>
+<span style="color: #999988;font-style: italic"># the contents of the file, for simplicity.  in a normal setting, packages would be</span>
+<span style="color: #999988;font-style: italic"># versioned, and the version number would be changed in the configuration.</span>
+<span style="color: #000000;font-weight: bold">import</span> <span style="color: #555555">hashlib</span>
+<span style="color: #000000;font-weight: bold">with</span> <span style="color: #0086B3">open</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">pkg_path</span><span style="background-color: #f8f8f8">,</span> <span style="color: #d14">'rb'</span><span style="background-color: #f8f8f8">)</span> <span style="color: #000000;font-weight: bold">as</span> <span style="background-color: #f8f8f8">f</span><span style="background-color: #f8f8f8">:</span>
+  <span style="background-color: #f8f8f8">pkg_checksum</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">hashlib</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">md5</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">f</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">read</span><span style="background-color: #f8f8f8">())</span><span style="color: #000000;font-weight: bold">.</span><span style="background-color: #f8f8f8">hexdigest</span><span style="background-color: #f8f8f8">()</span>
+
+<span style="color: #999988;font-style: italic"># copy hello_world.py into the local sandbox</span>
+<span style="background-color: #f8f8f8">install</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">Process</span><span style="background-color: #f8f8f8">(</span>
+  <span style="background-color: #f8f8f8">name</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'fetch_package'</span><span style="background-color: #f8f8f8">,</span>
+  <span style="background-color: #f8f8f8">cmdline</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'cp </span><span style="color: #d14">%</span><span style="color: #d14">s . &amp;&amp; echo </span><span style="color: #d14">%</span><span style="color: #d14">s &amp;&amp; chmod +x hello_world.py'</span> <span style="color: #000000;font-weight: bold">%</span> <span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">pkg_path</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">pkg_checksum</span><span style="background-color: #f8f8f8">))</span>
+
+<span style="color: #999988;font-style: italic"># run the script</span>
+<span style="background-color: #f8f8f8">hello_world</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">Process</span><span style="background-color: #f8f8f8">(</span>
+  <span style="background-color: #f8f8f8">name</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'hello_world'</span><span style="background-color: #f8f8f8">,</span>
+  <span style="background-color: #f8f8f8">cmdline</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'python hello_world.py'</span><span style="background-color: #f8f8f8">)</span>
+
+<span style="color: #999988;font-style: italic"># describe the task</span>
+<span style="background-color: #f8f8f8">hello_world_task</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">SequentialTask</span><span style="background-color: #f8f8f8">(</span>
+  <span style="background-color: #f8f8f8">processes</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">[</span><span style="background-color: #f8f8f8">install</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">hello_world</span><span style="background-color: #f8f8f8">],</span>
+  <span style="background-color: #f8f8f8">resources</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">Resources</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">cpu</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #009999">1</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">ram</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #009999">1</span><span style="color: #000000;font-weight: bold">*</span><span style="background-color: #f8f8f8">MB</span><span style="background-color: #f8f8f8">,</span> <span style="background-color: #f8f8f8">disk</span><span style="color: #000000;font-weight: bold">=</span><span style="color: #009999">8</span><span style="color: #000000;font-weight: bold">*</span><span style="background-color: #f8f8f8">MB</span><span style="background-color: #f8f8f8">)
 )</span>
+
+<span style="background-color: #f8f8f8">jobs</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">[</span>
+  <span style="background-color: #f8f8f8">Service</span><span style="background-color: #f8f8f8">(</span><span style="background-color: #f8f8f8">cluster</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'devcluster'</span><span style="background-color: #f8f8f8">,</span>
+          <span style="background-color: #f8f8f8">environment</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'devel'</span><span style="background-color: #f8f8f8">,</span>
+          <span style="background-color: #f8f8f8">role</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'www-data'</span><span style="background-color: #f8f8f8">,</span>
+          <span style="background-color: #f8f8f8">name</span> <span style="color: #000000;font-weight: bold">=</span> <span style="color: #d14">'hello_world'</span><span style="background-color: #f8f8f8">,</span>
+          <span style="background-color: #f8f8f8">task</span> <span style="color: #000000;font-weight: bold">=</span> <span style="background-color: #f8f8f8">hello_world_task</span><span style="background-color: #f8f8f8">)</span>
+<span style="background-color: #f8f8f8">]</span>
 </code></pre>
 
 <p>For more about Aurora configuration files, see the <a href="/documentation/latest/configuration-tutorial/">Configuration
@@ -192,12 +192,12 @@ do:</p>
 </code></pre>
 
 <p>You&rsquo;ll see something like:</p>
-<pre class="highlight javascript"><code><span class="p">[{</span>
-  <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"devcluster"</span><span class="p">,</span>
-  <span class="s2">"zk"</span><span class="p">:</span> <span class="s2">"192.168.33.7"</span><span class="p">,</span>
-  <span class="s2">"scheduler_zk_path"</span><span class="p">:</span> <span class="s2">"/aurora/scheduler"</span><span class="p">,</span>
-  <span class="s2">"auth_mechanism"</span><span class="p">:</span> <span class="s2">"UNAUTHENTICATED"</span>
-<span class="p">}]</span>
+<pre class="highlight javascript"><code><span style="background-color: #f8f8f8">[{</span>
+  <span style="color: #d14">"name"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"devcluster"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"zk"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"192.168.33.7"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"scheduler_zk_path"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"/aurora/scheduler"</span><span style="background-color: #f8f8f8">,</span>
+  <span style="color: #d14">"auth_mechanism"</span><span style="background-color: #f8f8f8">:</span> <span style="color: #d14">"UNAUTHENTICATED"</span>
+<span style="background-color: #f8f8f8">}]</span>
 </code></pre>
 
 <p>Use a <code>name</code> value for your job key&rsquo;s cluster value.</p>



Mime
View raw message