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

Delete and copy examples directory on every load #242

Closed
mrocklin opened this issue May 7, 2018 · 13 comments
Closed

Delete and copy examples directory on every load #242

mrocklin opened this issue May 7, 2018 · 13 comments

Comments

@mrocklin
Copy link
Member

mrocklin commented May 7, 2018

Currently we keep example notebooks in helm-chart::docker-images/notebook/examples and copy these to the notebook image whenever we make a new image. Then we upgrade the helm chart and users get new notebooks if those notebooks do not conflict with what they had before.

Instead I propose that we pull the examples out to a separate repository, and clone that repository into the user's directory every time we start up a new pod. This would delete the existing examples/ directory and replace it with a clean one that was pulled fresh from github. This is good because it becomes much cheaper to add and remove example notebooks but is bad because it will potentially delete user's files. We would put a loud DO_NOT_STORE_FILES_HERE.md file in the examples directory to try to avoid this situations.

Comments? Concerns?

@rabernat
Copy link
Member

rabernat commented May 7, 2018

This is a good idea. But we definitely want to do some outreach to existing users before implementing it. I am sure I am not the only person who has a large number of in-progress personal notebooks in the examples directory! I would be very screwed at this point if they were deleted.

@mrocklin
Copy link
Member Author

mrocklin commented May 7, 2018

We could also only do hard-rewrites on the existing files for a while, leaving other files intact

@tjcrone
Copy link
Contributor

tjcrone commented May 8, 2018

Currently I am a fan of using lifecycleHooks to populate new user directories, using a git clone which will fail out if the directory already exists, and teaching users to fetch/merge/and/or/reset (not pull) to bring their examples up to date as needed. It helps users become better users of git, and does not risk rewriting anyone's anything.

@mrocklin
Copy link
Member Author

mrocklin commented May 8, 2018 via email

@rsignell-usgs
Copy link
Member

It would be great to know that the ./examples directory contained the latest/greatest. When I first started using pangeo I created directories for my own stuff, but perhaps for folks who don't read the doc or see the .md files, adding an empty ./my_examples directory would give them the idea?

@mrocklin
Copy link
Member Author

@martindurant if you're looking for a starter issue with high impact, this would be a good one.

It would also force you to deploy things (which is hopefully now easier) which is something that we'd like to improve, both with documentation and eventually automation.

@martindurant
Copy link
Contributor

OK, happy to take this on:

  • move examples to a separate repo
  • on startup, copy files to examples/ in the home directory
  • make those files read-only, and make an empty READ_ONLY_EXAMPLES.md file or somesuch
  • make new, empty directory called something like work/

This leaves open what to do in the case that there is existing material in examples/. I can leave it as it is, only update files so that existing files are left unchanged.

@mrocklin
Copy link
Member Author

mrocklin commented Jun 14, 2018 via email

@martindurant
Copy link
Contributor

martindurant commented Jun 14, 2018

Read-only files are fine. You get File Save Error for <file>.ipynb if you try to save. I notice that there is no obvious indication that the file is read-only, unlike classic notebook which shows a no-save icon.

@mrocklin
Copy link
Member Author

mrocklin commented Jun 14, 2018 via email

@rabernat
Copy link
Member

It's important to me that the new-user experience when running the example notebooks be as smooth as possible. So file save errors, without any more context, would be best to avoid. One temporary workaround would be to put in big letters at the top of every notebook "THIS IS A READ ONLY NOTEBOOK AND CAN'T BE SAVED"...

Here's an alternative idea...what if, instead of making the example notebooks read only, we tag them with a date on every update? That way the users could play around with them and even save them, but if a new update comes through, it will go into a different filename. Is there a obvious problem with this?

@martindurant
Copy link
Contributor

Actually I like that idea, clone the repo every time and add the dates tot he filenames upon copy (git log -1 --format=%cd --date=short).

@stale
Copy link

stale bot commented Aug 14, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 14, 2018
@jhamman jhamman closed this as completed Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants