From fd38e26df19661ec156fc16ccbbe7b4b6e44b089 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 May 2024 21:03:44 +0400 Subject: [PATCH] Support HTTP proxies in eland_import_hub_model (#688) * Document TLS/SSL options for import script * Mention --help option * Add HTTP proxy support * Mention HTTP_PROXY too --------- Co-authored-by: David Kyle --- docs/guide/machine-learning.asciidoc | 17 +++++++++++++++++ eland/cli/eland_import_hub_model.py | 1 + 2 files changed, 18 insertions(+) diff --git a/docs/guide/machine-learning.asciidoc b/docs/guide/machine-learning.asciidoc index 59004c3e..861ea453 100644 --- a/docs/guide/machine-learning.asciidoc +++ b/docs/guide/machine-learning.asciidoc @@ -154,6 +154,23 @@ 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 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]] 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