Skip to content

Commit

Permalink
Support HTTP proxies in eland_import_hub_model (#688)
Browse files Browse the repository at this point in the history
* Document TLS/SSL options for import script

* Mention --help option

* Add HTTP proxy support

* Mention HTTP_PROXY too

---------

Co-authored-by: David Kyle <david.kyle@elastic.co>
  • Loading branch information
pquentin and davidkyle authored May 2, 2024
1 parent f7f6e0a commit fd38e26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/guide/machine-learning.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
1 change: 1 addition & 0 deletions eland/cli/eland_import_hub_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd38e26

Please sign in to comment.