Skip to content

Conversation

@aanand
Copy link

@aanand aanand commented Apr 8, 2015

Using unstable versions of docker-py (for label support) and requests, because docker-py requires a newer version but this fix hasn't landed yet.

Sadly, even after that fix, the binary still isn't working:

+ dist/docker-compose-Linux-x86_64 --version
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/code/build/docker-compose/out00-PYZ.pyz/compose", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
    exec(bytecode, module.__dict__)
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 11, in <module>
ImportError: No module named docker.errors

Might be another weird requests/pyinstaller bug - going to see if I can produce a minimal failing test case outside of Compose.

@aanand
Copy link
Author

aanand commented Apr 8, 2015

Plot thickens: the binary builds fine on Jenkins. Sigh. Can anyone else successfully run script/build-linux locally on this branch?

@funkyfuture
Copy link

nope, unfortunately the build fails like yours.

@aanand aanand added this to the 1.3.0 milestone Apr 24, 2015
@aanand
Copy link
Author

aanand commented Apr 24, 2015

Have upgraded to requests==2.6.1, but I'm still getting the same error locally.

@funkyfuture Thanks for checking. Could you try once more with the current commit?

@aanm
Copy link

aanm commented Apr 24, 2015

[aanm@localhost compose]$ sudo script/build-linux
...
Step 14 : ENTRYPOINT /usr/local/bin/docker-compose
 ---> Running in ebbc535559d6
 ---> 9826101aa1ad
Removing intermediate container ebbc535559d6
Successfully built 9826101aa1ad
++ pwd
+ docker run --rm --user=user --volume=/home/aanm/git-repos/go/src/github.com/noironetworks/compose:/code --entrypoint=script/build-linux-inner docker-compose
++ pwd
+ mkdir -p /code/dist
++ pwd
+ chmod 777 /code/dist
chmod: changing permissions of `/code/dist': Operation not permitted

Maybe it's my fault but the /code/dist was not created inside the compose directory.

@funkyfuture
Copy link

@aanand sorry, same here. tests are passing though.

fun fact: i was just noting down this pr as a predicate for another project.

@funkyfuture
Copy link

@aanm this doesn't happen on my box.

@dnephin
Copy link

dnephin commented Apr 24, 2015

I wonder if it would be easier to start looking at alternatives to pyinstaller. We've hit a few problems with it (py3 support, six version conflict, and now requests version conflict). In #1051 (comment) I mentioned http://docs.python-guide.org/en/latest/shipping/freezing/ which seems to have a bunch of options for doing this.

@funkyfuture
Copy link

@dnephin the comparison table looks like cx_freeze is the only one beside PyInstaller that supports Linux, OS X, Windows and Python 3.

and propably this isn't suitable as it can't link into one executable binary for Windows.

@aanand
Copy link
Author

aanand commented Apr 27, 2015

I can reproduce the problem outside Compose by trying to build a binary with just import docker in it, and installing docker-py from a Git URL (even if it's the commit for a stable, released version). Using docker-py==1.1.0 fixes it (but obviously the code doesn't work / tests don't pass at that point, because there's no labels support in docker-py 1.1.0).

The easiest way to fix this right now - so that this and #1356 can be merged with confidence - might be to just get a docker-py release out with labels support, so we don't have to rely on Git URLs.

@shin-: any thoughts on that?

@funkyfuture
Copy link

what about bundling the docker-py-code for the time being?

@aanand
Copy link
Author

aanand commented Apr 27, 2015

re-reads #375 for old times' sake

laugh_crying_kristen_bell

@shin-
Copy link

shin- commented Apr 27, 2015

docker-py 1.2.0 is in the works, there's only a few things left which I've listed here: https://github.com/docker/docker-py/milestones/1.2.0

Sorry, I realize it's long overdue!

@aanand aanand force-pushed the labels branch 3 times, most recently from ad9771e to bd59ea1 Compare April 28, 2015 10:40
@aanand aanand mentioned this pull request Apr 29, 2015
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@aanand aanand changed the title WIP: Implement 'labels' option Implement 'labels' option Apr 29, 2015
@aanand
Copy link
Author

aanand commented Apr 29, 2015

Thanks! This is ready to go now.

ping @bfirsh @dnephin

@dnephin
Copy link

dnephin commented May 1, 2015

LGTM!

dnephin added a commit that referenced this pull request May 1, 2015
Implement 'labels' option
@dnephin dnephin merged commit 6c95eed into docker:master May 1, 2015
@thaJeztah
Copy link
Member

Awesome! docker-archive/classicswarm#673

@aanand
Copy link
Author

aanand commented May 1, 2015

@thaJeztah Nice.

@aanand aanand deleted the labels branch May 1, 2015 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants