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

Provide Docker option for installation #5

Open
2 tasks
alecristia opened this issue Apr 18, 2018 · 16 comments
Open
2 tasks

Provide Docker option for installation #5

alecristia opened this issue Apr 18, 2018 · 16 comments

Comments

@alecristia
Copy link
Collaborator

alecristia commented Apr 18, 2018

  • Instructions for using Docker as virtualization provider for Vagrant, instead of VirtualBox
  • make sure /var filesystem has space for the layered filesystem Docker insists on using (or work around it!)
  • test on Ubuntu host (er1k) ask for help testing on Windows, OSX hosts
@riebling
Copy link
Contributor

Another 'gotcha' with Docker: it requires root privileges to run. (maybe not always, but for certain things) - I remember the explanation being that because it's possible to run a Docker container that does insecure things (that a normal user could not even do) it should require that you run it "as root" so that you know it may do potentially dangerous things.

About the /var file space problem: if users have root privileges, they can work around the limitation by creating a symbolic link /var/lib/docker that points to a folder with sufficient space. How to find out which folder does, and set this up, may not be something we even want to instruct novice users to try.

@riebling
Copy link
Contributor

riebling commented May 3, 2018

Candidate Vagrantfile that can do docker or virtualbox provisioning: does not do anything about the problems incurred with Docker running up disk space in /var/lib/docker...
Dockerfile.txt

Bring up the Docker version with

vagrant up --provider=docker

bring up the Virtualbox version with

vagrant up --provider=virtualbox

@riebling
Copy link
Contributor

riebling commented May 4, 2018

This may be a showstopper: Using Docker provider instead of Virtualbox, the shared "synced" host folder functionality is crippled. Guest OS does not necessarily have write permissions to host filesystem, it depends on the user & group & permissions of the working folder where 'vagrant up' happens.

How can we ensure that this folder is world-writable? We cannot. We want to support people running a myriad of local OS possibilities and environments, including ones where users may not have full write permissions, or root to be able to change them.

If we really want to support Docker, we may have to resort to using it directly, in place of Vagrant, which will require a new set of instructions and provisioning directives, e.g. Dockerfile instead of Vagrantfile. This may (to repeat) require users to be root.

See hashicorp/vagrant#5906

@riebling
Copy link
Contributor

riebling commented May 7, 2018

In spite of these complaints; Vagrantfile updated to support Docker as a virtualization provider within Vagrant. Use (ubuntu) with:

chmod 777 .  # make current directory world writable
vagrant up --provider=docker

Testers for Windows,Mac needed :)

@riebling
Copy link
Contributor

riebling commented Jun 13, 2018

Tried it - current Vagrantfile, on a fresh Windows 10 computer with Vagrant and Docker installed, actually works! Other things tried:

saving the running Docker Container as a Docker Image docker commit <container id> srvk:divime

Saving that image as a tar archive docker image save -o divime.tar <image id>

copying that tar archive to a linux host running Docker.

loading that image into docker: docker load < divime.tar

Giving that image a better name: docker image tag 9b17e srvk/divime

Starting that image in a way similar to (but without) Vagrant, such that it has a shared host folder (/usr1/er1k/Desktop/DiViMe) mounted in the usual VM place (/vagrant):

docker run -v /usr1/er1k/Desktop/DiViMe:/vagrant -it --entrypoint /bin/bash srvk/divime

chmod 777 /vagrant
su vagrant
cd /home/vagrant
tools/test.sh

resulting in:

vagrant@fdb9186f7d4a:~$ tools/test.sh
Testing noisemes...
Noisemes passed the test.
Testing DIARTK...
DiarTK passed the test.
Congratulations, everything is OK!

Reasoning: Docker does not map file ownerships across shared host filesystem like Vagrant does, so the Docker Container has to do some things 'as root' and the host filesystem has to be world-writable.

@riebling
Copy link
Contributor

Marking closed, documentation here: https://github.com/srvk/DiViMe/wiki/InstallingWithDocker

@riebling
Copy link
Contributor

riebling commented Aug 31, 2018

Docker is really not a VM, and the more I read about the Docker philosophy, the less inclined I am to believe it's benefits will outweigh it's costs. https://www.linode.com/docs/applications/containers/when-and-why-to-use-docker/#when-not-to-use-docker Yes the philosophy is that Docker containers are 'lightweight, ephemerable, disposable' and should only run 1 process/service. But that's not the philosophy of the Diarization VM, which is to build a somewhat heavy weight, persistent tool, with control over how much hardware (disk, memory, cores) it can use. Re-implementing the entire VM as a Docker build container will not make it any more lightweight. In particular, it might break disk space in ways novice DiViMe users cannot diagnose, control, or fix.

I plan to use this space to document problems encountered in constructing a Docker-native (as opposed to Vagrant using Docker as a 'provider') container.

  1. Dockerfile is not the same as Vagrantfile - Vagrantfile uses normal shell commands, Docker commands are idiosyncratic (see 4.)
  2. Default Docker user is 'root' not 'vagrant'
  3. The default Docker shell is /bin/sh not /bin/bash (this can be overridden)
  4. Docker RUN commands require special handling
  • some need to be glommed together to run 'at once' with &&
  • commands that run as a pipeline require special pipefail error handling
  • the cacheing of RUN commands sometimes needs to be circumvented. We have no need to refer to intermediate states during provisioning time.
  1. The local working directory shared-folder implicit with Vagrant needs to be explicitly specified when running with Docker with the -v switch
  2. New commands will need to be documented for users; We will have to maintain 2 sets of instructions "Docker mode" vs "Vagrant mode", 2 sets of provision scripts (Vagrantfile, Dockerfile)
  3. Users may need to be added to 'docker' group to be able to run Docker as a nonroot user (so anyone wishing to use Docker must/might have root access on their computer)
  4. the Union File System: we have no need of a history of every state the filesystem has been in since creation. It just Grows and Grows, until /var/lib/docker fills up. Can be worked around by making symbolic links (Mac, Linux ... not Windows), assuming again users have root on their machine.
  5. Shared folders: are VOLUMEs available during docker build time? No. Can't write to the host. Can't read from the host. Sort of a showstopper vs. Vagrant technique. How will we install, e.g. HTK? Other downloadable binaries?
  6. point 2 all over again; how to create a non-root user e.g. 'vagrant' in Docker container, and not get linux spec user: unable to find user vagrant: no matching entries in passwd file message - can be worked around with useradd -m which forces home folder creation
  7. no equivalent 'vagrant destroy' - or is there? Docker rmi -f xxxxxxxxx. Docker images may pile up invisibly, using up disk.
  8. Docker tags and images and containers and hubs and repositories OH MY (terminology fatigue)
  9. Docker container and image naming conventions, please don't make DiViMe users have to look up or type in hideous strings of gobbledygook characters e.g
docker run -it 8fd9bb45444e /bin/bash -i
docker run -it 8fd9 --mount src="$(pwd)",target=/vagrant,type=bind /bin/bash
  • can be worked around by tagging images (containers?) at build time(?)
  1. Permission problems: https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
    Docker can't write to shared host filesystem: Permission denied - point 9 over again, but at runtime instead of build time. There seem to be numerous hack-arounds for this, all of them ugly. Docker developers are brittle about this going against portability, being a performance bottleneck, not working across shared 'swarm' volumes. It seems like it's a dealbreaker.
  2. Cryptic error messages:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"--mount\"\
: executable file not found in $PATH": unknown.

What was the actual error: wrong order of arguments to the docker command. (How in the world is that error message supposed to inform someone of what was done wrong?)

  1. Owners and permissions Part 2: when doing Docker build some things are installed as root by default, some as the default user (vagrant). To fix things up, we like to chown -R vagrant:vagrant /home/vagrant to make sure the user and group are set correctly. If you try doing this in docker, BAD THINGS HAPPEN. It's COPYING every single file, because of the stupid union filesystem that was supposed to be a selling point of Docker.
  2. Double bind: we're told that Docker container processes should not run as root. But we're also told that by default, they do. As a test, running in a container, it is possible to create a file on the shared host volume filesystem in 'bind' mode, and the owner of that file is the host's 'root' user (maybe by accident?). So if DiViMe users have root on their computers, this might be acceptable, but if they don't, there's going to be a lot of piled up files owned by root they can't do much with. (Have the Docker container delete things since it runs as root??)
  3. No sudo (by default) in container. You have to install it, and add users to sudo group manually

So long as we use it in the way it was intended, for things that are LIGHTWEIGHT, EPHEMERAL, DISPOSABLE... single process, single thread, then throw away the container. Separate containers for separate concerns. Building up a giant "VM" with numerous tools, packages, 3rd party libraries, models etc. - kind of defeats this purpose.

@riebling
Copy link
Contributor

riebling commented Sep 6, 2018

Here's an example of not understanding what is going on with Docker Images piling up, or how to remove them if new ones keep appearing:
I don't want Docker images piling up filling disk. There's enough hidden disk bloat
without Docker's help.

So I use "docker images" to see some images I've been working on lately.
I use "docker rmi -f xxxxxx" to delete some.

NEW ONES APPEAR

So I repeatedly do this, until all the new ones that keep appearing go away.
So theoretically I've deleted all the ones I've been adding recently.

er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              0fe1d13ddf4c        5 minutes ago       10.4GB
<none>                    <none>              3c14a42d5d97        6 hours ago         937MB
<none>                    <none>              9ca77341173c        23 hours ago        937MB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi -f 0fe1d1
Deleted: sha256:0fe1d13ddf4c161274545d7b168488375ff7445fcb459e1cefbe08cea2dcd913
Deleted: sha256:368e3de82d35e47ec7a1b65d5e53ba3b23ce2d5b115445c01d751ff03c3d5e0d
Deleted: sha256:57273dd5f286ba1eed65b676df0dcbd4524c1bbe21905b4f53d4949b80947ad5
er1k@islpc22:~/docker/DiViMe$ docker rmi -f 3c14
Deleted: sha256:3c14a42d5d97f528203fca21945839f64d6d4615eaa509c59a1f8b2eba877e12
Deleted: sha256:1bbf78f2bcb8ab17d386cc35a13363c1b419d969d879a6ffb15a4f88600c0425
Deleted: sha256:98738d114e389a913ef6b0face138e98f3641adb9b1a8b287d34d28ac7448143
Deleted: sha256:624855d5ba0d5bc762f99e6fa7570468202f910b24c834666749715fee484c2b
Deleted: sha256:84173566ae1a339931dd9a49fb101ec8db0227e3730e6e3c5c0252e67867273e
Deleted: sha256:25c960d01fb6a7a7388f22efea90522bec548dfa93ed84a9b787262c82d12032
Deleted: sha256:dc8c572a16e9d0673d29349c45963a6f1a4769354beb4549b4c490d871768c7b
er1k@islpc22:~/docker/DiViMe$ docker rmi -f 9ca7
Deleted: sha256:9ca77341173cb845e330d5722ff2e73941e9aa238319a3a51db58c7ca7b41e00
Deleted: sha256:46d57bc8b7da78bd87c98ab3f5eed44cee7d00c50c39eeef12abfda33b735662
Deleted: sha256:1488383b076ebd9a67918ccc4e392c0126b84c265c500c6d7787c3228643fc53
Deleted: sha256:120c89b6838019e62bd5dbd47f80be492a276d07e681b4e9497519c7a1364e96
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              160dd8274150        7 minutes ago       10.4GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi -f 160d
Deleted: sha256:160dd827415090ecc26ad9ffaaa2701aff02ea57b2db7ef41e4cf2bd47685fbe
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              aad4362c5347        14 minutes ago      6.39GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi aad4
Error response from daemon: conflict: unable to delete aad4362c5347 (must be forced) - image is being used by stopped container 7b2d48361bd4
er1k@islpc22:~/docker/DiViMe$ docker rmi  -f aad4
Deleted: sha256:aad4362c5347d13844d3d58ad7412e3b7d7e57eb24d2d409f9a479c62ccd3e9e
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              8fb601f4f7e7        19 minutes ago      6.39GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi  -f 8fb6
Deleted: sha256:8fb601f4f7e736b0ef717a02f5d19ba0d32c1965b3d3a4e34a2ab2c84286a384
Deleted: sha256:bf91b3ff8c7314f1d693b1f6ab3f4bb9aa0aa4ae61780929c93f891a4d08f38c
Deleted: sha256:bb9ff28c4dbdd29192d7424fa41e207a919e2d9f7a7cbe961b05a79411a82a51
Deleted: sha256:250efa5eb3ced9ff8eb67f0bb06324b2805a492aecc5c3cace6916c0e6e07849
Deleted: sha256:784b7125cd9264274887b55b063af8c3cfe3fd978aef01951e1b2cea4398c94f
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              d31b68cedfed        About an hour ago   5.94GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi -f d3ab68
Error: No such image: d3ab68
er1k@islpc22:~/docker/DiViMe$ docker rmi -f d31b68
Deleted: sha256:d31b68cedfed734ebdc60dcee49f65a20e02025884bf851f2dac5f86d50dc542
Deleted: sha256:fda0058fac64ac732b5770b69e94f62fb007b5abb4fbbdd6123e66dc8af9ef4b
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              a56208d6898d        About an hour ago   5.93GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi -f a56208
Deleted: sha256:a56208d6898d49ba432d5bd2ea27edcea9298e6ca7e1e8341b67746a4a5f668d
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              1510fc4c8671        2 hours ago         5.93GB
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker rmi -f 1510f
Deleted: sha256:1510fc4c8671c892d594a420b1ab98ddf64bf61b2a6bb6fcdf9d9d292148d467
Deleted: sha256:744d50696bc095abf4da00459b279ad2a4f8ccacc70a477a285814df2519e162
Deleted: sha256:43c8fec079810b3d953f7bf9b595c6ca6f991da3398c9fe625996902a251f9e2
Deleted: sha256:abc265b387a2f0bb95ae728eb057dca1ca8ce44a65f7403c13c5b6e9669ab13f
Deleted: sha256:855aec249a5a728ad26c8fde5c12a9aefb33cbd7c41a0c8812e890b3a8342787
Deleted: sha256:a6e9f623c6f9ff5fa468da6d4efc665497d27e194fa8118f3b4f2a9a848ab785
Deleted: sha256:8c5be0825e8e544686874abe50602c68c901a68c8e398291334f4bc7dbed501b
Deleted: sha256:b0b1f9758ed892ee22cf970595a477ee4437627ea1698092eb107eb9e4a5481b
Deleted: sha256:5a1c26c7a2ccd7684444bf365498f03b3273f886c09fe70aecb39bc23760bd05
Deleted: sha256:4f8689351dc5335c1b1fd4f8726661d85c558a2cddf5a7cd639b1dcd2afdf41e
Deleted: sha256:91f71b2822fe1f6039a1d0b3af52d960fbdb0d235db0c340560bd46203178cf1
Deleted: sha256:c3f5a385355cbc3b58d7d56051fca800096f162615370f77d0a2c2d707e5e641
Deleted: sha256:baf5a2e795e2e1e971226d36859de98dbadef4f0162fa25f010d975f46f85827
Deleted: sha256:71c3e3cd9de12582c8a47c57e2c074970666ad43677f12c8930b2f7867541573
Deleted: sha256:91bacb94fa637710c0bd28091a605c88ec962202df9ba3aa7a95a37aba12b1b1
Deleted: sha256:6e5712d0a0e6a9dff6478d4f0ae8607970d6f78602a233d55a114f8bb9e27656
Deleted: sha256:098bdc3cf1d1727b21b013c68520be4dbbc4faac6cbf449f2981ca072b255e92
Deleted: sha256:4a909aeac6578ef37562a23f62b3baa8f3ee946dbed0b2383644104585b4c572
Deleted: sha256:c5db11e935f9b2e65c0b48a6d7efc648053d9b86eacb9276b87a26ed37cfc7e2
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
ubuntu                    16.04               52b10959e8aa        9 days ago          115MB
boom/docker               latest              e500348ad975        2 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ !sudo
sudo du -hs /usr1/docker
53G    /usr1/docker
er1k@islpc22:~/docker/DiViMe$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
<none>                    <none>              b513e29a2afb        3 days ago          16.4GB
ubuntu                    16.04               52b10959e8aa        12 days ago         115MB
boom/docker               latest              e500348ad975        3 weeks ago         1.02GB
srvk/divime               latest              9b17ef870b40        2 months ago        11.6GB
phusion/baseimage         0.10.1              2391dfad8777        5 months ago        241MB
tknerr/baseimage-ubuntu   14.04               634404a207da        15 months ago       260MB
tknerr/baseimage-ubuntu   16.04               8ea8daaeafe4        15 months ago       257MB
er1k@islpc22:~/docker/DiViMe$ docker images -q --filter "dangling=true"
b513e29a2afb
er1k@islpc22:~/docker/DiViMe$ docker rmi -f b513
Deleted: sha256:b513e29a2afbe7f4b4e3fa115d08dbb7ddf6f321ea0a20bcfbafa1ba59f53a04
Deleted: sha256:d397b5d700c65234853aa3fd628e97453038a9baca2317313d14c07357f4e5f2

THE DISK USAGE IN /var/lib/docker ACTUALLY IS HIGHER NOW

What the heck is going on?

@riebling
Copy link
Contributor

riebling commented Sep 10, 2018

Current issue, a catch-22:
We want things to run inside the Docker container as user 'vagrant' (it's baked into almost all our code) - but 'vagrant' doesn't have write permission to shared volume '/docker'.
If instead we run in the container as user 'root', which DOES have permission to write to /vagrant, things break. For example they python virtualenv is installed belonging to user 'vagrant', not 'root'.
When doing RUN commands in the Dockerfile we have to be very careful which user it's running as

Also by default, there is no sudo, and user vagrant does not have sudo privileges. (unlike in the VM)

Turns out one technique is to make the host working directory WORLD WRITABLE with chmod 777 .. I have no idea how this will work in a Windows+Docker environment.

@riebling
Copy link
Contributor

riebling commented Sep 10, 2018

If you docker run a shell in a container, then exit... things done to the container DO NOT PERSIST. I just installed software so it could have sudo and mlocate, exited, re-ran, and they're not there.

(Maybe there's some way to find a new UUID for a new image that is the result of the previous docker run ..., and so you docker run that NEW UUID to get the changes, otherwise you're running the old version?)

@riebling
Copy link
Contributor

Still not sure how to manage space used by Docker on a computer, it seems they want to hide that from you, or make up new, obscure, cryptic ways to do it. So trying one of these ways: docker container prune - here goes, and what does this even mean?

er1k@islpc22:~/docker/DiViMe$ docker container prune
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] y
Deleted Containers:
fba125710128b16d433063876ec1b0ad18bb826b27e9893f2d1737a7f0083c41
fd2b4ca86575f359dc842288093f2c0becc134d478051ae1ce018570f5a729fa
09af098731b0fa9f92f8699653ac4730dd47bd3ed52f57058c4c408e7b4a111d
43e60cf43644c1c4833852eec6c7b71eaf8a5ad081459d4fc3b328586f3ddcad
f2199b3cee8bea30999bea8b13c723892187cf6b7341d435d3d4666c8a0a7f41
5bdd5349f726cdaef1a59272638257dbb2a9575385b3e5cf50925156d8096b6e
bc1e8d33371b07006058b73ce3b1ef67782e00428997423d84f871ebc69dc277
f23b9c9be46f2df362a9a0e6b59a2efc6c53e2adbcee22d178696261bc07c920
9fbbcbdba5da02b56e873b87ca817a1243bdcd1398000acb33db8bcafc36558b
9dd6739963e2b28a2a3b72067865a2ef39cc9bd2f505b76359f43dbf4d543a69
9ce4e9bb60d9765027d29374ae75f3c13eee41c59da87d8b772b28192e228f5c
2cb93e41021425d6e447aff5e475b1e3ec14e5cbf3f62268bf904ce1926748f1
0f545c18c33f32fc1c21ac4bdf65a423e9b9ad104c4da54901f9f7ffa96e7a60
ea76d09af55eef4950f57bb0eff98565a7f1d56d91b7240f421b2ea50e5e4ad4
c502240d20980dd8fae634d42017a343b28e08e3c3ca2f5082f5b32854eee868
686105e0a1cd6b9ff54491866ed1281d6918af00bdf9ca74dab906949cbdb058
04cff39e8a6e6aa93562bd79f86ca3b15fb6785d78700c591d65de5a69a40a93
4b77a9c3b067e9dc0e34b95657d8c49395d8f998c17ddc31a6e8647e2291f515
2ed69207a8a1c5eb23fff4afb8512641a84371a175716bc67a3ce5bc1755ac25
405e9817085686adb39e9931b53f6c9245af9dbadd2ef9dc39dc5141a4968ea4
936ad9abe9046362f0a3366327ebfd3238ef10ef1f2b09a02218004337d21c6d
2737b47125e48298cf5a4b72e32db0e003178d2ee843a248455da181f0ba698b
cef4324f2fb7fe8ce6e3ec77d3d7ba4fcb311c21bf9949e5ee5583dcb2ce34a9
c49dd3ee74d0c3e9d3f1b5d885bac6284456225f4fdf70b374a91a3e5c91b372
8a54fb107922bfad39d81d303f7ddb6cdf5cbf6329a8994cc722e078fa1a917f
b2bef4d50a88901590dd3c4de5e3bc167c54fdf8b42e6056f1d1498117e8d9d9
8d5670a9f2389da37dde588b6c9360422c065aeda3d8bd951a77f74c0f99691e
d78307973ca52b8c5c82c4f35fa7cc33941c0f9b095aa6f5311c78134e688266
47d9bc43ef7305d9d164f7fd307bd8138ac50a0eca866fcf7d987a44ea1f0580
2543ec858affed0595a84aa69c0d52a3f3db521477a9ef0bcd27bdc63f82fbfd
3a4d8314dad9c661d8dbcd94071a7af29668b3517ecdd64d6504cbdc9d522e72
447e8db11be5ad682fa01659d88e705b736292badcb2f160c590275cfb6aedff
aed9be8d00c9a3cfa4446eee7ea0a23c1fe7931fbcb96a02470afed56e0b79ce
32c20cf23317c0d51e667b91d15354b92396dfbfe63c9753e6036a35e8dccb77
f9462499a33c1446f5cfe5e5c4e7f9572699ce726692fdcbfc1bdaa7c7a03f66
33789706b7b0afb486e521499463c62b033d7cda20e60fef058e1514d3ad3caf
f8c9a5e55a5bebda8ed44e4008bffcb30a6345200d9601c1077af729fc9e1c11
14c3978ef66db9e778c2d59f2024a5eaa24f7338f2574f7228fec5d1368df6c8
07f011c557ab312ee7fd50dc373b3da951e9e320f147391b16130df70a1ad6e7
1de8d295427f308ad700248f1a30c4521ba2bb8687c642b02d0433fe9d5c4384
7b2d48361bd45644d59111b4b9946c5e960d5d66fa08130cf88a366de228f4cd
b5388309177dab4e332f76c60fe7bc699639403ef7d6ace8b1184d12f91a14c2
f0462a2343bfcf255704cc9af2989c34bbcb8ce00f83acb0bf35f4ef0c471888
af50c5db095fb021f97a4a28c741f56ba1a93b45c6007711bc8d2d37dbc82e72
e19d3b50f97b0798587c25ea167d4558440a3d105648008ae44eb3526cf4a6a4
6115e91f27d68b73c539e55f44710deff5100b01da43854f06d3f78cfc01b3b4
58b76b324b5bcc65215c0f0d388ba117fee5b3673240bd079fb99a76f29cd6d5
9a584ffaa8c783f6f86d39161b3ed151a37efde147c61c4ca26a547ed88ee50e
3a64bec5ea6df211c0fd45850203c192eb6cffbf34f463f3d63d6b9173b30de3
989804ab01b9cf959c33b6f0e1e43f04d99a716acdc05f7a446fb0196681039c
aceedecb521135d2687cf8d34e1e6e12aee0b7ded37e8fb2d78295f1966a2ad1
35833eff3dcc4830c7cb54e902240a63ba042897a279a644bebbb28e650bdc54
22ff6817bf10ba3c2ee9ab11283cc12397551cd27847fa9b8c29e5ecc89dc1e4
47cdcfb0d5b49ec478686c1c53c243fb50de3a907b7fe6f5bd7eb9cfc448b3f4
72ed4c4da564e7dfa133093eb5276721c0012c240111e696f60e172e1529fb33
ca12f58c556896d229bb852cabde66b0aa8d470bccb6a962df23fac8e694dab9
dd84640f8667581963f24f44c2d9f96816b2bf70c602977f962c2a4d17f8e552
6cfc46e96bcdb4ee72f7fcaa2e0fd34db15153ea658f56646f3d9cd1604f458d
714c36a0fc0e57123ec38bd71303cc50732adb8e411504751646dd06d64a8bdf
883f96dc1906d75dce7dbdd8c4e0573b34942915f60d8cd49b24a22a5f4bfbe3
46ec5d6f4d3d187e1ef8f88b1785a7099e4d1efcd98a8c15f3da909261fdcb52
4f3e7d89f8aefa1ab4269c5ac1d85f79a178fd81cd81fc0e27ad456f148179f1
26ea63a8d2aae505d3958609184e29854cb31cd078fe9ba018001bb1c0edfbec
96f0980085a87fc81e4c18751b49f4e86345e72a13957066646f8eac29dec8f1
e0c89c2363c093cb761526d56734799687ffd48655b711d48a55207a456a871c
ab427df1b4fbde290f8adce3aa0afc9f3de0eef7abed07e9ee47d7c31ce59686
180f769c1c2443929aa547d459ec13723a9ec6b598d95a0cb1c5443025708804
732a73e852404ebd1a730a3137b36a047520080dbf4a712d299735fedff71bc8
2865d45bf8a89693def99d40a9f84a17481c9ae343b6cd2403a5e51ff14d33d9
b9900ebfe4e0251465eef7afacbba90f3b95fdff2592927e058a040fe3c3ec32
54bd54a64ca9c95d58965c0be5b9d898c45a20fb89ffecc50de00a35c728de6e
fdb9186f7d4a5b29a08ec8ecd9f5ac90b51641a2ae262cc76e58df88becd0bb2
21395d3c1b8f2f50161fa7260f47189abb47688a6c758036454e870e83cce755
80381f96f88fbf8b0d865b12336d4481953070c2e9bcf46c39ca86272a2b2287
0e074bcd7fe36fe7d6f136ac3b5e172c8cfd2cf100445e5975ff25ee6bd2bff5
24c6db69be081feec26751cbcd50b7d4718dd0c9799def7d9600b03253350cf9
ac84de6634b4d0e49fcb1674fe33ae4df4423e6fdd1b45fd3652589fd8a6f347
e47211831920ca90988c297a520222579d011dcd64a83ea840fba698cc668d52
09acbb29657fd009d4898aa99e8d366ac8b986fd681dbab1f53295ae98319b70
0c02ce21761fa3edaf58293dc0213f4ffbab0e29b23d01f76f818e4b5ec750f6
b3df900a686f27417d54f943a7dbd32161431addf1b11d189ad8300f72298883
4d555f5d06646fec47f6ceab81bf7f6c8cca0f979323a6bf3c73608160aafebb

Total reclaimed space: 14.9GB

@riebling
Copy link
Contributor

riebling commented Sep 10, 2018

docker/compose#3270 (comment)
It's an ongoing struggle. There's no good solution. We need Docker to map userids between Container and Host, and Docker folds their arms like a petulant Trump and refuses, because it's "Not the Docker Way"

I don't see how our code can work when it's not free to create and remove files on the host (which it all refers to as /vagrant/data/...)

WORKAROUND: make working directory world-writable. make subdirectories the same (if they are to be written to) such as /vagrant/data and /vagrant/Yunitemp

@riebling riebling reopened this Sep 12, 2018
@riebling
Copy link
Contributor

riebling commented Sep 12, 2018

After making much noise on the topic (see above), I have produced and tested (minimally) a Dockerfile that produces a Container that passes the self-test (tools/test.sh). There are still more things to do:

  • Document (possibly in parallel to VM instructions) how to provision - the equivalent of vagrant up
  • Document special needs for Docker for linux, Windows, OSX, e.g:
    • Working directory must be world-writable
    • User may need to belong to docker group
    • User may need root/sudo permissions
    • File space in /var/lib/docker may fill up, requires at LEAST 20GB not counting space taken up during data processing time
  • Document how to run - the equivalent of vagrant ssh -c <command>
  • Document how to clean up - the equivalent of vagrant destroy
  • Document quirks about the results
    • Output files may have weird owners/permissions
  • Test all the other tools' functioning in the Docker Container
  • Change documentation for the whole system such that "VM" might also be "Docker Container" to help remind people that they are different things (again, as I painfully learned, above)

@riebling
Copy link
Contributor

riebling commented Sep 14, 2018

Some more good news:

  • DiarTK seems to not require any modifications to work in Docker Container mode.
  • Temporary files created by processing within the Docker Container go away when invoked by 'docker run' - and the Docker Image remains unchanged. (only files saved external to the Container persist, those created in the shared working directory local folder on the host)
  • It's not so impossible to get shared-host-folder data at docker build (vs vagrant up) time: you just have to use the special COPY command. This solves the issue with installing tools like HTK, and with copying of certain config files like .theanorc (that should really probably reside with the tool(s) that depend on it, but the philosophy here is that configuration files reside outside the Container/VM so they can be changed easily by editing on the host)

@riebling
Copy link
Contributor

A problem with Docker: any scripts intended to run outside the VM (at least the one to get ACLEW Starter data) cannot simply call "vagrant ssh ..." any more, but will need parallel Docker specific commands.

It wasn't such a difficulty to make Docker 'see' it's shared host folder as /vagrant and have a user named 'vagrant', but it's definitely getting too Vagrant-centric to have scripts that assume a Vagrant VM is currently running.

@alecristia alecristia added this to In progress in LENA match up Sep 25, 2018
@alecristia alecristia removed this from In progress in LENA match up Sep 25, 2018
@alecristia alecristia added this to To do in Improvements Sep 25, 2018
@riebling
Copy link
Contributor

This is nearly nearly done, in terms of the Dockerfile.
But that will need to be updated to match any changes to Vagrantfile, especially in light of the work @junghanw is doing for the https://github.com/srvk/DiViMe/tree/develop/refactor_vagrant branch.
And the documenting part "how to run Docker mode" vs Vagrant mode still needs to be done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Improvements
  
To do
Development

No branches or pull requests

2 participants