Skip to content
Snippets Groups Projects
Commit 0a40ce39 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[build] use mambabuild instead of conda-build

parent ad19e9c7
No related branches found
No related tags found
1 merge request!249Use Mamba and Boa in the CI
Pipeline #54652 failed
...@@ -222,10 +222,20 @@ def get_output_path(metadata, config): ...@@ -222,10 +222,20 @@ def get_output_path(metadata, config):
return conda_build.api.get_output_file_paths(metadata, config=config) return conda_build.api.get_output_file_paths(metadata, config=config)
def use_mambabuild():
"""Will inject mamba solver to conda build API to speed up resolves"""
# only importing this module will do the job.
from boa.cli.mambabuild import prepare
prepare()
def get_rendered_metadata(recipe_dir, config): def get_rendered_metadata(recipe_dir, config):
"""Renders the recipe and returns the interpreted YAML file.""" """Renders the recipe and returns the interpreted YAML file."""
with root_logger_protection(): with root_logger_protection():
# use mambabuild instead
use_mambabuild()
return conda_build.api.render(recipe_dir, config=config) return conda_build.api.render(recipe_dir, config=config)
...@@ -697,6 +707,7 @@ def base_build( ...@@ -697,6 +707,7 @@ def base_build(
# if you get to this point, just builds the package(s) # if you get to this point, just builds the package(s)
logger.info("Building %s", recipe_dir) logger.info("Building %s", recipe_dir)
with root_logger_protection(): with root_logger_protection():
use_mambabuild()
return conda_build.api.build(recipe_dir, config=conda_config) return conda_build.api.build(recipe_dir, config=conda_config)
......
...@@ -20,6 +20,7 @@ from ..build import ( ...@@ -20,6 +20,7 @@ from ..build import (
next_build_number, next_build_number,
root_logger_protection, root_logger_protection,
should_skip_build, should_skip_build,
use_mambabuild,
) )
from ..constants import ( from ..constants import (
BASE_CONDARC, BASE_CONDARC,
...@@ -264,9 +265,9 @@ def build( ...@@ -264,9 +265,9 @@ def build(
rendered_recipe = get_parsed_recipe(metadata) rendered_recipe = get_parsed_recipe(metadata)
logger.debug("Printing rendered recipe") logger.info("Printing rendered recipe")
logger.debug("\n" + yaml.dump(rendered_recipe)) logger.info("\n" + yaml.dump(rendered_recipe))
logger.debug("Finished printing rendered recipe") logger.info("Finished printing rendered recipe")
path = get_output_path(metadata, conda_config)[0] path = get_output_path(metadata, conda_config)[0]
# gets the next build number # gets the next build number
...@@ -288,6 +289,7 @@ def build( ...@@ -288,6 +289,7 @@ def build(
# get it right # get it right
set_environment("BOB_BUILD_NUMBER", str(build_number)) set_environment("BOB_BUILD_NUMBER", str(build_number))
with root_logger_protection(): with root_logger_protection():
use_mambabuild()
paths = conda_build.api.build( paths = conda_build.api.build(
d, config=conda_config, notest=no_test d, config=conda_config, notest=no_test
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment