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

Tutorial about serverless functions #3124

Merged
merged 70 commits into from
Jul 21, 2021
Merged

Tutorial about serverless functions #3124

merged 70 commits into from
Jul 21, 2021

Conversation

nmanovic
Copy link
Contributor

@nmanovic nmanovic commented Apr 23, 2021

Fixed #2926
Fixed #2270
Fixed #2259
Fixed #2185

Motivation and context

Users and customers have problems with running automatic and semi-automatic annotation in CVAT using serverless function. They don't know how to integrate own DL models. The tutorial answers on many typical questions which I saw as github issues or requests in gitter.

How has this been tested?

  • Clone CVAT repo and CD to cvat
  • Checkout the branch nm/serverless_tutorial
  • Go to site directory
  • Run hugo server -D command
  • Open http://localhost:1313/docs/manual/advanced/serverless-tutorial/ page

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@nmanovic nmanovic changed the title Tutorial about automatic annotation using serverless functions [WIP] Tutorial about serverless functions Apr 23, 2021
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 74.094% when pulling 3e378ff on nm/serverless_tutorial into 38b7740 on develop.

@sevaraMS
Copy link

When it will be ready???. I need tutorial

@sevaraMS
Copy link

I tried use onepanel, but it is not suitable for windows

@sevaraMS
Copy link

with openvino not worked))))))))))))))))

@sevaraMS
Copy link

Do we have another way to add our own trained model for auto annotation????

@TOsmanov
Copy link
Contributor

I encountered a problem when running nuctl from windows 10, I managed to deployment models only using ubuntu. I took the following actions:

  1. Installation ubuntu 18.04 from Microsoft store

  2. In settings docker desktop in tab resourcrces wsl integration enable integration for ubuntu-18.04

    image

  3. Install curl command:

    sudo apt install curl
  4. Installation nuctl on ubuntu, with use command from manuals on nuclio CLI:

    curl -s https://api.github.com/repos/nuclio/nuclio/releases/latest \
                | grep -i "browser_download_url.*nuctl.*$(uname)" \
                | cut -d : -f 2,3 \
                | tr -d \" \
                | wget -O nuctl -qi - && chmod +x nuctl
  5. Installation git on ubuntu:

    sudo apt install git
  6. Cloning to the repository and moving:

    git clone https://github.com/openvinotoolkit/cvat.git --branch nm/serverless_tutorial
    cd cvat
    
  7. Executing commands from serverless tutorial

There was a problem with the deployment of models
(similar to this #2828) I solved it by adding it to the function.yaml file of the each model, attribute port: 32001

triggers:
myHttpTrigger:
    maxWorkers: 1
    kind: 'http'
    workerAvailabilityTimeoutMilliseconds: 10000
    attributes:
    port: 32001 <----- add this ( different ports for different models)
    maxRequestBodySize: 33554432 # 32MB

May be worth adding information that Windows 10 users are better off deploying models through ubuntu, or adding this information to section "Troubleshooting"?

@nmanovic
Copy link
Contributor Author

I encountered a problem when running nuctl from windows 10, I managed to deployment models only using ubuntu. I took the following actions:

  1. Installation ubuntu 18.04 from Microsoft store
  2. In settings docker desktop in tab resourcrces wsl integration enable integration for ubuntu-18.04
    image
  3. Install curl command:
    sudo apt install curl
  4. Installation nuctl on ubuntu, with use command from manuals on nuclio CLI:
    curl -s https://api.github.com/repos/nuclio/nuclio/releases/latest \
                | grep -i "browser_download_url.*nuctl.*$(uname)" \
                | cut -d : -f 2,3 \
                | tr -d \" \
                | wget -O nuctl -qi - && chmod +x nuctl
  5. Installation git on ubuntu:
    sudo apt install git
  6. Cloning to the repository and moving:
    git clone https://github.com/openvinotoolkit/cvat.git --branch nm/serverless_tutorial
    cd cvat
    
  7. Executing commands from serverless tutorial

There was a problem with the deployment of models
(similar to this #2828) I solved it by adding it to the function.yaml file of the each model, attribute port: 32001

triggers:
myHttpTrigger:
    maxWorkers: 1
    kind: 'http'
    workerAvailabilityTimeoutMilliseconds: 10000
    attributes:
    port: 32001 <----- add this ( different ports for different models)
    maxRequestBodySize: 33554432 # 32MB

May be worth adding information that Windows 10 users are better off deploying models through ubuntu, or adding this information to section "Troubleshooting"?

Thanks for these instructions. I will add the information into the tutorial.

@nmanovic
Copy link
Contributor Author

@dmitriikhurtin , could you please help me to understand the issue? In the PR I see a couple of errors from pylint linter. For example,

    {
        "type": "error",
        "module": "main",
        "obj": "init_context",
        "line": 19,
        "column": 12,
        "path": "serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio/main.py",
        "symbol": "too-many-function-args",
        "message": "Too many positional arguments for constructor call",
        "message-id": "E1121"
    }

If I check the file locally, the linter doesn't complain. How should I run the linter locally to reproduce the problem?

$ echo "Pylint version: "`pylint --version | head -1`
Pylint version: pylint 2.7.0
$ echo "The files will be checked: "`echo ${changed_files_pylint}`
The files will be checked: /home/nmanovic/Workspace/cvat/serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio/main.py
$ pylint --verbose ${changed_files_pylint} --output-format json
Using config file /home/nmanovic/Workspace/cvat/.pylintrc
[]

@nmanovic nmanovic merged commit 0baf794 into develop Jul 21, 2021
@nmanovic nmanovic deleted the nm/serverless_tutorial branch July 21, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants