zero-to-jupyterhub-k8s icon indicating copy to clipboard operation
zero-to-jupyterhub-k8s copied to clipboard

k3d setup in CONTRIBUTING.md is outdated

Open GuySerfaty opened this issue 5 years ago • 8 comments
trafficstars

Bug description

Feels like the doc was written for k3d version 1.X, try to follow the CONTRIBUTING.md instructions and got: unknown command "create" for "k3d"

Expected behaviour

To be able to spin up a dev env easily, alternatively if we decided to work with an old version of k3d let's document it and add instructions

Actual behaviour

unknown command "create" for "k3d"

How to reproduce

  1. Clone z2jh repo, branch master
  2. Follow the CONTRIBUTING.md instructions for mac
  3. Run:
k3d create --publish 30443:30443 --publish 32444:32444 --wait 60 \
   --enable-registry --registry-name local.jovyan.org \
   --server-arg --no-deploy=metrics-server \
   --server-arg --no-deploy=traefik \
   --server-arg --no-deploy=local-storage \
   --server-arg --disable-network-policy \
   --server-arg --flannel-backend=none

Your personal set up

OS: MacOS, Docker Desktop Version: k3d version v3.1.4 docker 19.03.8 Configuration: fresh checkout from master

Steps to install with 3.X

create cluster 3.X way: k3d cluster create -p "30443:30443@agent[0]" --agents 2

chartpress: chartpress --image-prefix=local.jovyan.org:5000/ --push not needed chartpress is enough

GuySerfaty avatar Oct 21 '20 05:10 GuySerfaty

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Oct 21 '20 05:10 welcome[bot]

Thanks for reporting and updating how to run witj k3d v3, which was not functional when i wrote these docs.

I'd like to get the tests to work as well. Do you know if your siggested install method makes test succeed also?

Goal: make k3d install, and make tests work even after making some small change to a Dockerfile and making a local commit which forces a rebuild and use of the new image rather than a already built image.

consideRatio avatar Oct 21 '20 08:10 consideRatio

No... when running pytest -vx ./tests I got this error:

E           requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=32444): Max retries exceeded with url: /roots/0 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10dad7630>: Failed to establish a new connection: [Errno 61] Connection refused'))

lib/python3.7/site-packages/requests/adapters.py:516: ConnectionError
=========================================================== short test summary info ===========================================================
ERROR tests/test_spawn.py::test_api - requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=32444): Max retries ex...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================== 1 error in 0.22s ===============================================================

In the beginning, I thought it because I don't expose the https port, so I recreated the cluster: k3d cluster create -p "30443-30444:30443-30444@agent[0]" --agents 2

Still got the same error

GuySerfaty avatar Oct 22 '20 09:10 GuySerfaty

The --push part relate to making images available to the k8s cluster, did you remove that?

consideRatio avatar Oct 22 '20 09:10 consideRatio

As I wrote I ran only chartpress without the --push part... I can visit the JupyterHub locally, tests throw the error above

GuySerfaty avatar Oct 22 '20 09:10 GuySerfaty

I got tests to work by doing like below...

k3d cluster create \
   -p "30443:30443@server[0]" -p "32444:32444@server[0]" \
   --k3s-server-arg --no-deploy=metrics-server \
   --k3s-server-arg --no-deploy=traefik \
   --k3s-server-arg --no-deploy=local-storage \
   --k3s-server-arg --disable-network-policy \
   --k3s-server-arg --flannel-backend=none
# --enable-registry \
# --registry-name local.jovyan.org \

But... I could not build and try a locally built docker image, because of whats described in the documentation...

image

So, until they have support for local image registries, or allow for the k3s equivalent --docker flag or similar, then there is nothing we can do in this repo to fix this I think.

Conclusion

  • k3d v3 isn't mature enough yet to test against local images.
  • this projects documentation can be updated to note that that is the case, anyone is welcome to make such pr

consideRatio avatar Oct 22 '20 13:10 consideRatio

Thank you @consideRatio super strange that they don't support it and still, 3.X is the default, additionally, I didn't found an easy way to install k3d 1.X.

I will try to find time for opening a PR

GuySerfaty avatar Oct 22 '20 14:10 GuySerfaty

There seem to have been some development, with k3s v4 out now: https://k3d.io/

consideRatio avatar Jan 16 '21 07:01 consideRatio