Skip to content

Commit

Permalink
Merge branch 'main' of github.com:rawwar/opensearch-py-ml into kalyan…
Browse files Browse the repository at this point in the history
…/ml-commons-stats

Signed-off-by: kalyanr <[email protected]>
  • Loading branch information
rawwar committed Mar 6, 2024
2 parents 72135e8 + e0b1bcf commit 8afa13b
Show file tree
Hide file tree
Showing 25 changed files with 387 additions and 179 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
6 changes: 3 additions & 3 deletions .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [[ "$TASK_TYPE" == "test" ]]; then
--env "TEST_TYPE=server" \
--name opensearch-py-ml-test-runner \
opensearch-project/opensearch-py-ml \
nox -s "test-${PYTHON_VERSION}(pandas_version='${PANDAS_VERSION}')"
nox -s "test-${PYTHON_VERSION}"

docker cp opensearch-py-ml-test-runner:/code/opensearch-py-ml/junit/ ./junit/
docker rm opensearch-py-ml-test-runner
Expand All @@ -61,7 +61,7 @@ elif [[ "$TASK_TYPE" == "doc" ]]; then
--env "TEST_TYPE=server" \
--name opensearch-py-ml-doc-runner \
opensearch-project/opensearch-py-ml \
nox -s "docs-${PYTHON_VERSION}(pandas_version='${PANDAS_VERSION}')"
nox -s "docs-${PYTHON_VERSION}"

docker cp opensearch-py-ml-doc-runner:/code/opensearch-py-ml/docs/build/ ./docs/
docker rm opensearch-py-ml-doc-runner
Expand All @@ -84,7 +84,7 @@ elif [[ "$TASK_TYPE" == "trace" ]]; then
--env "TEST_TYPE=server" \
--name opensearch-py-ml-trace-runner \
opensearch-project/opensearch-py-ml \
nox -s "trace-${PYTHON_VERSION}(pandas_version='${PANDAS_VERSION}')" -- ${MODEL_ID} ${MODEL_VERSION} ${TRACING_FORMAT} -ed ${EMBEDDING_DIMENSION} -pm ${POOLING_MODE} -md ${MODEL_DESCRIPTION:+"$MODEL_DESCRIPTION"}
nox -s "trace-${PYTHON_VERSION}" -- ${MODEL_ID} ${MODEL_VERSION} ${TRACING_FORMAT} -ed ${EMBEDDING_DIMENSION} -pm ${POOLING_MODE} -md ${MODEL_DESCRIPTION:+"$MODEL_DESCRIPTION"}

docker cp opensearch-py-ml-trace-runner:/code/opensearch-py-ml/upload/ ./upload/
docker cp opensearch-py-ml-trace-runner:/code/opensearch-py-ml/trace_output/ ./trace_output/
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add support for train api functionality by @rawwar in ([#310](https://github.com/opensearch-project/opensearch-py-ml/pull/310))
- 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))
- Add support for ML-commons stats API by @rawwar in ([#354](https://github.com/opensearch-project/opensearch-py-ml/pull/354))


### 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))
- Update demo_tracing_model_torchscript_onnx.ipynb to use make_model_config_json by @thanawan-atc in ([#220](https://github.com/opensearch-project/opensearch-py-ml/pull/220))
Expand All @@ -31,7 +34,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Enable the model upload workflow to add model_content_size_in_bytes & model_content_hash_value to model config automatically @thanawan-atc ([#291](https://github.com/opensearch-project/opensearch-py-ml/pull/291))
- Update pretrained_models_all_versions.json (2023-10-18 18:11:34) by @dhrubo-os ([#322](https://github.com/opensearch-project/opensearch-py-ml/pull/322))
- Update model upload history - sentence-transformers/paraphrase-mpnet-base-v2 (v.1.0.0)(BOTH) by @dhrubo-os ([#321](https://github.com/opensearch-project/opensearch-py-ml/pull/321))
- Replaced usage of `is_datetime_or_timedelta_dtype` with `is_timedelta64_dtype` and `is_datetime64_any_dtype`([#316](https://github.com/opensearch-project/opensearch-py-ml/pull/316))
- Replaced usage of `is_datetime_or_timedelta_dtype` with `is_timedelta64_dtype` and `is_datetime64_any_dtype` by @rawwar ([#316](https://github.com/opensearch-project/opensearch-py-ml/pull/316))
- use try-except-else block for handling unexpected exceptions during integration tests by @rawwar([#370](https://github.com/opensearch-project/opensearch-py-ml/pull/370))
- Removed pandas version pin in nox tests by @rawwar ([#368](https://github.com/opensearch-project/opensearch-py-ml/pull/368))

### Fixed
- Enable make_model_config_json to add model description to model config file by @thanawan-atc in ([#203](https://github.com/opensearch-project/opensearch-py-ml/pull/203))
Expand All @@ -45,6 +50,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fix pandas dependency issue in nox session by installing pandas package to python directly by @thanawan-atc in ([#266](https://github.com/opensearch-project/opensearch-py-ml/pull/266))
- Fix conditional job execution issue in model upload workflow by @thanawan-atc in ([#294](https://github.com/opensearch-project/opensearch-py-ml/pull/294))
- fix bug in `MLCommonClient_client.upload_model` by @rawwar in ([#336](https://github.com/opensearch-project/opensearch-py-ml/pull/336))
- fix lint issues on main by @rawwar in ([#374](https://github.com/opensearch-project/opensearch-py-ml/pull/374))

## [1.1.0]

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
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import os
import sys


sys.path.insert(0, os.path.abspath("../../"))

# -- Project information -----------------------------------------------------
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
Loading

0 comments on commit 8afa13b

Please sign in to comment.