The example notebook (if everything works!) should show demonstrate calls to prepopulated mongo and postgres databases. You’ll need to mount the IPython notebooks folder onto the unzipped folder. You should be presented with some application containers including OpenRefine and an OU customised IPython notebook server. Download and unzip, from the Kitematic CLI cd into the unzipped dir, create and populate the data containers as above, then run: docker-compose up We can the run docker-compose up and it should fire up a mongo container and link it to the seeded data volume container, making the data contains in that data volume container available to us. #.which means we wouldn't persist the data in it #Also, if we leave it in, a "docker-compose rm" command #We DO NOT need to declare the data volume here If have a docker-compose.yml file in the working directory like the following: (If I’m doing something wrong wrt the getting the mongo data out of the container, please let me know… I wonder as well with the cavalier way I treat the lock file whether the mongo container should be started up in repair mode?!) #Here's an example of the reconstitution from the distributable file for mongoĭocker create -v /data/db -name devmongodata busybox trueĭocker run -volumes-from devmongodata -v $(pwd):/backup ubuntu sh -c "tar xvf /backup/mongobackup.tar" #This generates a copy of the distributable file without the lock. #We probably shouldn't do this, but if the database has settled down and completedĭocker run -volumes-from vagrant_mongo_1 -v $(pwd):/backup busybox tar cvf /backup/mongobackup.tar /data/db -exclude=*mongod.lock #the presence of a mongod.lock seems to break things #Unfortunately, when trying to run a mongo server against a data volume container Unfortunately, things don’t seem to run so smoothly with mongo? #Again, I wonder whether this should be run with -rm somewhere to minimise clutter? #Note - the docker helpfiles don't show how to use sh -c - which appears to be required. We can then take the tar file, distribute it to students, and use it to seed a data volume container.Īgain, from the Kitematic command line, I can run something like the following to create a couple of data volume containers:ĭocker create -v /var/lib/postgresql/data -name devpostgresdata busybox trueĭocker run -volumes-from devpostgresdata -v $(pwd):/backup ubuntu sh -c "tar xvf /backup/postgresbackup.tar" #I wonder if these should be run with -rm to dispose of the temporary container once run?ĭocker run -volumes-from vagrant_mongo_1 -v $(pwd):/backup busybox tar cvf /backup/mongobackup.tar /data/db # Export data from a data volume container that is linked to a database serverĭocker run -volumes-from vagrant_devpostgres_1 -v $(pwd):/backup busybox tar cvf /backup/postgresbackup.tar /var/lib/postgresql/data Would generate a dump in the container, but then we’d have to tar it and get it out? Something like these mongodump containers may be easier? (mongo seems to have issues with mounting data containers on host, on a Mac at least?īy the by, if you need to get into a container within a Vagrant launched VM (I use vagrant with vagrant-docker-compose), the following shows how:Īnother way of getting to the data is to export the contents of the seeded data volume containers from the build machine. #Complementary restore command is: mongorestore #For the compressed backup: cat postgres_dump.gz | gunzip | psql -Upostgresįor mongo, things seem to be a little bit more complicated. #The restore route would presumably be something like:Ĭat postgres_dump.sql | docker exec -i vagrant_devpostgres_1 psql -Upostgres On the to do list is getting to these to with the portable Kitematic branch (I’m not sure if that branch will continue, or whether the interest is too niche?!), but in the meantime, I could load it into the Kitematic VM from the Kitematice CLI using: docker save psychemedia/openrefine_ou:tm351d2test | gzip -c > test_openrefine_ou.tgzĭocker save psychemedia/tm351_scipystacknserver:tm351d3test | gzip -c > test_ipynb.tgzĭocker save psychemedia/dockerui_patch:tm351d2test | gzip -c > test_dockerui.tgzĭocker save busybox:latest | gzip -c > test_busybox.tgzĭocker save mongo:latest | gzip -c > test_mongo.tgzĭocker save postgres:latest | gzip -c > test_postgres.tgz To do this we need to get tarballs of the appropriate images so we could then distribute them. One thing I’ve had on pause for some time is the possibility of distributing docker images to students via a USB stick, and then loading them into Kitematic. Although it was a beautiful day today, and I should really have spent it in the garden, or tinkering with F1 data, I lost the day to the screen and keyboard pondering various ways in which we might be able to use Kitematic to support course activities.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |