-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added pvcviewer-controller rock #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BON4 ! I reviewed this PR by building the rock and running a container with the image generated from it, but I had trouble finding the /manager
binary. As you can see from this quick test, it is not in the path it is supposed to be:
ubuntu@ip-172-31-23-177:~/kubeflow-rocks$ docker run --rm -ti --entrypoint /bin/bash pvcview:0.1
_daemon_@b122f874a0fc:/$ /manager --health-probe-bind-address=:8081 --metrics-bind-address=:8080 --leader-elect
bash: /manager: No such file or directory
_daemon_@b122f874a0fc:/$ ls -la /manager
ls: cannot access '/manager': No such file or directory
_daemon_@b122f874a0fc:/$ ls -la /bin/ | grep manager
_daemon_@b122f874a0fc:/$
You will also see this error on the tests.
I think that using the Go plugin is causing this issue, as the binary will be installed in ${CRAFT_PART_INSTALL}/bin
instead of /manager
, according to the docs.
Usually we avoid using the Go plugin because of that and instead use override-build
. You can use this as reference.
Also, it seems like there is an overlap between this PR and #130. May I ask you to close the other one if it is not needed any more?
@DnPlas Thank you for your review and suggestions. The issue was identified in this line. The Go plugin builds the binary with a default name, which in this case is pvc-viewer rather than pvcviewer-operator. As a result, no files were moved to I did test the rock before pushing the changes, but I overlooked the fact that Docker caches images. The tests passed locally because they were using a pre-refactored version of the rock. I opted to use the Go plugin without overriding any steps here, as there are no third-party files involved. The only requirement for the final OCI image is the executable itself. Is it a common convention to avoid using the Go plugin? Do you think it could still be suitable for my specific case? About this PR #130. It will be closed, I mentioned it in PR description so no comments will be lost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BON4 !
I tested this PR by:
- Building the rock -> Success
- Running the image in a container and looking for the binary -> Success
ubuntu@ip-172-31-23-177:~/pvcviewer-operator$ docker run --rm -ti --entrypoint /bin/bash pvcview:0.2
_daemon_@95ca93b7b916:/$ ls /manager
/manager
- Saving the image in the microk8s local registry and using it for deploying the
pvcviewer-operator
-> Success
juju deploy pvcviewer-operator --channel latest/edge --trust --resource oci-image=pvcview:0.2
# kubectl logs from the container
2024-11-29T15:37:06.321Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO setup starting manager
2024-11-29T15:37:06.321Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.metrics Starting metrics server
2024-11-29T15:37:06.321Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.metrics Serving metrics server {"bindAddress": ":8080", "secure": false}
2024-11-29T15:37:06.321Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO starting server {"kind": "health probe", "addr": "[::]:8081"}
2024-11-29T15:37:06.321Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.webhook Starting webhook server
2024-11-29T15:37:06.321Z [pvcviewer-operator] I1129 15:37:06.321862 31 leaderelection.go:250] attempting to acquire leader lease kubeflow/57a72bdf.kubeflow.org...
2024-11-29T15:37:06.322Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.certwatcher Updated current TLS certificate
2024-11-29T15:37:06.322Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.webhook Serving webhook server {"host": "", "port": 9443}
2024-11-29T15:37:06.322Z [pvcviewer-operator] 2024-11-29T15:37:06Z INFO controller-runtime.certwatcher Starting certificate watcher
2024-11-29T15:37:21.504Z [pvcviewer-operator] I1129 15:37:21.504512 31 leaderelection.go:260] successfully acquired lease kubeflow/57a72bdf.kubeflow.org
2024-11-29T15:37:21.504Z [pvcviewer-operator] 2024-11-29T15:37:21Z DEBUG events pvcviewer-operator-0_4c1fe7cb-7827-4f3a-b895-67f66d771a08 became leader {"type": "Normal", "object": {"kind":"Lease","namespace":"kubeflow","name":"57a72bdf.kubeflow.org","uid":"ad6a044f-ab99-4246-8883-bc7db1ed9afa","apiVersion":"coordination.k8s.io/v1","resourceVersion":"2413"}, "reason": "LeaderElection"}
2024-11-29T15:37:21.504Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting EventSource {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer", "source": "kind source: *v1alpha1.PVCViewer"}
2024-11-29T15:37:21.505Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting EventSource {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer", "source": "kind source: *v1.Deployment"}
2024-11-29T15:37:21.505Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting EventSource {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer", "source": "kind source: *v1.Service"}
2024-11-29T15:37:21.505Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting EventSource {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer", "source": "kind source: *unstructured.Unstructured"}
2024-11-29T15:37:21.505Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting Controller {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer"}
2024-11-29T15:37:21.612Z [pvcviewer-operator] 2024-11-29T15:37:21Z INFO Starting workers {"controller": "pvcviewer", "controllerGroup": "kubeflow.org", "controllerKind": "PVCViewer", "worker count": 1}
2024-11-29T15:37:34.407Z [pebble] GET /v1/notices?timeout=30s 30.001618932s 200
2024-11-29T15:38:04.408Z [pebble] GET /v1/notices?timeout=30s 30.000534485s 200
To answer your questions:
I opted to use the Go plugin without overriding any steps here, as there are no third-party files involved. The only requirement for the final OCI image is the executable itself.
The way you have defined it is good, actually.
Description
This is re-open request for this PR.
Logs
Using pvcviewer-operator. Modified: metadata.yaml. Replaced "docker.io/kubeflownotebookswg/pvcviewer-controller:v1.9.0" with "vyurchenko581/pvcviewer-controller:1.9.0".
Juju status after pvcviwer-operator model is deployed:
Juju status after all tests passed:
Logs of passed integration tests
tox -vve integration -- --model kubeflow --keep-models
:Logs from pvcviewer-operator container that used pvcviwer-controller rock
kubectl logs -n kubeflow pvcviewer-operator-0 -c pvcviewer-operator
: