From 9475a62ccde70b8afd69b99bc7f787165612d237 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 15 Feb 2024 22:13:44 +0400 Subject: [PATCH 1/4] Document TLS/SSL options for import script --- docs/guide/machine-learning.asciidoc | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/guide/machine-learning.asciidoc b/docs/guide/machine-learning.asciidoc index 5c944d1d..08982363 100644 --- a/docs/guide/machine-learning.asciidoc +++ b/docs/guide/machine-learning.asciidoc @@ -191,4 +191,29 @@ eland_import_hub_model --es-api-key --url https://: .. -------------------------------------------------- eland_import_hub_model --hub-access-token ... -------------------------------------------------- --- \ No newline at end of file +-- + +[discrete] +[[ml-nlp-pytorch-tls]] +==== TLS/SSL + +The following TLS/SSL options for Elasticsearch are available when using the import script: + + +* Specify alternate CA bundle to verify the cluster certificate: ++ +-- +[source,bash] +-------------------------------------------------- +eland_import_hub_model --ca-certs CA_CERTS ... +-------------------------------------------------- +-- + +* Disable TLS/SSL verification altogether (strongly discouraged): ++ +-- +[source,bash] +-------------------------------------------------- +eland_import_hub_model --insecure ... +-------------------------------------------------- +-- From 8b03166885f5c74849ca06348e8d7c2c71bfe183 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 May 2024 17:15:57 +0400 Subject: [PATCH 2/4] Mention --help option --- docs/guide/machine-learning.asciidoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guide/machine-learning.asciidoc b/docs/guide/machine-learning.asciidoc index f80ba94c..59004c3e 100644 --- a/docs/guide/machine-learning.asciidoc +++ b/docs/guide/machine-learning.asciidoc @@ -60,6 +60,12 @@ $ eland_import_hub_model \ <1> <4> Specify the type of NLP task. Supported values are `fill_mask`, `ner`, `question_answering`, `text_classification`, `text_embedding`, and `zero_shot_classification`. +For more information about the available options, run `eland_import_hub_model` with the `--help` option. + +[source,bash] +------------------------ +$ eland_import_hub_model --help +------------------------ [discrete] [[ml-nlp-pytorch-docker]] From d0979da766fdc9a79b1f66211a06cf1ee7e7329b Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 May 2024 17:25:28 +0400 Subject: [PATCH 3/4] Add HTTP proxy support --- docs/guide/machine-learning.asciidoc | 14 ++++++++++++++ eland/cli/eland_import_hub_model.py | 1 + 2 files changed, 15 insertions(+) diff --git a/docs/guide/machine-learning.asciidoc b/docs/guide/machine-learning.asciidoc index 59004c3e..286b0ffa 100644 --- a/docs/guide/machine-learning.asciidoc +++ b/docs/guide/machine-learning.asciidoc @@ -154,6 +154,20 @@ underscores `__`. -- +[discrete] +[[ml-nlp-pytorch-proxy]] +==== Connect to Elasticsearch through a proxy + +Behind the scenes, Eland uses the `requests` Python library, which +https://requests.readthedocs.io/en/latest/user/advanced/#proxies[allows configuring +proxies through an environment variable]. For example, to use an HTTP proxy to connect to +an HTTPS Elasticsearch cluster, you would need to set the `HTTPS_PROXY` environment +variable when invoking Eland: + +[source,bash] +-------------------------------------------------- +HTTPS_PROXY=http://proxy-host:proxy-port eland_import_hub_model ... +-------------------------------------------------- [discrete] [[ml-nlp-pytorch-auth]] diff --git a/eland/cli/eland_import_hub_model.py b/eland/cli/eland_import_hub_model.py index a25034b3..39a4569b 100755 --- a/eland/cli/eland_import_hub_model.py +++ b/eland/cli/eland_import_hub_model.py @@ -164,6 +164,7 @@ def get_es_client(cli_args, logger): "request_timeout": 300, "verify_certs": cli_args.insecure, "ca_certs": cli_args.ca_certs, + "node_class": "requests", } # Deployment location From 81f87913ab85216f964fa7135febfa429771427a Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 May 2024 20:39:08 +0400 Subject: [PATCH 4/4] Mention HTTP_PROXY too --- docs/guide/machine-learning.asciidoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/guide/machine-learning.asciidoc b/docs/guide/machine-learning.asciidoc index 286b0ffa..861ea453 100644 --- a/docs/guide/machine-learning.asciidoc +++ b/docs/guide/machine-learning.asciidoc @@ -161,14 +161,17 @@ underscores `__`. Behind the scenes, Eland uses the `requests` Python library, which https://requests.readthedocs.io/en/latest/user/advanced/#proxies[allows configuring proxies through an environment variable]. For example, to use an HTTP proxy to connect to -an HTTPS Elasticsearch cluster, you would need to set the `HTTPS_PROXY` environment -variable when invoking Eland: +an HTTPS Elasticsearch cluster, you need to set the `HTTPS_PROXY` environment variable +when invoking Eland: [source,bash] -------------------------------------------------- HTTPS_PROXY=http://proxy-host:proxy-port eland_import_hub_model ... -------------------------------------------------- +If you disabled security on your Elasticsearch cluster, you should use `HTTP_PROXY` +instead. + [discrete] [[ml-nlp-pytorch-auth]] ==== Authentication methods