This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
653 additions
and
253 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ <h1>Source code for pilot.control.payloads.eventservice</h1><div class="highligh | |
<span class="c1">#</span> | ||
<span class="c1"># Authors:</span> | ||
<span class="c1"># - Wen Guan, [email protected], 2017-2018</span> | ||
<span class="c1"># - Paul Nilsson, [email protected], 2020</span> | ||
<span class="c1"># - Paul Nilsson, [email protected], 2021</span> | ||
|
||
|
||
<span class="kn">import</span> <span class="nn">os</span> | ||
|
@@ -48,7 +48,6 @@ <h1>Source code for pilot.control.payloads.eventservice</h1><div class="highligh | |
<span class="kn">from</span> <span class="nn">pilot.common</span> <span class="kn">import</span> <span class="n">exception</span> | ||
<span class="kn">from</span> <span class="nn">pilot.control.payloads</span> <span class="kn">import</span> <span class="n">generic</span> | ||
<span class="kn">from</span> <span class="nn">pilot.eventservice.workexecutor.workexecutor</span> <span class="kn">import</span> <span class="n">WorkExecutor</span> | ||
<span class="kn">from</span> <span class="nn">pilot.util.config</span> <span class="kn">import</span> <span class="n">config</span> | ||
|
||
<span class="kn">import</span> <span class="nn">logging</span> | ||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span> | ||
|
@@ -94,7 +93,7 @@ <h1>Source code for pilot.control.payloads.eventservice</h1><div class="highligh | |
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"payload: </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">payload</span><span class="p">)</span> | ||
|
||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Starting EventService WorkExecutor"</span><span class="p">)</span> | ||
<span class="n">executor_type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_executor_type</span><span class="p">(</span><span class="n">job</span><span class="p">)</span> | ||
<span class="n">executor_type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_executor_type</span><span class="p">()</span> | ||
<span class="n">executor</span> <span class="o">=</span> <span class="n">WorkExecutor</span><span class="p">(</span><span class="n">args</span><span class="o">=</span><span class="n">executor_type</span><span class="p">)</span> | ||
<span class="n">executor</span><span class="o">.</span><span class="n">set_payload</span><span class="p">(</span><span class="n">payload</span><span class="p">)</span> | ||
<span class="n">executor</span><span class="o">.</span><span class="n">start</span><span class="p">()</span> | ||
|
@@ -112,28 +111,25 @@ <h1>Source code for pilot.control.payloads.eventservice</h1><div class="highligh | |
|
||
<span class="k">return</span> <span class="n">executor</span></div> | ||
|
||
<div class="viewcode-block" id="Executor.get_executor_type"><a class="viewcode-back" href="../../../../components/control/payloads/eventservice.html#pilot.control.payloads.eventservice.Executor.get_executor_type">[docs]</a> <span class="k">def</span> <span class="nf">get_executor_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">job</span><span class="p">):</span> | ||
<div class="viewcode-block" id="Executor.get_executor_type"><a class="viewcode-back" href="../../../../components/control/payloads/eventservice.html#pilot.control.payloads.eventservice.Executor.get_executor_type">[docs]</a> <span class="k">def</span> <span class="nf">get_executor_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="sd">"""</span> | ||
<span class="sd"> Get the executor type.</span> | ||
<span class="sd"> This is usually the 'generic' type, which means normal event service. It can also be 'raythena' if specified</span> | ||
<span class="sd"> in the pilot config file, and can also be dynamically decided using the job object (in the case of interceptor</span> | ||
<span class="sd"> job).</span> | ||
<span class="sd"> in the Pilot options.</span> | ||
|
||
<span class="sd"> :param job: job object.</span> | ||
<span class="sd"> :return: executor type dictionary.</span> | ||
<span class="sd"> """</span> | ||
|
||
<span class="c1"># executor_type = 'hpo' if job.is_hpo else config.Payload.executor_type</span> | ||
<span class="c1"># executor_type = 'hpo' if job.is_hpo else os.environ.get('PILOT_ES_EXECUTOR_TYPE', 'generic')</span> | ||
<span class="c1"># return {'executor_type': executor_type}</span> | ||
<span class="k">return</span> <span class="p">{</span><span class="s1">'executor_type'</span><span class="p">:</span> <span class="n">config</span><span class="o">.</span><span class="n">Payload</span><span class="o">.</span><span class="n">executor_type</span><span class="p">}</span></div> | ||
<span class="k">return</span> <span class="p">{</span><span class="s1">'executor_type'</span><span class="p">:</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'PILOT_ES_EXECUTOR_TYPE'</span><span class="p">,</span> <span class="s1">'generic'</span><span class="p">)}</span></div> | ||
|
||
<div class="viewcode-block" id="Executor.wait_graceful"><a class="viewcode-back" href="../../../../components/control/payloads/eventservice.html#pilot.control.payloads.eventservice.Executor.wait_graceful">[docs]</a> <span class="k">def</span> <span class="nf">wait_graceful</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">proc</span><span class="p">,</span> <span class="n">job</span><span class="p">):</span> | ||
<div class="viewcode-block" id="Executor.wait_graceful"><a class="viewcode-back" href="../../../../components/control/payloads/eventservice.html#pilot.control.payloads.eventservice.Executor.wait_graceful">[docs]</a> <span class="k">def</span> <span class="nf">wait_graceful</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">proc</span><span class="p">):</span> | ||
<span class="sd">"""</span> | ||
<span class="sd"> (add description)</span> | ||
|
||
<span class="sd"> :param args:</span> | ||
<span class="sd"> :param proc:</span> | ||
<span class="sd"> :param job:</span> | ||
<span class="sd"> :return:</span> | ||
<span class="sd"> """</span> | ||
|
||
|
Oops, something went wrong.