From 668d4f7c079b7cb476ebd65d468a0ae47587ee96 Mon Sep 17 00:00:00 2001 From: Aaron Vincent 6411 Date: Wed, 24 Aug 2022 06:09:02 -0400 Subject: [PATCH] Created Advanced Quiz Answers.md file --- Advanced Quiz Answers.md | 70 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Advanced Quiz Answers.md diff --git a/Advanced Quiz Answers.md b/Advanced Quiz Answers.md new file mode 100644 index 0000000..c4e806d --- /dev/null +++ b/Advanced Quiz Answers.md @@ -0,0 +1,70 @@ +# Advanced Quiz Answers + +**1. When should you use 'replicas'?** + +- [:heavy_check_mark:] When you want to run multiple executors in parallel to increase throughput and availability. +- ☐ When you want to partition big indices +- ☐ When you need to segment large texts into smaller chunks +- ☐ When you need to segment large texts into smaller chunks + +**2. What is a valid signature for a function that uses the @requests decorator?** + +- ☐ def foo(self, docs, *args) +- ☐ def foo(docs, **kwargs) +- [:heavy_check_mark:] def foo(self, docs, parameters, **kwargs) +- ☐ def foo(cls, docs, docs_matrix, **kwargs) + +**3. How to control mesage overflow at the Executor?** + +- ☐ Use prefetch>0 with the Client +- [:heavy_check_mark:] Use prefetch>0 while starting the Flow +- ☐ Use shards>1 with the Executor +- ☐ Use overload=0 environment variable in the Executor + +**4. How to override the `with` configurations when using an Executor from Jina Hub?** + +- [:heavy_check_mark:] Use uses_with argument +- ☐ Use overide_with argument +- ☐ Use with argument +- ☐ Use customized_with argument + +**5. How to provide custom models to containerized Hub encoders?** + +- [:heavy_check_mark:] Use the volumes parameter to specify a disk volume that contains the model files and specify the custom model path in the Executor parameters +- ☐ Upload the custom model to HuggingFace +- ☐ Specify the custom model path in the Executor parameters +- ☐ It is not possible with Jina + +**6. Which amongst these is not a right syntax to use an already existing Executor from Hub?** + +- ☐ Executor.from_hub('jinahub://DummyHubExecutor') +- ☐ Flow().add(uses='jinahub+docker://DummyHubExecutor') +- [:heavy_check_mark:] DocumentArray.load_from('jinahub://DummyHubExecutor') +- ☐ Flow().add(uses='jinahub://DummyHubExecutor') + +**7. Which is correct about the retention policy for the Flows deployed on JCloud?** + +- ☐ Flows are kept forever. +- ☐ By default Flows will be removed after 24 hrs, regardless of whether it's in use / has been used or not. +- [:heavy_check_mark:] You can configure the Flow retention days in Flow YAML. + +**8. How can I make sure Executors only receive Documents meeting certain conditions?** + +- ☐ Adding Flow().add(condition=...) with condition beind defined with DocArray query language +- ☐ Adding Flow().add(when=...) with condition being defined with DocArray query language +- [:heavy_check_mark:] Adding Flow().add(when=...) with condition being defined with your own query language +- ☐ Adding Flow().add(condition=...) with condition beind defined with your own query language + +**9. What is the way Jina exposes to check the readiness of a Flow from a Client?** + +- [:heavy_check_mark:] client.dry_run() +- ☐ client.health_check() +- ☐ client.post() +- ☐ client.index() + +**10. How can you monitor the Flow?** + +- [:heavy_check_mark:] Flow(monitoring=True, port_monitoring=9090) and scrape metrics using Prometheus +- ☐ Send a HTTP request to each Executor +- ☐ Flow(monitoring=True, port_monitoring=9090) and client.monitor(port=9090) +- ☐ Monitoring is available only in JCloud