canonical / kubeflow-rocks

Rocks for Kubeflow components
Apache License 2.0
0 stars 11 forks source link

chore: update rockcraft project, add sanity test, and tox.ini file #85

Open NohaIhab opened 6 months ago

NohaIhab commented 6 months ago

closes #84

Summary

Testing

  1. Build the rock
    tox -e pack
  2. Export the rock to Docker
    tox -e export-to-docker
  3. Run a container with the image and replace the entrypoint with a shell
    docker run --rm -ti volumes-web-app:1.8.0 exec /bin/bash
  4. Go to the working-dir /src
    cd /src
  5. Run the entrypoint command
    _daemon_@f2a80c2d3f9f:/src$ gunicorn -w 3 --bind 0.0.0.0:5000 --access-logfile - entrypoint:app

    Expected output:

    [2024-05-20 12:20:09 +0000] [22] [INFO] Starting gunicorn 22.0.0
    [2024-05-20 12:20:09 +0000] [22] [INFO] Listening at: http://0.0.0.0:5000 (22)
    [2024-05-20 12:20:09 +0000] [22] [INFO] Using worker: sync
    [2024-05-20 12:20:09 +0000] [23] [INFO] Booting worker with pid: 23
    [2024-05-20 12:20:09 +0000] [24] [INFO] Booting worker with pid: 24
    [2024-05-20 12:20:09 +0000] [25] [INFO] Booting worker with pid: 25
    [2024-05-20 12:20:12 +0000] [23] [ERROR] Exception in worker process
    ...

    Because the container image needs kubeconfig and proper expose of a the serving port, the expected output will be followed by the following errors:

    kubernetes.config.config_exception.ConfigException: Service host/port is not set.
    kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.

    Another test you can do is run the upstream image and compare the output, it should be the same:

    docker run docker.io/kubeflownotebookswg/volumes-web-app:v1.8.0