se7entyse7en / pydockenv Goto Github PK
View Code? Open in Web Editor NEWPython virtual environment, but backed by Docker!
License: Apache License 2.0
Python virtual environment, but backed by Docker!
License: Apache License 2.0
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.
pydockenv/internal/executor/executor.go
Lines 49 to 54 in dbda5be
TODO
comment in dbda5be when #92 was merged. cc @se7entyse7en.pydockenv/internal/executor/executor.go
Lines 266 to 271 in dbda5be
TODO
comment in dbda5be when #92 was merged. cc @se7entyse7en.The README should have the following structure:
For example aliases:
python
-> pydockenv python
Currently, there's no easy way to use pydockenv
for the development of pydockenv
itself.
Some ideas:
Maybe this can be done by simply setting network to host
.
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:
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.
On my system /bin/sh
is dash shell.
Test for shell compatibility at the start of pydockenv
binary fails since the script is started with /usr/bin/env sh
Currently when a port mapper is already running on a given port for an environment, if the same port is passed on another run, then an error is raised. This shouldn't happen, and the creation should be just skipped.
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.
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.
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
Reference: https://www.python.org/dev/peps/pep-0518/.
For example: pydockenv env [create,delete,list]
.
make all-<part>
:
make publish-check
git checkout -B release
make bump-<part>
make publish
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.