Skip to content

Commit

Permalink
Update CI and docs to remove references to default admin creds (opens…
Browse files Browse the repository at this point in the history
…earch-project#365)

* Update CI and docs to remove references to default admin creds

Signed-off-by: Derek Ho <[email protected]>

* Add changelog line

Signed-off-by: Derek Ho <[email protected]>

* Echo opensearch version

Signed-off-by: Derek Ho <[email protected]>

* Update logic in determining version

Signed-off-by: Derek Ho <[email protected]>

* Change variable ref

Signed-off-by: Derek Ho <[email protected]>

* Modify version logic to be same as build repo

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho authored Jan 31, 2024
1 parent 9b2f686 commit bc6d94f
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 15 deletions.
14 changes: 13 additions & 1 deletion .ci/run-opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ environment=($(cat <<-END
--env cluster.name=$cluster_name
--env discovery.type=single-node
--env discovery.seed_hosts=$master_node_name
--env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!
--env cluster.routing.allocation.disk.threshold_enabled=false
--env bootstrap.memory_lock=true
--env node.attr.testattr=test
Expand Down Expand Up @@ -62,10 +63,21 @@ END
local_detach="true"
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi

OPENSEARCH_REQUIRED_VERSION="2.12.0"

password="admin"
# Starting in 2.12.0, security demo configuration script requires an initial admin password
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $OPENSEARCH_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
password="admin"
else
password="myStrongPassword123!"
fi

set -x
healthcmd="curl -vvv -s --fail http://localhost:9200/_cluster/health || exit 1"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
healthcmd="curl -vvv -s --insecure -u admin:admin --fail https://localhost:9200/_cluster/health || exit 1"
healthcmd="curl -vvv -s --insecure -u admin:$password --fail https://localhost:9200/_cluster/health || exit 1"
fi

CLUSTER_TAG=$CLUSTER
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add support for Model Access Control - Register, Update, Search and Delete by @rawwar in ([#332](https://github.com/opensearch-project/opensearch-py-ml/pull/332))
- Add support for model connectors by @rawwar in ([#345](https://github.com/opensearch-project/opensearch-py-ml/pull/345))
- Add support for model profiles by @rawwar in ([#358](https://github.com/opensearch-project/opensearch-py-ml/pull/358))
- Support for security default admin credential changes in 2.12.0 in ([#365](https://github.com/opensearch-project/opensearch-py-ml/pull/365))


### Changed
- Modify ml-models.JenkinsFile so that it takes model format into account and can be triggered with generic webhook by @thanawan-atc in ([#211](https://github.com/opensearch-project/opensearch-py-ml/pull/211))
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ $ make html
```yml
opensearch.hosts: ["https://localhost:9200"]
opensearch.username: "admin" # Default username
opensearch.password: "admin" # Default password
opensearch.password: "< admin password >" # Password set during setup
```
## Code guidelines
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_deploy_cliptextmodel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"# Connect to OpenSearch cluster\n",
"host = 'localhost'\n",
"port = 9200\n",
"auth = ('admin', 'admin') # For testing only. Don't store credentials in code.\n",
"auth = ('admin', '< admin password >') # For testing only. Don't store credentials in code.\n",
"\n",
"def get_os_client(host = host, port = port, auth = auth):\n",
" '''\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_metrics_correlation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"\n",
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" \"\"\"\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/demo_ml_commons_integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/demo_notebook.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"source": [
"def get_os_client(cluster_url = CLUSTER_URL,\n",
" username='admin',\n",
" password='admin'):\n",
" password='< admin password >'):\n",
" '''\n",
" Get OpenSearch client\n",
" :param cluster_url: cluster URL like https://ml-te-netwo-1s12ba42br23v-ff1736fa7db98ff2.elb.us-west-2.amazonaws.com:443\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/online_retail_analysis.ipynb

Large diffs are not rendered by default.

0 comments on commit bc6d94f

Please sign in to comment.