-
Notifications
You must be signed in to change notification settings - Fork 9
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
Start conversion to Conda Build 3 #154
Conversation
This PR converts the `conda-build-all` script to be compatible with Conda Build 3 and Conda 4.4, using the API as much as I can. Its imperfect due to the imperfect API, but I think I managed to get what we need without high-maintenance work arounds. In theory, this should make the conda-build all script much more stable and we can switch back to using the `conda-forge` docker image as a base after some iterations We've kicked this can down the road about as far as it can go at this point so I think its time to implement a proper fix. All existing functionality should remain unchanged from how the script is used and invoked. Complete list of everything I tweaked: * Simplify imports to minimal set * Import only from the Conda(-build) API when possible * Added docstrings everywhere * Use metapackage functions directly instead of reading from various metapackage dicts * Reduce calls to the CLI directly where possible, replacing with API * Convert previous multi-python multi-numpy build-mixing to Conda Build 3 Variant system * Variants compiled from command line, still supports `--python` and `--numpy` * Build enumeration automatically checks for duplications * Still uses old package string styles instead of hashed dependencies for checking if package already on Anaconda (Will need to convert at some point) * Adds ability to check if package is already built locally, and can be overridden with `--rebuild` * Preserved checking against specific channels, both at command line and meta.yaml level * Package building handled by API instead of CLI * Functions more generalized to allow importing the conda-build-all script if need be * Switched all print statements to the Python 3 `.format()` mini-language over `%` formatting * Minimized amount of excess data passed between functions, handled mostly by Metadata now * Added ability for built and uploaded tarballs to be removed to save build space (e.g. Travis-CI) through the `-c` or `--clean` command line arg. This is False by default (related: omnia-md/conda-recipes#877) * Unpinned the conda and conda-build versions from the scripts. Will need to make changes to the Docker Image though Related issues: omnia-md/conda-recipes#799 Potentially resolved issues from these changes: * omnia-md/conda-recipes#712 * omnia-md/conda-recipes#403 (not likely, but something to consider)
I have also tried to add comments everywhere I can so other devs can follow what the script is doing and its easier to maintain later. If something is unclear, please comment on it so I can clean that up! |
@andrizzi and @pgrinaway: Can you help with reviewing this too? |
@Lnaden: Thanks so much for digging in and tackling this! |
As part of the re-work of the docker images. Do we want to tag the ones which are Conda-forge based I'm also working on a possible solution to the travis proliferation. For the Idea for the how this would work:
For example, if I am building base_variants = {
'python': ['2.7', '3.5', '3.6', '3.7'],
'numpy': ['1.09'],
'CUDA_SHORT_VERSION': ['75', '90']
} The full variant proliferation would result in 16 builds (2 packages * 2 CUDA versions * 4 pythons = 16),
We will very easily run out of time on the Travis builds, but we can just re-trigger them over and over and get the builds done, but that way we will only have 3-4 builds instead of >10 if we have one build for each cuda and python, with many possible duplications if builds which dont depend on cuda get built on multiple cuda travis builds for the same python version. Thoughts? |
Let's NOT replace the existing ones! They're working now, and if we start replacing them and end up with a broken build system, we're screwed. |
That is what I figured. So I can make new tags if my testing bears out. Does the |
@Lnaden : It would be great if we could use the Since we last checked, there are now more |
I had been working on that first also, see: omnia-md/omnia-linux-anvil#12. |
This might suddenly be becoming much more urgent given the upcoming conda-build migration: |
@Lnaden : Just checking in on this again! |
Fix clashes Fix Travis Time to try!
@jchodera Okay... I think I got everything added finally and this is ready to see if it works.
I imagine there will be some failures here, but I think this is almost ready finally. If this works here, we c cc @peastman and @andrrizzi |
I went through it quickly, but it looks good to me! It looks like there's a problem with the build in Travis though. Not sure if it's expected. |
@Lnaden : It looks like the
The error seems to suggest that the way that the github package is unpacked is different with this newer version of I'll add some debug info to see if we can figure out what is going on. |
@Lnaden : Whoops, you're not working in a branch on this repo, so I can't debug your PR. Can you poke around a bit, or upload your changes as a branch in this repo if you'd like some help debugging? |
I'm looking into it |
The issue comes with the work directory getting shuffled in the process since I invoke conda build twice through the API, and me not quite correctly handling all the variants. The block of code controlling this behavior is here, and I can almost work around it though the I'm still digging into it. |
Thanks for tackling this, @Lnaden! |
@Lnaden : Looks like we'll need to bite the bullet and make this transition soon. Any thoughts on what we can do to move forward here? |
My local tests have about 1 last issue where the variants either all build and fail together for a package (e.g. py 27,36,37 ), or their work directories clash/don't exist if I try to build them separate. Give me some time over the next couple days, I'll let you know by Thursday mid-day where things stand |
I haven't yet had a chance to delve too deeply into
|
No, that fell by the wayside with Conda Build 3 being released
That is what I am trying to do, use conda-build itself as much as possible. And the problem I am running into is using the mechanic means either all of the variants for a package pass, or they all fail.
I have not looked too much into this tool to get a good sense of if it would be helpful. |
After a bunch of shenanigans later, I think its finally ready
I think I finally have all the features in, replicating most of the existing behavior and our build style while using as much of the API as I can. Lets see if the tests pass |
Looks like the docker image is either missing CUDA or the CUDA libraries are in a different location and we have to update the paths: |
I had to tweak the images and the CUDA lib pointer, but its building locally |
The Linux builds are passing, brew is giving me issues, but progress! |
I think I'll need to do some fiddling with the |
This passes linux tests for the most part. There are some changes which would likely need to be made with respect to the CI configs to be more optimal, but I think this will get us onto conda build 3 finally. The Travis OSX image is having issues, and the AppVeyor images are having argument issues, but the conda-build items appear to be resolved |
@Lnaden: Thanks so much for this! If you want to open a PR into a branch of |
This is about to be replaced so I am closing this. |
This PR converts the
conda-build-all
script to be compatible withConda Build 3 and Conda 4.4, using the API as much as I can. Its
imperfect due to the imperfect API, but I think I managed to get what
we need without high-maintenance work arounds.
In theory, this should make the conda-build-all script much more stable
and we can switch back to using the
conda-forge
docker image as abase after some iterations. I've basically rebuilt the script from scratch, salvaging what I could.
We've kicked this can down the road about as far as it can go at this
point so I think its time to implement a proper fix.
All existing functionality should remain unchanged from how the script
is used and invoked.
Complete list of everything I tweaked:
--python
and--numpy
--rebuild
.format()
mini-language over%
formatting-c
or--clean
command line arg. This is False by default (related: [fahmunge] 0.3.0 conda-recipes#877)Related issues: omnia-md/conda-recipes#799
Potentially resolved issues from these changes: