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

feat: add tensorboards-web-app rock for CKF 1.9 #87

Merged
merged 7 commits into from
Sep 2, 2024

Conversation

NohaIhab
Copy link
Contributor

@NohaIhab NohaIhab commented May 20, 2024

closes #86

Summary

  • Creates rockcraft file for tensorboards Web App v1.9.0
  • Adds tox.ini
  • Adds sanity tests

Testing

  1. Build the rock
tox -e pack
  1. Export the rock to Docker
tox -e export-to-docker
  1. Run a container with the image and replace the entrypoint with a shell
docker run --rm -ti tensorboards-web-app:1.9 exec /bin/bash
  1. Go to the working-dir /src
cd /src
  1. 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/tensorboards-web-app:v1.9.0

@NohaIhab NohaIhab requested a review from a team as a code owner May 20, 2024 15:31
@NohaIhab NohaIhab changed the title feat: add tensorboards-web-app rock for CKF 1.8 feat: add tensorboards-web-app rock for CKF 1.9 Aug 28, 2024
Copy link
Contributor

@orfeas-k orfeas-k left a comment

Choose a reason for hiding this comment

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

Tested and works, small comment

EDIT:
Just integrating in the charm, I got the errors:

2024-09-02T08:15:11.187Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [INFO] Starting gunicorn 23.0.0
2024-09-02T08:15:11.187Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [INFO] Listening at: http://0.0.0.0:5000 (14)
2024-09-02T08:15:11.188Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [INFO] Using worker: sync
2024-09-02T08:15:11.189Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [16] [INFO] Booting worker with pid: 16
2024-09-02T08:15:11.191Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [16] [ERROR] Exception in worker process
2024-09-02T08:15:11.191Z [tensorboards-web-app] Traceback (most recent call last):
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
2024-09-02T08:15:11.191Z [tensorboards-web-app]     worker.init_process()
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 135, in init_process
2024-09-02T08:15:11.191Z [tensorboards-web-app]     self.load_wsgi()
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
2024-09-02T08:15:11.191Z [tensorboards-web-app]     self.wsgi = self.app.wsgi()
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/base.py", line 66, in wsgi
2024-09-02T08:15:11.191Z [tensorboards-web-app]     self.callable = self.load()
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
2024-09-02T08:15:11.191Z [tensorboards-web-app]     return self.load_wsgiapp()
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
2024-09-02T08:15:11.191Z [tensorboards-web-app]     return util.import_app(self.app_uri)
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/util.py", line 370, in import_app
2024-09-02T08:15:11.191Z [tensorboards-web-app]     mod = importlib.import_module(module)
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
2024-09-02T08:15:11.191Z [tensorboards-web-app]     return _bootstrap._gcd_import(name[level:], package, level)
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2024-09-02T08:15:11.191Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
2024-09-02T08:15:11.191Z [tensorboards-web-app] ModuleNotFoundError: No module named 'entrypoint'
2024-09-02T08:15:11.191Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [16] [INFO] Worker exiting (pid: 16)
2024-09-02T08:15:11.191Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [17] [INFO] Booting worker with pid: 17
2024-09-02T08:15:11.193Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [17] [ERROR] Exception in worker process
2024-09-02T08:15:11.193Z [tensorboards-web-app] Traceback (most recent call last):
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
2024-09-02T08:15:11.193Z [tensorboards-web-app]     worker.init_process()
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 135, in init_process
2024-09-02T08:15:11.193Z [tensorboards-web-app]     self.load_wsgi()
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
2024-09-02T08:15:11.193Z [tensorboards-web-app]     self.wsgi = self.app.wsgi()
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/base.py", line 66, in wsgi
2024-09-02T08:15:11.193Z [tensorboards-web-app]     self.callable = self.load()
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
2024-09-02T08:15:11.193Z [tensorboards-web-app]     return self.load_wsgiapp()
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
2024-09-02T08:15:11.193Z [tensorboards-web-app]     return util.import_app(self.app_uri)
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/util.py", line 370, in import_app
2024-09-02T08:15:11.193Z [tensorboards-web-app]     mod = importlib.import_module(module)
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
2024-09-02T08:15:11.193Z [tensorboards-web-app]     return _bootstrap._gcd_import(name[level:], package, level)
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2024-09-02T08:15:11.193Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
2024-09-02T08:15:11.193Z [tensorboards-web-app] ModuleNotFoundError: No module named 'entrypoint'
2024-09-02T08:15:11.193Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [17] [INFO] Worker exiting (pid: 17)
2024-09-02T08:15:11.193Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [18] [INFO] Booting worker with pid: 18
2024-09-02T08:15:11.194Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [18] [ERROR] Exception in worker process
2024-09-02T08:15:11.194Z [tensorboards-web-app] Traceback (most recent call last):
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
2024-09-02T08:15:11.194Z [tensorboards-web-app]     worker.init_process()
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 135, in init_process
2024-09-02T08:15:11.194Z [tensorboards-web-app]     self.load_wsgi()
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
2024-09-02T08:15:11.194Z [tensorboards-web-app]     self.wsgi = self.app.wsgi()
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/base.py", line 66, in wsgi
2024-09-02T08:15:11.194Z [tensorboards-web-app]     self.callable = self.load()
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
2024-09-02T08:15:11.194Z [tensorboards-web-app]     return self.load_wsgiapp()
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
2024-09-02T08:15:11.194Z [tensorboards-web-app]     return util.import_app(self.app_uri)
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/lib/python3.10/site-packages/gunicorn/util.py", line 370, in import_app
2024-09-02T08:15:11.194Z [tensorboards-web-app]     mod = importlib.import_module(module)
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
2024-09-02T08:15:11.194Z [tensorboards-web-app]     return _bootstrap._gcd_import(name[level:], package, level)
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2024-09-02T08:15:11.194Z [tensorboards-web-app]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
2024-09-02T08:15:11.194Z [tensorboards-web-app] ModuleNotFoundError: No module named 'entrypoint'
2024-09-02T08:15:11.194Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [18] [INFO] Worker exiting (pid: 18)
2024-09-02T08:15:11.206Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [ERROR] Worker (pid:16) exited with code 3
2024-09-02T08:15:11.208Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [ERROR] Worker (pid:17) was sent SIGTERM!
2024-09-02T08:15:11.208Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [ERROR] Worker (pid:18) was sent SIGTERM!
2024-09-02T08:15:11.307Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [ERROR] Shutting down: Master
2024-09-02T08:15:11.307Z [tensorboards-web-app] [2024-09-02 08:15:11 +0000] [14] [ERROR] Reason: Worker failed to boot.

In order to overcome this, as also described here, I had to edit the pebble layer's override field from replace to merge. This worked then.

tensorboards-web-app/rockcraft.yaml Outdated Show resolved Hide resolved
@NohaIhab NohaIhab merged commit 4b44bb5 into main Sep 2, 2024
7 checks passed
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.

Create rockcraft project for tensorboards-web-app:v1.9.0
2 participants