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

[OpenScapes] Set up user_profiles and the image version updater bot #1432

Closed
choldgraf opened this issue Jun 17, 2022 · 27 comments · Fixed by #1524
Closed

[OpenScapes] Set up user_profiles and the image version updater bot #1432

choldgraf opened this issue Jun 17, 2022 · 27 comments · Fixed by #1524
Assignees

Comments

@choldgraf
Copy link
Member

Context

In a recent conversation with @jules32 and @betolink we discussed some challenges that they're having around their environment as it becomes more complex. In the conversation we arrived at roughly the following:

  • They would like to define multiple Docker images for various kinds of environments that they serve (e.g., R, Python, Julia)
  • They'd also like each environment to be paired with a few different machine types.
  • So they need user_profiles, BUT:
  • They have been using the configurator to modify their image so far, and this is not compatible with user_profiles.

Proposal

Ultimately, the thing they want to do is keep each of their environment images up-to-date as much as possible. We discussed two options:

  1. Pin to latest somehow in their hub configuration for each image. However I'm not sure if this is possible.
  2. Use @sgibson91's recent "helm image updater" action in conjunction with the OpenScapes config in order to keep their images up-to-date.

Are either of those two options realistic? Can we help them out with one of these options?

Updates and actions

No response

@sgibson91
Copy link
Member

sgibson91 commented Jun 17, 2022

We'll want to use the image bumper for this: https://github.com/sgibson91/bump-jhub-image-action The project you linked to bumps version of sub-charts in helm charts, not image tags :)

We already have the image bumper running in this repo so it's just a case of updating openscapes config and then adding the appropriate entries into that matrix: https://github.com/2i2c-org/infrastructure/blob/master/.github/workflows/bump-image-tags.yaml

I am also writing up docs about the two actions as we speak:

@sgibson91
Copy link
Member

sgibson91 commented Jun 17, 2022

I think next steps are establishing which/how many profiles they would like. For each profile, we would need to know i) which machine type they want that profile to have, and ii) the image name they want that profile to have.

If the environment images don't yet exist, I would recommend the documentation on using our hub image template to create them :)

For reference, here are the machine sizes already available to the openscapes cluster:

// Node definitions for notebook nodes. Config here is merged
// with our notebook node definition.
// A `node.kubernetes.io/instance-type label is added, so pods
// can request a particular kind of node with a nodeSelector
local notebookNodes = [
{ instanceType: "m5.large" },
{ instanceType: "m5.xlarge" },
{ instanceType: "m5.2xlarge" },
{ instanceType: "m5.8xlarge" },
];
// Node definitions for dask worker nodes. Config here is merged
// with our dask worker node definition, which uses spot instances.
// A `node.kubernetes.io/instance-type label is set to the name of the
// *first* item in instanceDistribution.instanceTypes, to match
// what we do with notebook nodes. Pods can request a particular
// kind of node with a nodeSelector
local daskNodes = [
{ instancesDistribution+: { instanceTypes: ["m5.large"] }},
{ instancesDistribution+: { instanceTypes: ["m5.xlarge"] }},
{ instancesDistribution+: { instanceTypes: ["m5.2xlarge"] }},
{ instancesDistribution+: { instanceTypes: ["m5.8xlarge"] }},
];

@sgibson91
Copy link
Member

They'd also like each environment to be paired with a few different machine types.

Also reading this again, we may need

@yuvipanda
Copy link
Member

@sgibson91 that is only required if we want to offer 'sub-options' inside a profile. The profiles themselves can each offer an image. See https://github.com/2i2c-org/infrastructure/blob/master/config/clusters/m2lines/common.values.yaml#L94

@sgibson91
Copy link
Member

sgibson91 commented Jun 23, 2022

@yuvipanda I know - I'm reading "They'd also like each environment to be paired with a few different machine types" as meaning they'd like user profiles with different images, with sub-options of machine types. But some clarity from the openscapes folks would be helpful here.

@jules32
Copy link
Contributor

jules32 commented Jun 23, 2022

Pinging @betolink as the best person to speak to this :)

@betolink
Copy link
Contributor

@yuvipanda @sgibson91 thanks for taking a look at this!

In an ideal case scenario we would like to see something like this:

jhub

Hub users could select which environment they want to use and then the machine type. These environments will be using whatever the latest tags are in the registry(Dockerhub for now). Ultimately we are looking for a mechanism to sync up our Docker images with the Openscapes hub.

Chris mentioned a Github action you folks were testing, I think it updates values.yml (or creates a PR for your infra project?) if there is a new image.

@sgibson91
Copy link
Member

Thanks @betolink! #1253 is something we've been developing for the Pangeo hubs and basically allows the same thing (although I think the UI looks a little different). So a user can select an image tag from a drop-down and then merge that selection with a machine type.

Chris mentioned a Github action you folks were testing, I think it updates values.yml (or creates a PR for your infra project?) if there is a new image.

Yes we have that which would be a good fallback option until we unblock the above issue and can roll out the UI you'd prefer.

@sgibson91 sgibson91 changed the title [OpenScapes] Set up user_profiles and the helm version updater bot [OpenScapes] Set up user_profiles and the image version updater bot Jun 27, 2022
@betolink
Copy link
Contributor

Thanks @sgibson91 ! yeah it's basically the same. If that can be implemented in our hub it would be amazing! So far we have the Python and R images,(Matlab is next). We can use openscapes/python(now called Corn) openscapes/r (we're building it this week) and openscapes/matlab from Docker hub.

@sgibson91
Copy link
Member

@betolink we are unfortunately blocked on deploying that particular UI until we migrate all our hubs to z2jh/JupyterHub 2.0, but we can set you up with some "good enough" profiles for now while we push the migration forward? Or would you prefer to stick with what you have until we've upgraded?

@betolink
Copy link
Contributor

betolink commented Jul 5, 2022

@sgibson91 Good enough profiles are fine for now, I'm planning in publishing the images at Dockerhub this week.

python -> openscapes/python
R -> openscapes/rocket
Matlab -> openscapes/matlab

once these are published we can test them on the staging hub and then prod. thanks for all the work!

@yuvipanda
Copy link
Member

@betolink awesome! lmk once these are published and I can set these up

@betolink
Copy link
Contributor

betolink commented Jul 7, 2022

Hi @yuvipanda!

The Python and R images are now available in Docker hub, if you don't mind setting them up in our staging hub that would be great! Matlab will have to wait for now. Thanks a lot!

openscapes/python
openscapes/rocker

the latest tags are using the last commit hash and main (maybe we should change it for latest)

@yuvipanda
Copy link
Member

@betolink awesome! I'll get to this soon.

@betolink
Copy link
Contributor

our matlab image is now available at openscapes/matlab, when you have time to get to this we'd like to include it in the profile as well.

@yuvipanda
Copy link
Member

Great! I've it working looking like this:

image

Will get it setup shortly, am a little busy at SciPy.

@jules32
Copy link
Contributor

jules32 commented Jul 14, 2022

Hi @yuvipanda this is awesome, and thanks for thinking about it in between SciPy!

Would it be possible to re-name the "Rocker" one to R? On our side, we named it "Rocker" because Docker wouldn't allow a single letter ("R"). Not sure that's a constraint here (and I realize it's an extra step to rename it here), but just thinking that many R users likely won't understand "Rocker" to mean R

@yuvipanda
Copy link
Member

@jules32 absolutely, no problem. Would you want the R one to start on RStudio by default or JupyterLab?

@yuvipanda
Copy link
Member

Can also have the matlab variant start in matlab.

@yuvipanda
Copy link
Member

image

yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this issue Jul 14, 2022
yuvipanda added a commit to yuvipanda/pilot-hubs that referenced this issue Jul 14, 2022
@yuvipanda
Copy link
Member

Unfortunately whenever you update the docker image, you've to make a PR to this repo updating the tags here: https://github.com/2i2c-org/infrastructure/pull/1524/files#diff-3e6a6aaa229aa8ec507fc308feb5b502a0683705283d6c0497e3d991339f6a0fR80. The configurator doesn't support profiles yet :(

@jules32
Copy link
Contributor

jules32 commented Jul 15, 2022

Thanks @yuvipanda ! Let's have R start in RStudio, thanks.

Is the PR for tags because of this rename to "R" from "Rocker"? I think @betolink was expecting a PR but wanted to confirm it's the same

@yuvipanda
Copy link
Member

It isn't because of the name change. The configurator ui just doesn't support profiles yet, so the PR is unfortunately necessary until that is added.

@sgibson91
Copy link
Member

@yuvipanda I can setup the bump-jhub-image-action to automatically open the PRs for these

@damianavila damianavila moved this from Needs Shaping / Refinement to In progress in DEPRECATED Engineering and Product Backlog Jul 15, 2022
Repository owner moved this from In progress to Complete in DEPRECATED Engineering and Product Backlog Jul 15, 2022
@yuvipanda
Copy link
Member

@sgibson91 perfect!

@sgibson91
Copy link
Member

@yuvipanda I opened #1533 and requested your review :)

@yuvipanda yuvipanda reopened this Jul 18, 2022
@damianavila damianavila moved this from Complete to In progress in DEPRECATED Engineering and Product Backlog Jul 19, 2022
@damianavila
Copy link
Contributor

Since #1533 is merged, I think we can close this one now.

Repository owner moved this from In progress to Complete in DEPRECATED Engineering and Product Backlog Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants