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

change {username}{servername} to {userid} to avoid volume length restrictions of 63 characters #1200

Merged
merged 9 commits into from Jul 20, 2018

Conversation

kkasravi
Copy link
Contributor

@kkasravi kkasravi commented Jul 13, 2018

Fixes #1177


This change is Reviewable

@kkasravi
Copy link
Contributor Author

/assign @kunmingg
/cc @jlewi

@kkasravi
Copy link
Contributor Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Jul 13, 2018

How is userid set?

Could we add pod labels for the username (but truncate that to appropriate lengths) so its easy for people find their pods.

@kkasravi
Copy link
Contributor Author

i've kept the pod name as is which for IAP ends up being accounts.google:kam.d.kasravi@intel.com (where '.:@' are escaped). I've only changed the pvc name which is the attribute with the 63 character length description. The calculation of userid is a simple integer beginning from 1. So the pod has mount with names like volume-1, ... The userid is taken from the local sqllite db. Should tf-hub-0 die then these userid's are rebuilt.

@kkasravi
Copy link
Contributor Author

I could try labeling pods by using the email from IAP however it would still be escapified - it wouldn't have the accounts.google: prefix though.

@jlewi
Copy link
Contributor

jlewi commented Jul 14, 2018

Sorry I missed that it was only the PVC.

Don't we want to change the pod name template? I assume they will run into the same length issues.

It looks like the pod name is

jupyter-accounts-2egoogle-2ecom-3akam-2ed-2ekasravi-40intel-2ecom

Whereas volume name is

volume-accounts-2egoogle-2ecom-3akam-2ed-2ekasravi-40intel-2ecom

I think pod names are DNS names
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md

So aren't they subject to the same 63 character limit? So I think we will eventually hit the same issue if we don't truncate those names as well.

@kkasravi
Copy link
Contributor Author

Good point on recognizing both as being identifiers.
I'll lop off the prefix 'accounts.google.com:' if it exists and truncate to 63?

…x accounts.google: for iap and truncating escaped self.user.name to 63 characters
@kkasravi
Copy link
Contributor Author

/retest

@kkasravi
Copy link
Contributor Author

/retest

@kkasravi
Copy link
Contributor Author

/retest

@kkasravi
Copy link
Contributor Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Jul 16, 2018

TFJob test is failing with

/usr/bin/python: No module named py

That doesn't seem like it would be caused by this PR.

Filed #1218

@kkasravi
Copy link
Contributor Author

/retest

@kkasravi
Copy link
Contributor Author

@jlewi thanks - i didn't think so either

@@ -111,6 +113,33 @@ def get_env(self):
env['GOOGLE_APPLICATION_CREDENTIALS'] = '{}/{}.json'.format(SERVICE_ACCOUNT_SECRET_MOUNT, gcp_secret_name)
return env

def _parse_user_name(self, username):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a TODO to add a unittest?

@kkasravi
Copy link
Contributor Author

/retest

@jlewi
Copy link
Contributor

jlewi commented Jul 16, 2018

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kkasravi
Copy link
Contributor Author

this error about tfjobs is probably coming from the tf-operator repo

@jlewi
Copy link
Contributor

jlewi commented Jul 16, 2018

@lluunn is looking into the test failure (#1218).

@jlewi
Copy link
Contributor

jlewi commented Jul 17, 2018

/retest

@kkasravi
Copy link
Contributor Author

failure in junit_e2e-gke-v1a2.xml - simple-tfjob-gke seems spurious since this only affects jupyterhub

@kkasravi
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 471de67 into kubeflow:master Jul 20, 2018
saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 11, 2021
…rictions of 63 characters (kubeflow#1200)

* shorten pvc, pod names

* change {username}{servername} to {userid} to avoid volume length restrictions

* remove extraneous changes

* avoid identifier length limitations for pvc and pod by removing prefix accounts.google: for iap and truncating escaped self.user.name to 63 characters

* add comment about overriding KubeSpawner method

* fix _parse_user_name error

* add TODO unit test for _parse_user_name
yanniszark pushed a commit to arrikto/kubeflow that referenced this pull request Feb 15, 2021
* Support string metrics

* Fix error in e2e tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants