Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Wrap Up Profile API #285

Closed
dhrubo-os opened this issue Sep 17, 2023 · 12 comments · Fixed by #358
Closed

[FEATURE] Wrap Up Profile API #285

dhrubo-os opened this issue Sep 17, 2023 · 12 comments · Fixed by #358
Assignees
Labels
CCI enhancement New feature or request good first issue Good for newcomers

Comments

@dhrubo-os
Copy link
Collaborator

Is your feature request related to a problem?

We started building Profile API in opensearch-py-ml repo: PR : #119

We need to wrap up this PR with adding unit test and further development (if needed) with addressing the comments.

@dhrubo-os dhrubo-os added enhancement New feature or request good first issue Good for newcomers labels Sep 17, 2023
@dhrubo-os dhrubo-os added CCI and removed untriaged labels Sep 17, 2023
@MaximilianMeiler
Copy link

I'll try my hand at this issue.

@dhrubo-os
Copy link
Collaborator Author

Thanks, assigned it to you.

@rawwar
Copy link
Contributor

rawwar commented Dec 6, 2023

@dhrubo-os , I will be working on this issue. Thanks

@dhrubo-os dhrubo-os assigned rawwar and unassigned MaximilianMeiler Dec 6, 2023
@dhrubo-os
Copy link
Collaborator Author

Thanks, assigned to you. @rawwar

@rawwar
Copy link
Contributor

rawwar commented Dec 6, 2023

@dhrubo-os ,
Having issues with getting task related data in the Profile API.

When I search for tasks using the following query, i get a lot of results.

 GET /_plugins/_ml/tasks/_search
{
  "query": {
    "match_all": {}
  },
  "size": 1000
}

One of the hits is as below

{
        "_index": ".plugins-ml-task",
        "_id": "Mhg2QYwBo5vXBZPtIh6Z",
        "_version": 3,
        "_seq_no": 24,
        "_primary_term": 1,
        "_score": 1,
        "_source": {
          "last_update_time": 1701901116071,
          "create_time": 1701901116057,
          "is_async": true,
          "function_name": "KMEANS",
          "input_type": "SEARCH_QUERY",
          "worker_node": [
            "TUeFQYfQRDWq5oc1-s1rhQ"
          ],
          "state": "COMPLETED",
          "model_id": "NBg2QYwBo5vXBZPtIh6g",
          "task_type": "TRAINING"
        }
      }

Now, when I try to get tasks using profile, i get nothing.

Query:

GET /_plugins/_ml/profile/tasks/

Result

{}

I tried giving "return_all_tasks": true and its still same empty result.

I also tried to use the task id from the above search result and its still an empty result

GET /_plugins/_ml/profile/tasks/Mhg2QYwBo5vXBZPtIh6Z

Result:

{}

Am i doing anything wrong here?

@dhrubo-os
Copy link
Collaborator Author

GET /_plugins/_ml/profile/tasks/

Returns runtime data for a specific task. You can string together multiple task_ids to return multiple task profiles

So I think, tasks are completed and not available in the memory?

@rawwar
Copy link
Contributor

rawwar commented Dec 6, 2023

Returns runtime data for a specific task. You can string together multiple task_ids to return multiple task profiles

I interpreted this line as some runtime logs available for viewing at a later point. Reason being, for model profile, all of the model tasks are complete and they are returned as well.

@rawwar
Copy link
Contributor

rawwar commented Dec 6, 2023

So I think, tasks are completed and not available in the memory?

I am not sure how we can test this. Since tests don't run in parallel, there's no way to test this if its in-progress data. I'll just ensure an OK response. Is that ok?

@dhrubo-os
Copy link
Collaborator Author

So I think, tasks are completed and not available in the memory?

I am not sure how we can test this. Since tests don't run in parallel, there's no way to test this if its in-progress data. I'll just ensure an OK response. Is that ok?

Yup, that should be fine for now.

@dhrubo-os
Copy link
Collaborator Author

Returns runtime data for a specific task. You can string together multiple task_ids to return multiple task profiles

I interpreted this line as some runtime logs available for viewing at a later point. Reason being, for model profile, all of the model tasks are complete and they are returned as well.

Those models tasks persisted in the index, so you can see. But for the profile api, we look into the memory. That's why outpout is different.

@rawwar
Copy link
Contributor

rawwar commented Dec 7, 2023

@dhrubo-os , one information I could not get from documentation is the minimum OpenSearch version required for this API. Tests are successfully running for 2.7 and 2.11 for now. Hence, i haven't added any minimum version requirements for these tests

@dhrubo-os
Copy link
Collaborator Author

@dhrubo-os , one information I could not get from documentation is the minimum OpenSearch version required for this API. Tests are successfully running for 2.7 and 2.11 for now. Hence, i haven't added any minimum version requirements for these tests

We can keep min version as 2.7 for now. That should be fine.

ylwu-amzn pushed a commit that referenced this issue Jan 3, 2024
* init

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* update changelog

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* update

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* lint fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* reuse validate input

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* update comment

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* change

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* update changelog

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* remove separate model profile module

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix tests

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix lint

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix lint

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* fix

Signed-off-by: kalyanr <kalyan.ben10@live.com>

* Update ml_commons_client.py

Signed-off-by: Kalyan <kalyan.ben10@live.com>

---------

Signed-off-by: kalyanr <kalyan.ben10@live.com>
Signed-off-by: Kalyan <kalyan.ben10@live.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCI enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants