jgomezdans / geog_docker

Docker image for Geospatial Python teaching
GNU General Public License v3.0
4 stars 1 forks source link

Instructions and test for local file mount #12

Open profLewis opened 4 years ago

profLewis commented 4 years ago

So, its as easy as:

LOCAL='/Users/plewis/OneDrive - University College London' NOTEDIR='/home/jovyan/notebooks/one_drive'

docker run -v "${LOCAL}":"${NOTEDIR}" -e NOTEDIR="$NOTEDIR" jgomezdans/geog bash -c '(uname -a && echo "hello world") > ${NOTEDIR}/hello.world'

Then look in one drive

and persistence check:

docker run -v "${LOCAL}":"${NOTEDIR}" -e NOTEDIR="$NOTEDIR" jgomezdans/geog bash -c 'cat ${NOTEDIR}/hello.world'

could set that as a test?

jgomezdans commented 4 years ago

The ideal solution would be to have the docker container write to OneDrive directly, so that writing from the notebook etc is synced (similar to dropbox). It is possible to do (I used it for backups in the past), but requires setting up. Maybe feasible via a notebook (it's just a config file, copying and pasting some "token" from onedrive, and setting up /etc/fstab). This has the advante of set it up once, and it'll work forever

Your solution looks like it will work, but needs setting up variables (not obvious), and most students seem to struggle with finding the console.

Mumble mumble...

jgomezdans commented 4 years ago

OK, what I used in the past was rclone. Basically, you set up a sample config file, and then it'd be possible to change the user to be the student's OneDrive id. The thing is that I've only used rclone in interactive mode, which is quite straightforward, but I don't know how to do this automatically as you need to login to Microsoft to get some token via the browser: Some notes

profLewis commented 4 years ago

Hi - it doesn’t need setting up variables, or permissions or anything.

I suspect that OneDrive ucl is set be default in home and always had the same name. I’m trying to check that. But I think the process is :

  1. Check OS 0a. If home edition, then 0b check space (& get external disk or free space), & backup
  2. Install Windows education

These only if access to some sites eg google is blocked from where you are: 1a. Set up virus stuff that ucl vpn insists on (isd page) 1b. Run ucl vpn (isd)

Plan A. Use isd dockerhub.

Plan B. Using docker images ———— Install software we need;

  1. Install OneDrive ucl (isd page??)
  2. Install docker (docker page or we design some) 3b. Set so starts on startup (might not be automatic, need to check) 3c test run docker: eg
    • hello world
    • jgomezdans/geog python -c “install gdal”
    • test -v ( check file update on OneDrive)
    • test jupyter

Plan C. Anaconda and pull repo ————-

  1. Install anaconda (link)
  2. Pull repo & Create environment
  3. Test python -c “install gdal”

Need better test obvs.

If so,

Professor Philip Lewis, UCL

On 19 Jul 2020, at 15:25, José Gómez-Dans notifications@github.com wrote:

 The ideal solution would be to have the docker container write to OneDrive directly, so that writing from the notebook etc is synced (similar to dropbox). It is possible to do (I used it for backups in the past), but requires setting up. Maybe feasible via a notebook (it's just a config file, copying and pasting some "token" from onedrive, and setting up /etc/fstab). This has the advante of set it up once, and it'll work forever

Your solution looks like it will work, but needs setting up variables (not obvious), and most students seem to struggle with finding the console.

Mumble mumble...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jgomezdans commented 4 years ago

I think the -v option is OK, I was just wondering whether we could simplify things a bit by standardising within the Docker container and limiting the potential for user fuck-ups outside Docker. Happy for you to test this (put it in a new branch maybe?), and I'll think about whether the rclone way is feasible/easy.

One last comment: What about Mac users? What's the name of ${LOCAL} for mac?

profLewis commented 4 years ago

command example. Here, use an alias or some similar way of simplifying the command, assuming they will generally run it this way with these default options set.

alias rund="docker run -p 8888:8888 -it -v ${HOME}'/OneDrive - University College London':'/home/jovyan/OneDrive - University College London' jgomezdans/geog"

then

rund bash -c "ls ~/'OneDrive - University College London'" rund lab

Thats a pretty good set up .. they start lab or whatnot, and see theor one drive directory monted. They had a 1 TB drive. No permissions to set or anything, and local (Onedrive file) maintains my user permissions.

I dont know how much we want to wrap / expose and how. some shell rather than an alias as here.? Ill see what is easiest in a powershell.

jgomezdans commented 4 years ago

OK, this point about the script is useful. Mounting rclone is a pain due to permissions and the Docker security model. Your suggestion would then work as

  1. Download & install Docker desktop (-> cue videos)
  2. Mount one drive storage (-> cue video)
  3. Download & run the following script: runMe_final_final_works.sh ;-D (-> cue video)
  4. Create an icon for script in point (3) so that every time you click on it, the magic happens

One further bit of neatness is that if all the data is OneDrive, if we need to update the Docker image with new packages etc, all user data is kept.

profLewis commented 4 years ago

On 19 Jul 2020, at 17:19, José Gómez-Dans notifications@github.com wrote:

I think the -v option is OK, I was just wondering whether we could simplify things a bit by standardising within the Docker container and limiting the potential for user fuck-ups outside Docker. Happy for you to test this (put it in a new branch maybe?), and I'll think about whether the rclone way is feasible/easy.

One last comment: What about Mac users? What's the name of ${LOCAL} for mac?

See emails …. Its ~/One drive Ucl everywhere. The hassle is the spaces in the filename!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jgomezdans/geog_docker/issues/12#issuecomment-660670766, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOC3GX2T4TRLAZY5V2ZSVDR4MMJ7ANCNFSM4PBD66VA.

profLewis commented 4 years ago

On 19 Jul 2020, at 17:44, José Gómez-Dans notifications@github.com wrote:

OK, this point about the script is useful. Mounting rclone is a pain due to permissions and the Docker security model. Your suggestion would then work as

Download & install Docker desktop (-> cue videos) Mount one drive storage (-> cue video) Download & run the following script: runMe_final_final_works.sh ;-D (-> cue video) Create an icon for script in point (3) so that every time you click on it, the magic happens One further bit of neatness is that if all the data is OneDrive, if we need to update the Docker image with new packages etc, all user data is kept.

And that if we have one drive attached on the Ucl nodes, they have the same data stored wherever!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jgomezdans/geog_docker/issues/12#issuecomment-660674175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOC3GTFIHFWEOJ473HFUODR4MPGZANCNFSM4PBD66VA.