Giter Site home page Giter Site logo

pydockenv's People

Contributors

cedarkuo avatar davidthewatson avatar gaetano-guerriero avatar mkshid avatar se7entyse7en avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydockenv's Issues

Use a single alpine/sockat container for port mapping for each environment

Currently, the container corresponding to an environment is started without mapping any port. Mapping a port would require a restart of the container. To avoid the restart, port mapping is achieved by forwarding the tcp traffic using an alpine/socat container. But currently a container for each port is spun up, this could be improved by using a single alpine/socat container to handle all the ports forwarding.

consider also handling len(cmd) > 1, cmd[1:] could be passed

// TODO: consider also handling len(cmd) > 1, cmd[1:] could be passed
// as arguments to the alias
alias, aliasExecOptions, err := lookupAlias(cmd[0], contInfo.Config.Labels["aliases"], options)
if err == nil {
return ExecuteForContainer(contInfo, alias, aliasExecOptions)
}


This issue was generated by todo based on a TODO comment in dbda5be when #92 was merged. cc @se7entyse7en.

Write a proper README

The README should have the following structure:

  • Installation
  • Why?
    • virtualenv vs pydockenv
  • Quickstart
  • Examples
    • Basic examples
    • Advanced examples (something like a Flask web app that requires to expose a port)

Use pydockenv for the project itself

Currently, there's no easy way to use pydockenv for the development of pydockenv itself.

Some ideas:

  1. bind the socket into the env container in order to enable the usage of docker from within. See this. The problem is that there's currently a check on the current working environment for running commands relatively to the project root directory.
  2. use docker-in-docker. This scenario is much more similar to the real usage of the final user. It will though require the installation, but it may have some problems, see here.

cannot install from pypi source tarball (0.2.1)

project cannot be installed from pypi release 0.2.1 since HISTORY.md is used by setup.py but missing in tarball.
Easily replicable by forcing installation from source tarball:

 pip install pydockenv==0.2.1 --no-binary :all:

Better error handling

This issue is very generic. Just as an example if an error occurs while an env is being created, eventually created resources (container, network, etc.) are not deleted.

Replace `envs.json` with container's labels

The meta information of each environment is saved inside <some-path>/envs.json. In case that this file gets deleted or corrupted, it won't be possible to run certain pydockenv commands as many of them require reading it.

This could be improved by removing the need for this file in favor of adding this metadata to the container itself using labels during its creation.

Travis CI requires pulling docker image first

On Travis CI, if the alpine/socat:latest image is not pulled before running the tests, then the tests fail as it won't find the requested image. The expected result is that the missing image is pulled when requested as it happens locally.

Requirements issues

Looking to give this a go, I installed via pypi as directed in the README.

Firstly, on attempted creation I got a massive stack trace which came down to a missing requirement of docker-py. So I installed this with pip install --user docker-py.

Attempting to create a pydockenv again, I get

Creating environment dockenv with python version latest...
Traceback (most recent call last):
  File "<HOME>/.local/lib/python3.7/site-packages/pydockenv/commands/pydockenv.py", line 34, in create
    image = client.images.get(image_name)
AttributeError: 'function' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<HOME>/.local/lib/python3.7/site-packages/pydockenv/commands/pydockenv.py", line 362, in <module>
    cli()
  File "<HOME>/.local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "<HOME>/.local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "<HOME>/.local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "<HOME>/.local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "<HOME>/.local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "<HOME>/.local/lib/python3.7/site-packages/pydockenv/commands/pydockenv.py", line 35, in create
    except docker.errors.ImageNotFound:
AttributeError: module 'docker.errors' has no attribute 'ImageNotFound'

Solved this with pip install --user docker

Then

 Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<HOME>/.local/lib/python3.7/site-packages/pydockenv/commands/pydockenv.py", line 13, in <module>
    client = docker.from_env()
  File "<HOME>/.local/lib/python3.7/site-packages/docker/client.py", line 85, in from_env
    timeout=timeout, version=version, **kwargs_from_env(**kwargs)
  File "<HOME>/.local/lib/python3.7/site-packages/docker/client.py", line 40, in __init__
    self.api = APIClient(*args, **kwargs)
  File "<HOME>/.local/lib/python3.7/site-packages/docker/api/client.py", line 128, in __init__
    config_dict=self._general_configs, credstore_env=credstore_env,
TypeError: load_config() got an unexpected keyword argument 'config_dict'
python: can't open file 'create': [Errno 2] No such file or directory

Which version of docker/docker-py is compatible with the project?

For reference, pip freeze | grep dock gives:

docker==3.7.2
docker-py==1.10.6
docker-pycreds==0.4.0
pydockenv==0.2.1

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.