SwissDataScienceCenter / amalthea

A kubernetes operator for spawning and exposing jupyter servers
Apache License 2.0
13 stars 4 forks source link

[tracking] Support Jupyter-free images (2.0) #597

Open sgaist opened 2 weeks ago

sgaist commented 2 weeks ago

This ticket tracks the Amalthea specific work to be done to implement the support of user session without Jupyter.

Tasks

Part of: https://github.com/SwissDataScienceCenter/renku/issues/3679

olevski commented 1 week ago

Btw I created an issue for Storage object handling above by mistake. I am not working on this rn.

olevski commented 1 week ago

For adjusting /dev/shm this is how we patch it in the old sessions:

            {
                "type": "application/json-patch+json",
                "patch": [
                    {
                        "op": "add",
                        "path": "/statefulset/spec/template/spec/volumes/-",
                        "value": {
                            "name": "shm",
                            "emptyDir": {
                                "medium": "Memory",
                                # NOTE: We are giving /dev/shm up to half of the memory request
                                "sizeLimit": int(server.server_options.storage / 2),
                            },
                        },
                    },
                    {
                        "op": "add",
                        "path": "/statefulset/spec/template/spec/containers/1/volumeMounts/-",
                        "value": {
                            "mountPath": "/dev/shm",
                            "name": "shm",
                        },
                    },
                ],
            }

So it is a memory backed volume mounted at /dev/shm. And its size is half the memory request for the session. Here we can make it part of the CRD with a default value of 1Gi or something like that.

sgaist commented 1 week ago

@olevski works for me but shouldn't it be 500Mi ? The default storage size is currently 1Gi

sgaist commented 5 days ago

@olevski On the subject of ephemeral storage, what was it about ?

Any "non-conventional" storage can already be added to the CRD using the ExtraVolumes and ExtraVolumeMounts fields

olevski commented 5 days ago

@olevski On the subject of ephemeral storage, what was it about ?

Any "non-conventional" storage can already be added to the CRD using the ExtraVolumes and ExtraVolumeMounts fields

@sgaist yes you are right, I did not think of this. We did not have the extra volumes and mounts option in the old amalthea. So there we had to add this. But you are correct that someone can very easily use these two options on the CRD and in combination with the working directory have everything working. So I will just completely remove this from the list.