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

Sync from model config on agent startup #1204

Merged
merged 6 commits into from Nov 13, 2020
Merged

Sync from model config on agent startup #1204

merged 6 commits into from Nov 13, 2020

Conversation

yuzisun
Copy link
Member

@yuzisun yuzisun commented Nov 13, 2020

What this PR does / why we need it:
Model agent does not sync models from config when scaling to more replicas as there is no CREATE event generated when pods are started with initial mounted config.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1203

Special notes for your reviewer:

  • Fix s3 uri parse issue when there is only bucket
  • Force syncing the model config on startup, if we delete and recreate the pod, the agent should sync the model config and download/load the exiting models from model config.
{"level":"info","ts":1605267738.2322607,"logger":"modelAgent","msg":"Initializing model agent with","config-dir":"/mnt/configs","model-dir":"/mnt/models"}
{"level":"info","ts":1605267738.2323687,"logger":"modelAgent","msg":"Initializing s3 client with ","endpoint":"http://minio-service:9000","region":"us-west-2"}
{"level":"info","ts":1605267738.2324173,"logger":"Watcher","msg":"Syncing model directory..","modelDir":"/mnt/models"}
{"level":"info","ts":1605267738.2325592,"logger":"modelWatcher","msg":"adding model","modelName":"cifar"}
{"level":"info","ts":1605267738.232946,"logger":"modelProcessor","msg":"worker is started for","model":"cifar"}
{"level":"info","ts":1605267738.233302,"logger":"modelProcessor","msg":"Downloading model","storageUri":"s3://torchscript/cifar"}
{"level":"info","ts":1605267738.2334309,"logger":"Downloader","msg":"Downloading to model dir","modelUri":"s3://torchscript/cifar","modelDir":"/mnt/models"}
{"level":"info","ts":1605267738.2335713,"logger":"modelAgent","msg":"Download model ","modelName":"cifar","storagUri":"s3://torchscript/cifar","modelDir":"/mnt/models"}
{"level":"info","ts":1605267738.2337146,"logger":"Watcher","msg":"Start to watch model config event"}
{"level":"info","ts":1605267738.2337751,"logger":"Watcher","msg":"Watching","modelConfig":"/mnt/data/models.json"}
{"level":"info","ts":1605267738.626316,"logger":"modelOnComplete","msg":"completion event for model","modelName":"cifar","inFlight":0}

Release note:


configDir: configDir,
modelTracker: modelTracker,
ModelEvents: make(chan ModelOp),
ModelEvents: make(chan ModelOp, 100),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we intentionally made this a blocking channel? Can @ifilonenko can confirm?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see much reason to make it blocking channel, the problem is that if we push the events first and then start the puller the process just hangs there.

Copy link
Contributor

@ifilonenko ifilonenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm good catch on testing the scaling

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ifilonenko, yuzisun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ifilonenko
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit 046b128 into kserve:master Nov 13, 2020
@yuzisun yuzisun deleted the syncmodel branch January 18, 2021 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MMS model agent gets panic when downloading models
4 participants