Git Product home page Git Product logo

conda-builder's Introduction

Conda-builder

Docker image for the creation of portable Linux Conda environment built using conda-pack.

Prerequisites

This tool requires a local installation of Docker and Python 3.

Installation

First, download or clone the repository:

git clone [email protected]:mcencini/conda-builder.git

Navigate to the repository main folder and enter the src folder to build the docker image:

cd /path/to/repo/src
docker build -t conda-builder:alpha .

Usage

We provide a create_packed_environment.py Python script to run the docker command. Usage is:

python /path/to/folder/create_packed_environment.py args

Here, args represents the following positional arguments:

path-to-config.yaml  - this is the path to conda environment YAML config file.
environment-name (optional) - this is the resulting environment name. Defaults to "env".
output-path (optional) - this is the path where the packed environment is saved. Defaults to the parent folder of "config.yaml"

For example, creation of a Pytorch environment using the provided configuration example can be done as:

python /abs-path-to/create_packed_environment.py /abs-path-to/examples/torch_environment.yaml "pytorch-cpu"

This will create a pytorch-cpu folder containing a pytorch-cpu.tar.gz archive and a unpack_pytorch-cpu.sh shell script. In general, the script will create an environment-namefolder containing a environment-name.tar.gz archive and a unpack_environment-name.sh script.

To relocate the environment in the target machine, copy the newly created folder in the desired location and run the following commands:

cd /abs-path-on-target-machine/environment-name
./unpack_environment-name.sh

This will untar the environment, clean the prefixes and create a shortcut to the activation script in the environment parent folder. Specifically, the path on target machine will appear as:

/abs-path-on-target-machine/
├── environment-name/ 
└── activate-environment-name

That's it! Now, the environment can be activated when desired by running:

source /abs-path-on-target-machine/activate-environment-name

Some caveats:

  • Currently, we do not provide a shortcut to the deactivation script. Environment can be deactivated by running source /abs-path-on-target-machine/environment-name/bin/deactivate.
  • Activation does not work with csh shell due to limitations in Conda activate script.

conda-builder's People

Contributors

bhoomit avatar mcencini avatar

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.