sagemathinc / cocalc-kubernetes

Run CoCalc on a Kubernetes cluster
Other
22 stars 21 forks source link

How to add a new software in to the projects? #12

Open arm2arm opened 4 years ago

arm2arm commented 4 years ago

Are there easy way to add the new software in to the project? Should I rebuild every time the Dockerfile:

https://github.com/sagemathinc/cocalc-kubernetes/tree/master/project/image

and restart the pods?

williamstein commented 4 years ago

Should I rebuild every time the Dockerfile:

That's the only thing that is implemented. Even that won't help unless you change where/how images are pulled, which you can do by modifying the cocalc-server pod.

gabriel-milan commented 4 years ago

which you can do by modifying the cocalc-server pod

Could you please provide better instructions on how to do that?

gabriel-milan commented 4 years ago

I've found it here (https://github.com/sagemathinc/cocalc/blob/master/src/smc_pyutil/smc_pyutil/smc_compute.py#L638). Is that correct?

williamstein commented 4 years ago

correct?

Yes, exactly. Edit the version of that file that is actually run (somewhere under /usr in cocalc-kubernetes server) and see a different image get pulled.

Of course it would be better if there was a template file somewhere with the yaml that could be easily customized...

gabriel-milan commented 4 years ago

Of course it would be better if there was a template file somewhere

That's what I was hoping to find. It looks like, by setting the environment variable KUBERNETES_REGISTRY to a custom registry, other than default sagemathinc, it will do the trick. Thanks anyway.

williamstein commented 4 years ago

It wouldn't be hard to change.. just edit smc_compute.py to load a template file instead of that string. Edit your template file. PR's welcome, and also paid consulting, or maybe I'll have time to just implement this (not sure).