-
Notifications
You must be signed in to change notification settings - Fork 129
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
the dev of [FEATURE]Auto reload model when cluster rebooted/node rejoin #639
Closed
Closed
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3e48e36
Add .whitesource configuration file (#611)
mend-for-github-com[bot] 80aaaa8
Update dependency junit:junit to v4.13.1 (#625)
mend-for-github-com[bot] b2f18e4
[wjunshen] #ML-Commons Model auto reload feat: add 2 properties about…
wujunshen a286309
[wjunshen] #ML-Commons Model auto reload feat: code format by spotles…
wujunshen d3047d6
[wjunshen] #N/A feat: add guava retry 3rd party jar
wujunshen 25b9c36
[wjunshen] #N/A feat: init async method and add retry logic
wujunshen 31735c8
[wjunshen] #N/A feat: add todo comment
wujunshen d4db55d
[wjunshen] #N/A feat: for loose couple, create new Manager class to i…
wujunshen c6850b7
[wjunshen] #N/A feat: comment retry part
wujunshen 0df9ac3
[wjunshen] #N/A feat: finish the function: get all loaded model id fr…
wujunshen 4191631
[wjunshen] #N/A feat: finish the function: auto reload model on assig…
wujunshen c273609
[wjunshen] #N/A feat: new model reload index to stroe retry times and…
wujunshen 9e321c5
[wjunshen] #N/A feat: run spotless.JavaApply task
wujunshen 99b7639
[wjunshen] #N/A feat: add the function "create index"&"insert data"&…
wujunshen 30068b3
[wjunshen] #N/A feat: add the function "create index"&"insert data"&…
wujunshen 7a4b0b8
[wjunshen] #N/A style: rollback MLModelManager.java and build.gradle(…
wujunshen ae035df
[wjunshen] #N/A feat: modify the code acordding to the zan's opnion
wujunshen 5a50842
[wjunshen] #N/A docs: add java doc under MLModelAutoReloader class
wujunshen b9cd79f
[wjunshen] #N/A feat: tuning code
wujunshen 01dc262
[wjunshen] #N/A feat: tunning code
wujunshen 507219e
[wjunshen] #N/A test: add IT test code
wujunshen bb0b5a2
[wjunshen] #N/A fix: for resolve the problems of the check on github
wujunshen 07252eb
[wjunshen] #N/A fix: for resolve the problems of the check on github
wujunshen c5509cf
[wjunshen] #wjunshen<wjunshen@amazon.com> test: add some test codes
wujunshen 6959fd4
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen 7b4465d
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen c22f69d
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen e85d3c4
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen 3dc994b
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen fb75bf8
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen d8e3946
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen 851e2d7
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen f39385d
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen cdc5951
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen 5183ddc
[wjunshen] #N/A test: wjunshen@amazon.com
wujunshen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"scanSettings": { | ||
"configMode": "AUTO", | ||
"configExternalURL": "", | ||
"projectToken": "", | ||
"baseBranches": [] | ||
}, | ||
"checkRunSettings": { | ||
"vulnerableCheckRunConclusionLevel": "failure", | ||
"displayMode": "diff", | ||
"useMendCheckNames": true | ||
}, | ||
"issueSettings": { | ||
"minSeverityLevel": "LOW", | ||
"issueType": "DEPENDENCY" | ||
}, | ||
"remediateSettings": { | ||
"workflowRules": { | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,129 +26,134 @@ public class CommonValue { | |
public static String WARM_BOX_TYPE = "warm"; | ||
|
||
public static final String ML_MODEL_INDEX = ".plugins-ml-model"; | ||
public static final String ML_MODEL_RELOAD_INDEX = ".plugins-ml-model-reload"; | ||
public static final Integer ML_MODEL_RELOAD_MAX_RETRY_TIMES = 2; | ||
public static final String ML_TASK_INDEX = ".plugins-ml-task"; | ||
public static final Integer ML_MODEL_INDEX_SCHEMA_VERSION = 2; | ||
public static final Integer ML_TASK_INDEX_SCHEMA_VERSION = 1; | ||
public static final String USER_FIELD_MAPPING = " \"" | ||
+ CommonValue.USER | ||
+ "\": {\n" | ||
+ " \"type\": \"nested\",\n" | ||
+ " \"properties\": {\n" | ||
+ " \"name\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\", \"ignore_above\":256}}},\n" | ||
+ " \"backend_roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" | ||
+ " \"roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" | ||
+ " \"custom_attribute_names\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}}\n" | ||
+ " }\n" | ||
+ " }\n"; | ||
+ CommonValue.USER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Format your code before commit to avoid change the format, this isn't your change. |
||
+ "\": {\n" | ||
+ " \"type\": \"nested\",\n" | ||
+ " \"properties\": {\n" | ||
+ " \"name\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\", \"ignore_above\":256}}},\n" | ||
+ " \"backend_roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" | ||
+ " \"roles\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}},\n" | ||
+ " \"custom_attribute_names\": {\"type\":\"text\", \"fields\":{\"keyword\":{\"type\":\"keyword\"}}}\n" | ||
+ " }\n" | ||
+ " }\n"; | ||
public static final String NODE_ID_FIELD = "node_id"; | ||
public static final String MODEL_LOAD_RETRY_TIMES_FIELD = "retry_times"; | ||
|
||
public static final String ML_MODEL_INDEX_MAPPING = "{\n" | ||
+ " \"_meta\": {\"schema_version\": " | ||
+ ML_MODEL_INDEX_SCHEMA_VERSION | ||
+ "},\n" | ||
+ " \"properties\": {\n" | ||
+ " \"" | ||
+ MLModel.ALGORITHM_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_NAME_FIELD | ||
+ "\" : {\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\n" | ||
+ " \"" | ||
+ MLModel.OLD_MODEL_VERSION_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_VERSION_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_FIELD | ||
+ "\" : {\"type\": \"binary\"},\n" | ||
+ " \"" | ||
+ MLModel.CHUNK_NUMBER_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.TOTAL_CHUNKS_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_ID_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.DESCRIPTION_FIELD | ||
+ "\" : {\"type\": \"text\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_FORMAT_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_STATE_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_SIZE_IN_BYTES_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONFIG_FIELD | ||
+ "\" : {\"properties\":{\"" | ||
+ MODEL_TYPE_FIELD + "\":{\"type\":\"keyword\"},\"" | ||
+ EMBEDDING_DIMENSION_FIELD + "\":{\"type\":\"integer\"},\"" | ||
+ FRAMEWORK_TYPE_FIELD + "\":{\"type\":\"keyword\"},\"" | ||
+ ALL_CONFIG_FIELD + "\":{\"type\":\"text\"}}},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_HASH_VALUE_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.CREATED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_UPLOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_LOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_UNLOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ USER_FIELD_MAPPING | ||
+ " }\n" | ||
+ "}"; | ||
+ " \"_meta\": {\"schema_version\": " | ||
+ ML_MODEL_INDEX_SCHEMA_VERSION | ||
+ "},\n" | ||
+ " \"properties\": {\n" | ||
+ " \"" | ||
+ MLModel.ALGORITHM_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_NAME_FIELD | ||
+ "\" : {\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\n" | ||
+ " \"" | ||
+ MLModel.OLD_MODEL_VERSION_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_VERSION_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_FIELD | ||
+ "\" : {\"type\": \"binary\"},\n" | ||
+ " \"" | ||
+ MLModel.CHUNK_NUMBER_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.TOTAL_CHUNKS_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_ID_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.DESCRIPTION_FIELD | ||
+ "\" : {\"type\": \"text\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_FORMAT_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_STATE_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_SIZE_IN_BYTES_FIELD | ||
+ "\" : {\"type\": \"long\"},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONFIG_FIELD | ||
+ "\" : {\"properties\":{\"" | ||
+ MODEL_TYPE_FIELD + "\":{\"type\":\"keyword\"},\"" | ||
+ EMBEDDING_DIMENSION_FIELD + "\":{\"type\":\"integer\"},\"" | ||
+ FRAMEWORK_TYPE_FIELD + "\":{\"type\":\"keyword\"},\"" | ||
+ ALL_CONFIG_FIELD + "\":{\"type\":\"text\"}}},\n" | ||
+ " \"" | ||
+ MLModel.MODEL_CONTENT_HASH_VALUE_FIELD | ||
+ "\" : {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLModel.CREATED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_UPLOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_LOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLModel.LAST_UNLOADED_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ USER_FIELD_MAPPING | ||
+ " }\n" | ||
+ "}"; | ||
|
||
public static final String ML_TASK_INDEX_MAPPING = "{\n" | ||
+ " \"_meta\": {\"schema_version\": " | ||
+ ML_TASK_INDEX_SCHEMA_VERSION | ||
+ "},\n" | ||
+ " \"properties\": {\n" | ||
+ " \"" | ||
+ MLTask.MODEL_ID_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.TASK_TYPE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.FUNCTION_NAME_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.STATE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.INPUT_TYPE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.PROGRESS_FIELD | ||
+ "\": {\"type\": \"float\"},\n" | ||
+ " \"" | ||
+ MLTask.OUTPUT_INDEX_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.WORKER_NODE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.CREATE_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLTask.LAST_UPDATE_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLTask.ERROR_FIELD | ||
+ "\": {\"type\": \"text\"},\n" | ||
+ " \"" | ||
+ MLTask.IS_ASYNC_TASK_FIELD | ||
+ "\" : {\"type\" : \"boolean\"}, \n" | ||
+ USER_FIELD_MAPPING | ||
+ " }\n" | ||
+ "}"; | ||
+ " \"_meta\": {\"schema_version\": " | ||
+ ML_TASK_INDEX_SCHEMA_VERSION | ||
+ "},\n" | ||
+ " \"properties\": {\n" | ||
+ " \"" | ||
+ MLTask.MODEL_ID_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.TASK_TYPE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.FUNCTION_NAME_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.STATE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.INPUT_TYPE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.PROGRESS_FIELD | ||
+ "\": {\"type\": \"float\"},\n" | ||
+ " \"" | ||
+ MLTask.OUTPUT_INDEX_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.WORKER_NODE_FIELD | ||
+ "\": {\"type\": \"keyword\"},\n" | ||
+ " \"" | ||
+ MLTask.CREATE_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLTask.LAST_UPDATE_TIME_FIELD | ||
+ "\": {\"type\": \"date\", \"format\": \"strict_date_time||epoch_millis\"},\n" | ||
+ " \"" | ||
+ MLTask.ERROR_FIELD | ||
+ "\": {\"type\": \"text\"},\n" | ||
+ " \"" | ||
+ MLTask.IS_ASYNC_TASK_FIELD | ||
+ "\" : {\"type\" : \"boolean\"}, \n" | ||
+ USER_FIELD_MAPPING | ||
+ " }\n" | ||
+ "}"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the schema of this index?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method of creating index and saving data can be seen in MLModelAutoReLoader#saveLatestReTryTimes