Skip to content

Latest commit

 

History

History
97 lines (66 loc) · 2.68 KB

Testing.md

File metadata and controls

97 lines (66 loc) · 2.68 KB

Testing the Quickstarter

The following steps explore the full range of provided actions/features of this tool. Run all of these to check if the tool works when making changes. We're planning to automate this in the future.

New project

  1. Install quickstarter from pip (or locally if you made changes)
    pip install datascience-quickstarter

  2. Create new project (e.g. name qs-test)
    quickstart-project + follow instructions

  3. Create new environment
    conda create -n qs-test python=3.8 (or non-conda alternative)
    conda activate qs-test

  4. Install package of new project
    cd qs-test && make dev

Note: if you made changes to the quickstarter, run pip uninstall datascience-quickstarter and install your local version using in development mode pip install -e ... at this step.

  1. Run tests
    make test

For the next steps, open a second terminal so that one terminal and use one to keep a service running and the other to send requests to the service.

  1. Run service
    make run

  2. Send requests
    make example-request-count
    make example-request-reverse
    python examples/example_requests.py
    (stop service)

  3. Build Docker image for service
    make build

  4. Run service within Docker container; run-command will also be printed after building.
    docker run -p 8000:8000 -e --rm -it <package-name>:0.1

  5. Repeat 7), i.e. test sending requests
    (stop container)

New demo

  1. Create new demo
    quickstart-streamlit (call it cool-demo)

  2. Build Docker image for demo
    cd demos/cool-demo
    make build

  3. Run demo with docker container; run-command will also be printed after building.
    docker run -p 8000:8000 -e --rm -it cool-demo:0.1
    (stop container)

Zero-shot classifier example

  1. Create environment
    conda create -n zsc python=3.8

  2. Install project package
    cd examples/aylien-zs-classifier
    make dev

  3. Run tests
    make test

  4. Run service
    make run

  5. Send requests
    example-request-add
    example-request-classify
    python examples/example_requests.py
    (stop service)

  6. Build Docker image for service
    make build

  7. Run service within Docker container; run-command will also be printed after building.
    docker run -p 8000:8000 -e --rm -it aylien-zs-classifier:0.1

  8. Repeat 5), i.e. test sending requests
    (stop container)

  9. Try out existing demo
    cd zs-classifier-demo
    make run (stop streamlit)

  10. Build Docker image for demo
    make build

  11. Run demo with docker container; run-command will also be printed after building.
    docker run -p 8000:8000 -e --rm -it zs-classifier-demo:0.1