Open ericdill opened 5 years ago
As @AlbertDeFusco points out, there's a much better approach. Use the UI API to do this: https://github.com/Anaconda-Platform/anaconda-platform/blob/92a55292490e6e17f242f573b5a0e93e8b15e8c5/ui/anaconda_platform/ui/api_tests/api_sessions/test_api_v2.py#L279-L291
I poked around a bit and made some progress on automatically committing unsaved work in editor sessions. My approach is to run a script on the AE master (
outside.sh
) (or anywhere that you havekubectl
access). That script copies a second script (commit.sh
) into the running session and then executes it. ~I'm currently hitting an issue where I'm getting a 403 from the git server inside the pod. If / when I figure that out I'll update this issue.~ Thanks @a-aron-tThe usage here is:
$ bash outside.sh <pod name>
outside.sh:
Things that should be considered:
Q: What if there's a huge file? A: Consider figuring out which files are big and commit them with git-lfs. You could achieve this with something like a
find
command to find the large files and then add them to be committed.Q: What about the jupyter checkpoints from unsaved notebooks? A: I don't think there's anyway way to force the browser to save an unsaved notebook. Though I'm hopeful to be wrong here.