Giter Club home page Giter Club logo

devenv's Introduction

Development Environment Manager

Build Status

Main features:

  • Persist installed packages, configuration and bash history for later.
  • Automatically mount your project into the environment.
  • Automatically discover previously built/modified enviroments (based on project path)
  • Specify what base docker image to build environments on top off..

Quickstart

  1. Clone this repository and run
make install
  1. Go to the root directory of your project and run
devenv shell
  1. PROFIT!

Usage

All of the below assumes you to be located in your project directory. devenv bases all of its assumptions on where you are located on a file-system level.

Build

Note: All options accepted by build are also applicable to shell

Specify your own base image.

By default, devenv ships using the centos:6 docker image as a base image. This can be overridden via the command line:

devenv build --verbose --base_image=python:37

Any subsequent devenv shell commands run inside the same directory, will default to this image until devenv clean is run.

Override the default Dockerfile:

devenv build --verbose --dockerfile=./Dockerfile

Commit

After you have exited an environment, you can commit whatever you did while inside the environment to a Docker image:

devenv commit

Cleanup

devenv clean

Shell

Note: All options accepted by build are also applicable to shell

devenv shell

Override base-image

Start shell in docker container based off ubuntu - rather than the default centos.

devenv shell --verbose --base_image=ubuntu:latest 

User-defined volume mounts:

devenv shell --volume=/tmp:/tmp --volume ~.aws:/root/.aws

User-defined volume mount to an existing environment:

Docker does not allow new volumes to be mounted on existing containers. To circumvent this limitation, the -—new option causes the following to be performed:

  1. commit the existing environment container to a new image (overwriting any previous image)
  2. delete the existing container
  3. recreate the container (based on the image from step #1) with the new volume mounts.

This allows us to specify new volumes for an existing environment.

Note: Existing volume mounts need to be re-specified when invoking --new

devenv shell --new --volume=/tmp:/tmp --volume ~.aws:/root/.aws --volume /var/log:/var/log

Contributing

Pull requests are welcome.

devenv's People

Contributors

gzur avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

logileifs

devenv's Issues

feature-request: configuration management

We need the capability to configure our environment outside of CLI invocations (for instance, in .devenv file - one per directory with an environment, and then one global in ~/.devenv

devenv shell fails with AttributeError

$ devenv shell

Traceback (most recent call last):
  File "/home/logi/.virtualenvs/floti/bin/devenv", line 11, in <module>
    load_entry_point('devenv==0.2.0', 'console_scripts', 'devenv')()
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/devenv-0.2.0-py3.6.egg/devenv/cli.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/devenv-0.2.0-py3.6.egg/devenv/lib.py", line 3, in <module>
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/docker-4.0.2-py3.6.egg/docker/__init__.py", line 2, in <module>
    from .api import APIClient
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/docker-4.0.2-py3.6.egg/docker/api/__init__.py", line 2, in <module>
    from .client import APIClient
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/docker-4.0.2-py3.6.egg/docker/api/client.py", line 8, in <module>
    import websocket
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/websocket_client-0.56.0-py3.6.egg/websocket/__init__.py", line 23, in <module>
    from ._app import WebSocketApp
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/websocket_client-0.56.0-py3.6.egg/websocket/_app.py", line 36, in <module>
    from ._core import WebSocket, getdefaulttimeout
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/websocket_client-0.56.0-py3.6.egg/websocket/_core.py", line 34, in <module>
    from ._handshake import *
  File "/home/logi/.virtualenvs/floti/lib/python3.6/site-packages/websocket_client-0.56.0-py3.6.egg/websocket/_handshake.py", line 40, in <module>
    if six.PY34:
AttributeError: module 'six' has no attribute 'PY34'

feature request: automatically enter environment when cd-ing into dir

What is needed here is a way to mark directories as haz-devenv.

Proposed solution is to introduce a dotfile/dotdir á la git.
The existance of a .devenv file/dir in any directory would trigger the automatic invocation of the relevant environment.

This .dotfile/.dotdir could be used to store other configuration (like base_image, default_interpreter, and other such stuff)

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.