Giter VIP home page Giter VIP logo

science-docker's Introduction

Note: this repository is not maintained anymore. In recent commits I updated the environment in science image to latest packages. However, I dropped scripts that were making possible to use this image to develop Python codes. Please refer to tag 2018.5 if this is the functionality you are looking for.

Collection of Dockerfiles that I use in my research

Base for images

Images are based on jupyter/minimal-notebook and I refer to its documentation for more specific use cases.

Basic usage of science image

docker pull rafalskolasinski/science:latest
docker run --rm -d -p 8888:8888 -v $PWD:/home/jovyan/work --name science rafalskolasinski/science:latest

This will mount the current working directory $PWD under ~/work directory inside the container. Please either cd into the desired working directory prior to executing above command or replace $PWD with desired path.

The container will expose a jupyter notebook to the local port 8888.

Running

docker logs science

will show information with "token" required to access jupyter notebook. The last remainig step is to open web browser and go to the

http://localhost:8888

and provide obtained token.

Image versioning

The main image is located in science directory. First version of its conda environment is tagged as 2018.1.

It can be pulled as

docker pull rafalskolasinski/science:2018.1

To obtain the latest build use rafalskolasinski/science:latest.

As Kwant is a main package that I use in my research I also provide a second image with kwant built directly from git. Environment in this image has all packages the same with only stable Kwant being replaced with a version specified by KWANT_HASH in the Dockerfile.

Building and installing python codes

NOTE: this functionality is being dropped - latest image that comes with it is tagged as 2018.5.

Code development process can be simplified by working in reproducible environments, like docker container. For this purpose I added a volume /src and convenient scripts (build and test) in /usr/local directory that can be executed through docker run command. These scripts allow to easy build and install (in development mode) python source code into the base environment.

In example, to build and install kwant from a local copy one can start the container with

docker run --rm -d -p 8888:8888 -v /path/to/kwant:/src --name kwant rafalskolasinski/science:latest

and execute build and test of a code with

docker exec kwant set.build.conf
docker exec kwant build
docker exec kwant test -v --cov=kwant --cov-report term --flakes kwant

Note: everything after test are arguments passed to py.test

Note: first command set.build.conf is specific to kwant and assures that MUPS will be configured properly.

If you want to install Kwant from stable branch you must first add conda's gcc to the environment with

docker exec kwant conda install gcc

If you want to start a clean build run following command in your kwant folder:

git clean -fxd .

science-docker's People

Contributors

rafalskolasinski avatar

Watchers

James Cloos avatar  avatar  avatar

science-docker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.