Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker images don't pick up full version(eer) numbers #76

Closed
dbkeitel opened this issue Jul 3, 2020 · 3 comments
Closed

docker images don't pick up full version(eer) numbers #76

dbkeitel opened this issue Jul 3, 2020 · 3 comments
Assignees
Labels
docker images/containers

Comments

@dbkeitel
Copy link
Collaborator

dbkeitel commented Jul 3, 2020

To be looked at next week, just so it doesn't get forgotten:

Inside a pyfstat:latest docker container one gets pyfstat._version_ as something like 0+untagged.1.c7bc7fc6.clean whereas directly from source it should be v1.3+190.c7bc7fc6.clean. So it gets the right git hash, but doesn't get the latest previous tag (first bit) and the second bit where versioneer counts the number of commits since. ("bits" here always meaning entries of version.split("."))

Probably this is versioneer trying to dynamically figure out the first two bits while running in the container, but not having access to the git. Maybe we'd need to teach the dockerfile to make a fake tag that matches the expected parts, and then hard-write it into the image, and/or teach versioneer to notice it's in a container and do things differently. To be investigated further.

@dbkeitel dbkeitel added the docker images/containers label Jul 3, 2020
@Rodrigo-Tenorio
Copy link
Collaborator

Rodrigo-Tenorio commented Jul 6, 2020

@dbkeitel

It seems to be a known issue. I found this example from git.ligo and this git-hub issue where a solution seems to be explained and implemented, somehow.

versioneer seems to be unable to pick version information from wheels (compiled python packages...?), so they build the source distribution first (which is understood by versioneer) and then the wheel.

This is kind of alien to me right now (0% experience working with wheel/source distributions; so far running pip install did the trick), but it looks like we should do that inside the Dockerfile instead of directly running pip install .?

@dbkeitel
Copy link
Collaborator Author

dbkeitel commented Jul 6, 2020

Yes I also read it this way: the key from Leo's fix seems to be to build a "sdist" first, then build both the binary "wheels" and the docker image after that, in the same job. That also seems to match what the other discussion implies.

No idea if this will be a possible workaround path for docker-only jobs, but yes, building a distribution before installing should be possible there too. Feel free to try it if you have an idea how to start; I hope it's as easy as following Leo's logic in the github-instead-of-gitlab yml flavour. Otherwise you can wait for me to try setting up the pypi uploads first and then maybe a combined job can be constructed.

@Rodrigo-Tenorio
Copy link
Collaborator

Rodrigo-Tenorio commented Jul 6, 2020

actions/checkout@v2 only fetches the last commit. If we want the whole history, we need to add the following option to the action:

- uses: actions/checkout@v2
  with:
    fetch-depth: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker images/containers
Projects
None yet
Development

No branches or pull requests

2 participants