updated connection auth

This commit is contained in:
Jeff Vestal
2023-04-12 11:20:46 -05:00
parent 84c4d453f9
commit dee1303234

View File

@@ -4,7 +4,6 @@
"metadata": { "metadata": {
"colab": { "colab": {
"provenance": [], "provenance": [],
"toc_visible": true,
"include_colab_link": true "include_colab_link": true
}, },
"kernelspec": { "kernelspec": {
@@ -75,7 +74,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"pip install eland elasticsearch transformers torch==1.11" "pip -q install eland elasticsearch sentence_transformers transformers torch==1.11"
] ]
}, },
{ {
@@ -85,7 +84,9 @@
"from eland.ml.pytorch import PyTorchModel\n", "from eland.ml.pytorch import PyTorchModel\n",
"from eland.ml.pytorch.transformers import TransformerModel\n", "from eland.ml.pytorch.transformers import TransformerModel\n",
"from elasticsearch import Elasticsearch\n", "from elasticsearch import Elasticsearch\n",
"from elasticsearch.client import MlClient" "from elasticsearch.client import MlClient\n",
"\n",
"import getpass"
], ],
"metadata": { "metadata": {
"id": "wyUZXUi4RWWL" "id": "wyUZXUi4RWWL"
@@ -105,23 +106,15 @@
"id": "r7nMIbHke37Q" "id": "r7nMIbHke37Q"
} }
}, },
{
"cell_type": "code",
"source": [
"import getpass"
],
"metadata": {
"id": "Xsd2m7HoTCLm"
},
"execution_count": null,
"outputs": []
},
{ {
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"es_cloud_id = getpass.getpass('Enter Elastic Cloud ID: ')\n", "es_cloud_id = getpass.getpass('Enter Elastic Cloud ID: ')\n",
"es_api_id = getpass.getpass('Enter cluster API key ID: ') \n", "es_user = getpass.getpass('Enter cluster username: ') \n",
"es_api_key = getpass.getpass('Enter cluster API key: ')" "es_pass = getpass.getpass('Enter cluster password: ') \n",
"\n",
"#es_api_id = getpass.getpass('Enter cluster API key ID: ') \n",
"#es_api_key = getpass.getpass('Enter cluster API key: ')"
], ],
"metadata": { "metadata": {
"id": "SSGgYHome69o" "id": "SSGgYHome69o"
@@ -141,8 +134,11 @@
{ {
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"#es = Elasticsearch(cloud_id=es_cloud_id, \n",
"# api_key=(es_api_id, es_api_key)\n",
"# )\n",
"es = Elasticsearch(cloud_id=es_cloud_id, \n", "es = Elasticsearch(cloud_id=es_cloud_id, \n",
" api_key=(es_api_id, es_api_key)\n", " basic_auth=(es_user, es_pass)\n",
" )\n", " )\n",
"es.info() # should return cluster info" "es.info() # should return cluster info"
], ],
@@ -247,7 +243,8 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"## Verify the model started without issue" "## Verify the model started without issue\n",
"Should output -> {'routing_state': 'started'}"
], ],
"metadata": { "metadata": {
"id": "ZytlELrsnn_O" "id": "ZytlELrsnn_O"