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

add the filebrowser rock and tests #2

Merged
merged 15 commits into from
Feb 13, 2024
Merged

Conversation

ca-scribner
Copy link
Contributor

@ca-scribner ca-scribner commented Feb 8, 2024

This PR adds:

  • filebrowser/rockcraft.yaml, which implements a rock for filebrowser
  • filebrowser/README.md with some notes and instructions for future maintenance
  • filebrowser/tox.ini and related sanity tests

Closes canonical/kubeflow-rocks#72

Testing instructions:

testing the rock itself:

cd filebrowser
tox -e pack
tox -e export-to-docker
docker run -p 8080:80 -e FB_ADDRESS=0.0.0.0 filebrowser:v2.27.0
# Browse in a browser to `localhost:8080` and see the app

(if you want to) testing in charmed kubeflow

# with a fully deployed charmed kubeflow
juju config kubeflow-volumes volume-viewer-image=local/filebrowser:v2.27.0

tox -e export-to-docker
docker tag filebrowser:v2.27.0 local/filebrowser:v2.27.0  # so we really know its the right image
docker save local/filebrowser:v2.27.0 > local_filebrowser_v2.27.0.tar
microk8s ctr image import local_filebrowser_v2.27.0.tar

then

  • log into 10.64.140.43.nip.io using user123/user123
  • go to volumes web app
  • create a volume named testvol
  • click the "Open PVC Viewer" button (small folder icon on the right side of the row)
  • filebrowser window should open (although there will be no files since pvc is empty - you can create some though!)
  • confirm we got a filebrowser with the new image:
kubectl -n user123 get pod $(kubectl get pod -n user123 --selector=app.kubernetes.io/instance=pvcviewer-testvol --output=jsonpath={.items..metadata.name}) -o yaml | grep filebrowser:
# Should return:
filebrowser:
    image: docker.io/library/local/filebrowser:v2.27.0
    image: docker.io/library/local/filebrowser:v2.27.0

# NOT
filebrowser:
    image: docker.io/library/filebrowser/filebrowser:v2.23.0
    image: docker.io/library/filebrowser/filebrowser:v2.23.0

adds filebrowser/rockcraft.yaml, which implements a rock for
https://github.com/filebrowser/filebrowser.
Adds basic sanity tests, but does not implement any integration tests.
@ca-scribner
Copy link
Contributor Author

ca-scribner commented Feb 8, 2024

Hit a lot of issues while creating this rock. They're documented in the rock and included README.md, but in summary the rock:

  • uses a few atypical build procedures (GoReleaser, and also its go build embeds the frontend into the application)
  • a healthcheck script and HEALTHCHECK directive in the dockerfile
  • needs somewhere with write access for a local db
  • needs a config file to define defaults to both the healthcheck and filebrowser binary
  • Charmed Kubeflow uses it via a controller we don't control, so we need to emulate the API of this image to make it a drop-in replacement of the upstream docker image. This means putting files in consistent places and setting a default entrypoint-service

Along the way I also got stuck with rockcraft in a few places:

Copy link

@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.

Great job @ca-scribner . This had quite a few hard spots that needed to go around. I left some comments

filebrowser/README.md Outdated Show resolved Hide resolved
filebrowser/README.md Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Show resolved Hide resolved
filebrowser/README.md Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Outdated Show resolved Hide resolved
filebrowser/rockcraft.yaml Show resolved Hide resolved
filebrowser/tox.ini Outdated Show resolved Hide resolved
filebrowser/tox.ini Outdated Show resolved Hide resolved
Co-authored-by: Orfeas Kourkakis <[email protected]>
Copy link

@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.

Thank you Andrew, very good job!

@ca-scribner ca-scribner merged commit f21fe9d into main Feb 13, 2024
7 checks passed
@ca-scribner ca-scribner deleted the KF-5308-add-filebrowser-rock branch February 13, 2024 15:39
Comment on lines +87 to +89
# tried to use source-subdir, but override-build ignores it. Maybe source-subdir is
# implemented as part of the default build step?
# source-subdir: frontend
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it has been raised in canonical/craft-parts#427

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.

update the filebrowser rock for Charmed Kubeflow 1.8
2 participants