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

Fixed issue Snapshot not emitted after unregistering model with 0 workers #491

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

shivamshriwas
Copy link
Contributor

Duplicate of #315 changed the base to master.

Description

Snapshot not emitted after unregistering model with 0 workers

Fixes #200

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Feature/Issue validation/testing

-[x] Test 1: No snapshot is created on list model request
(tsenv) admins@BRL07887:~TorchServe/TSSource$ curl "http://localhost:8081/models"
{
"models": []
}

(tsenv) admins@BRL07887:~$ ls logs/config/20200508164* -l
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 logs/config/20200508164820357-startup.cfg

-[x] Test 2: Snapshot is created when model is loaded with zero initial_workers
(tsenv) admins@BRL07887:~TorchServe/TSSource$ curl -X POST "http://localhost:8081/models?url=resnet-18.mar&initial_workers=0&synchronous=true"
{
"status": "Model "resnet-18" registered"
}

(tsenv) admins@BRL07887:~$ ls logs/config/20200508164* -l
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 logs/config/20200508164820357-startup.cfg
	-rw-rw-r-- 1 admins admins 589 May  8 16:49 logs/config/20200508164922000-snapshot.cfg

-[x] Test 3: Snapshot is created when model is registered with some initial_workers
(tsenv) admins@BRL07887:~$ curl -X POST "http://localhost:8081/models?url=densenet161.mar&initial_workers=3&synchronous=true"
{
"status": "Workers scaled"
}

(tsenv) admins@BRL07887:~$ ls logs/config/20200508* -l
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 logs/config/20200508164820357-startup.cfg
	-rw-rw-r-- 1 admins admins 589 May  8 16:49 logs/config/20200508164922000-snapshot.cfg
	-rw-rw-r-- 1 admins admins 865 May  8 16:51 logs/config/20200508165112917-snapshot.cfg

-[x] Test 4: Snapshot file is created when model deleted with zero initial_workers
(tsenv) admins@BRL07887:~$ curl -X DELETE "http://localhost:8081/models/resnet-18"
{
"status": "Model "resnet-18" unregistered"
}

(tsenv) admins@BRL07887:~$ ls logs/config/20200508* -l
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 logs/config/20200508164820357-startup.cfg
	-rw-rw-r-- 1 admins admins 589 May  8 16:49 logs/config/20200508164922000-snapshot.cfg
	-rw-rw-r-- 1 admins admins 865 May  8 16:51 logs/config/20200508165112917-snapshot.cfg
	-rw-rw-r-- 1 admins admins 593 May  8 16:53 logs/config/20200508165309631-snapshot.cfg

-[x] Test 5: snapshot file is created when model is deleted with some initial_workers
(tsenv) admins@BRL07887:~$ curl -X DELETE "http://localhost:8081/models/densenet161"
{
"status": "Model "densenet161" unregistered"
}

(tsenv) admins@BRL07887:~$ ls -l logs/config/
total 20
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 20200508164820357-startup.cfg
	-rw-rw-r-- 1 admins admins 589 May  8 16:49 20200508164922000-snapshot.cfg
	-rw-rw-r-- 1 admins admins 865 May  8 16:51 20200508165112917-snapshot.cfg
	-rw-rw-r-- 1 admins admins 593 May  8 16:53 20200508165309631-snapshot.cfg
	-rw-rw-r-- 1 admins admins 314 May  8 16:54 20200508165438447-snapshot.cfg

-[x] Test 6: Snapshot file is created when server is stopped
(tsenv) admins@BRL07887:~$ torchserve --stop
TorchServe has stopped.

(tsenv) admins@BRL07887:~$ ls -l logs/config/
	total 24
	-rw-rw-r-- 1 admins admins 313 May  8 16:48 20200508164820357-startup.cfg
	-rw-rw-r-- 1 admins admins 589 May  8 16:49 20200508164922000-snapshot.cfg
	-rw-rw-r-- 1 admins admins 865 May  8 16:51 20200508165112917-snapshot.cfg
	-rw-rw-r-- 1 admins admins 593 May  8 16:53 20200508165309631-snapshot.cfg
	-rw-rw-r-- 1 admins admins 314 May  8 16:54 20200508165438447-snapshot.cfg
	-rw-rw-r-- 1 admins admins 314 May  8 16:55 20200508165522332-shutdown.cfg

Checklist:

  • Have you added tests that prove your fix is effective or that this feature works?
  • New and existing unit tests pass locally with these changes?

@sagemaker-neo-ci-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: torch-serve-build-cpu
  • Commit ID: bdff9c3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@shivamshriwas shivamshriwas self-assigned this Jul 2, 2020
@shivamshriwas shivamshriwas added this to the v0.2.0 milestone Jul 2, 2020
@sagemaker-neo-ci-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: torch-serve-build-gpu
  • Commit ID: bdff9c3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@maaquib maaquib merged commit c20164b into master Jul 2, 2020
@sagemaker-neo-ci-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: torch-serve-build-cpu
  • Commit ID: bdff9c3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-neo-ci-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: torch-serve-build-gpu
  • Commit ID: bdff9c3
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@shivamshriwas shivamshriwas deleted the issue_200m branch July 8, 2020 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snapshot not emitted after unregistering model with 0 workers
3 participants