You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/asking_questions.rst
+14-15
Original file line number
Diff line number
Diff line change
@@ -63,14 +63,18 @@ You can also set the following options when you call :mod:`Child.ask <octue.reso
63
63
- ``subscribe_to_logs`` - if true, the child will forward its logs to you
64
64
- ``allow_local_files`` - if true, local files/datasets are allowed in any input manifest you supply
65
65
- ``handle_monitor_message`` - if provided a function, it will be called on any monitor messages from the child
66
-
- ``record_events`` – if ``True``, events received from the parent while it processes the question are saved to the ``Child.received_events`` property
66
+
- ``record_events`` – if true, events received from the parent while it processes the question are saved to the ``Child.received_events`` property
67
67
- ``save_diagnostics`` – must be one of {"SAVE_DIAGNOSTICS_OFF", "SAVE_DIAGNOSTICS_ON_CRASH", "SAVE_DIAGNOSTICS_ON"}; if turned on, allow the input values and manifest (and its datasets) to be saved by the child either all the time or just if the analysis fails
68
68
- ``question_uuid`` - if provided, the question will use this UUID instead of a generated one
69
69
- ``push_endpoint`` - if provided, the result and other events produced during the processing of the question will be pushed to this HTTP endpoint (a URL)
70
-
- ``asynchronous`` - if ``True``, don't wait for an answer to the question (the result and other events can be :ref:`retrieved from the event store later <retrieving_asynchronous_answers>`)
70
+
- ``asynchronous`` - if true, don't wait for an answer to the question (the result and other events can be :ref:`retrieved from the event store later <retrieving_asynchronous_answers>`)
71
+
- ``cpus`` - the number of CPUs to request for the question; defaults to the number set by the child service
72
+
- ``memory`` - the amount of memory to request for the question e.g. "256Mi" or "1Gi"; defaults to the amount set by the child service
73
+
- ``ephemeral_storage`` - the amount of ephemeral storage to request for the question e.g. "256Mi" or "1Gi"; defaults to the amount set by the child service
71
74
- ``timeout`` - how long in seconds to wait for an answer (``None`` by default - i.e. don't time out)
72
75
73
76
If the question fails:
77
+
74
78
- If ``raise_errors=False``, the unraised error is returned
75
79
- If ``raise_errors=False`` and ``max_retries > 0``, the question is retried up to this number of times
76
80
- If ``raise_errors=False``, ``max_retries > 0``, and ``prevent_retries_when`` is a list of exception types, the question is retried unless the error type is in the list
@@ -101,14 +105,12 @@ access the event store and run:
101
105
102
106
from octue.cloud.pub_sub.bigquery import get_events
- ``table_id`` - If you're not using the standard deployment, you can specify a different table here
112
114
- ``question_uuid`` - Retrieve events from this specific question
113
115
- ``parent_question_uuid`` - Retrieve events from questions triggered by the same parent question (this doesn't include the parent question's events)
114
116
- ``originator_question_uuid`` - Retrieve events for the entire tree of questions triggered by an originator question (a question asked manually through ``Child.ask``; this does include the originator question's events)
@@ -219,7 +221,7 @@ This method uses multithreading, allowing all the questions to be asked at once
219
221
220
222
Asking a question within a service
221
223
==================================
222
-
If you have :doc:`created your own Octue service <creating_services>` and want to ask children questions, you can do
224
+
If you have :doc:`created your own Twined service <creating_services>` and want to ask children questions, you can do
223
225
this more easily than above. Children are accessible from the ``analysis`` object by the keys you give them in the
224
226
:ref:`app configuration <app_configuration>` file. For example, you can ask an ``elevation`` service a question like
225
227
this:
@@ -351,20 +353,17 @@ whole tree of children, grandchildren, and so on, please `upvote this issue.
351
353
Using a service registry
352
354
========================
353
355
When asking a question, you can optionally specify one or more `service registries
354
-
<https://django-twined.readthedocs.io/en/latest/>`_ to resolve SRUIDs against. This is analogous to specifying a
355
-
different ``pip`` index for resolving package names when using ``pip install``. If you don't specify any registries, the
356
-
default Octue service registry is used.
357
-
358
-
Specifying service registries can be useful if:
356
+
<https://django-twined.readthedocs.io/en/latest/>`_ to resolve SRUIDs against. This checks if the service revision
357
+
exists (good for catching typos in SRUIDs) and raises an error if it doesn't. Service registries can also get the
358
+
default revision of a service if you don't provide a revision tag. Asking a question if without specifying a registry
359
+
will bypass these checks.
359
360
360
-
- You have your own private services that aren't on the default Octue service registry
361
-
- You want services from one service registry with the same name as in another service registry to be prioritised
362
361
363
362
Specifying service registries
364
363
-----------------------------
365
364
You can specify service registries in two ways:
366
365
367
-
1. Globally for all questions asked inside a service. In the service configuration (``octue.yaml`` file):
366
+
1. For all questions asked inside a service. In the service configuration (``octue.yaml`` file):
0 commit comments