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

Updates for dual compiler output mode under travis and circle #836

Merged
merged 26 commits into from Aug 14, 2018

Conversation

mariusvniekerk
Copy link
Member

@mariusvniekerk mariusvniekerk commented Jul 15, 2018

@@ -0,0 +1,27 @@
# This file was generated automatically from conda-smithy. To update this configuration,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in the upload script itself. There's no need to have 2 scripts where one calls the other.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is mostly that we need to have the jinja templates around

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the ${CONFIG} env variable?

@@ -0,0 +1,30 @@
# This file was generated automatically from conda-smithy. To update this configuration,
# update the conda-forge.yml and/or the recipe/meta.yaml.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be moved to conda-forge-ci-setup as well.

import sys

global_config = json.loads('''
{{ channels | tojson }}''')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the jinja render that that we include here. This provides the fallback for recipes that do not have the channel_targets / channel_sources in their conda_build_config files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we read .conda-forge.yml and get this value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't presently persist this anywhere. I guess we could

@scopatz
Copy link
Member

scopatz commented Jul 17, 2018

LGTM

Simplified utility script
@mariusvniekerk
Copy link
Member Author

Okay ready for another review

def make_build_number(args):
specific_config = safe_load(open(args.config_file))
build_number_inc = specific_config.get("build_number_increment", [0])[0]
rendered_recipe = subprocess.check_output(['conda', 'render', '-m', args.config_file, args.recipe_root])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when you have multiple outputs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we expect them to all share a build number? Or can that vary per output?

try:
build_number = int(rendered['build']['number'])
except KeyError:
build_number = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, clobbered file should be removed

@mariusvniekerk
Copy link
Member Author

Reworked the build number bump to deal with multiple outputs.
Presently conda-build does not have a way to clobber/append a value in the outputs section, thus we are forced to revert to basic string replacement 😢


def mangle_compiler(args):
"""Try hard to break the compilers for osx"""
# TODO
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are some good suggestions for things to do here to break compilers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically something we can do to make osx NOT have compilers that are found. Essentially this is so that we don't accidentally build with system compilers when we want to build with the Anaconda ones.

This is easy on linux since its just a docker switch

@isuruf
Copy link
Member

isuruf commented Jul 18, 2018

Reworked the build number bump to deal with multiple outputs. Presently conda-build does not have a way to clobber/append a value in the outputs section, thus we are forced to revert to basic string replacement

I don't think there are any recipes with different build numbers for different outputs. Therefore clobber file is fine, but we should make rendering of the output of conda render recipe is working for multiple outputs. Sorry for being unclear before

@mariusvniekerk
Copy link
Member Author

I did some tests and there is nothing intrinsically preventing you from having different build numbers per output. The alternative approach would be to use the conda_build.api.render method

@jakirkham
Copy link
Member

vtk uses different build numbers for different variants of packages. Not sure how MPI packages are dealt with these days.

@mariusvniekerk
Copy link
Member Author

mariusvniekerk commented Jul 19, 2018

we also use them as markers for things like blas=*=openblas. Presumably we chan check if they are int-like?

@isuruf
Copy link
Member

isuruf commented Jul 19, 2018

Those have different build numbers, but one build number per variant. Thats' fine. What I'm asking is, is there a use case where one variant (one .yaml in .ci_support) have multiple outputs with different build numbers?

@jakirkham
Copy link
Member

Mentioned those because clobbering the build number in those cases will require some finesse.

Don’t think there are that many split packages. Also can’t see a good reason for them to deviate in this way (assuming it is possible)

@isuruf
Copy link
Member

isuruf commented Jul 19, 2018

A clobber file is better because you are dealing with a rendered recipe. Regexes like what we do in the last commit is error prone.

@jakirkham
Copy link
Member

However it doesn’t seem to let us add to the build number. It simply replaces it, which doesn’t seem flexible enough. Though if someone can prove me wrong, that would be good.

@jakirkham
Copy link
Member

Should add it is worth keeping in mind this code is transient. We want it to work, but perfecting is probably not worthwhile in the long run.

@isuruf
Copy link
Member

isuruf commented Jul 19, 2018

However it doesn’t seem to let us add to the build number. It simply replaces it, which doesn’t seem flexible enough. Though if someone can prove me wrong, that would be good.

What are you suggesting here? Are you saying regex replacement is better than clobber file which changes the build number for each variant?

@mariusvniekerk
Copy link
Member Author

clobber files do not work for this case.

build: 
   number: 8

outputs:
  - name: foo
    build:
        number: 10
  - name: foo2

When rendered with a clobber file this makes the foo2 have the clobbered build number and foo not.

import argparse

global_config = json.loads('''
{{ channels | tojson }}''')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be read from the conda-forge.yml file instead of a jinja template?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After that we don't need to vendor this file in every feedstock

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that could be done. Right now we only use that for storing tokens right?


if build_number_int < 1000:
if not use_legacy_compilers:
raise ValueError("Only legacy compilers only valid with build numbers < 1000")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of erroring, can we remove new compiler configuration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will catch the situation where we want to turn on new compilers but forgot to bump the build_number.

@scopatz
Copy link
Member

scopatz commented Aug 6, 2018

Is this ready to go in now?

@mariusvniekerk mariusvniekerk changed the title Updates for dual compiler output mode under travis and circle [WIP] Updates for dual compiler output mode under travis and circle Aug 6, 2018
@mariusvniekerk
Copy link
Member Author

Nope not yet

@mariusvniekerk mariusvniekerk changed the title [WIP] Updates for dual compiler output mode under travis and circle Updates for dual compiler output mode under travis and circle Aug 13, 2018
@mariusvniekerk
Copy link
Member Author

This should be ready to go in now. Let me know if i need to squash-rebase some things down

@scopatz
Copy link
Member

scopatz commented Aug 13, 2018

@mariusvniekerk - I am not sure I understand where setup_conda_rc comes from.

@mariusvniekerk
Copy link
Member Author

@scopatz setup_conda_rc is provided by conda-forge-ci-setup=2.*

@scopatz
Copy link
Member

scopatz commented Aug 13, 2018

Oh I see. This looks good then. It simplifies the logic here a lot. I'll merge tomorrow if no-one beats me to it.

@scopatz scopatz merged commit 5ba8b1f into conda-forge:master Aug 14, 2018
@scopatz
Copy link
Member

scopatz commented Aug 14, 2018

Thanks @mariusvniekerk!

try:
config['channel_targets'] = [config['channel_targets'][0]]
except KeyError:
config['channel_targets'] = ['conda-forge main']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a / or something between these two?

try:
config['channel_sources'] = [config['channel_sources'][0]]
except KeyError:
config['channel_sources'] = ['conda-forge,defaults']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is a comma separated list within a YAML list. Should this also be a YAML list?

@jakirkham
Copy link
Member

Sorry for the very late review comments. Noticed a few really minor things during re-rendering, which are noted above.

@@ -29,6 +29,9 @@ if [ -z "$CONFIG" ]; then
exit 1
fi

pip install shyaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add this to conda-forge?

xref: conda-forge/staged-recipes#6557

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.

None yet

6 participants