Commit b058cad1 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'mamba' into 'master'

Use Mamba and Boa in the CI

Closes #80

See merge request !249
parents d001de61 7b4956cf
Pipeline #54665 passed with stages
in 16 minutes and 6 seconds
......@@ -31,8 +31,7 @@ stages:
- docker
image: quay.io/condaforge/linux-anvil-cos7-x86_64
before_script:
- rm -f ~/.condarc
- rm -rf ~/.conda
- rm -fv ~/.condarc
- python3 ./bob/devtools/bootstrap.py -vv build
- source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate base
......
......@@ -214,15 +214,15 @@ def ensure_miniconda_sh():
# WARNING: if you update this version, remember to update hashes below
# AND our "mirror" in the internal webserver
path = "https://github.com/conda-forge/miniforge/releases/download/4.10.3-6/Miniforge3-4.10.3-6-%s-x86_64.sh"
path = "https://github.com/conda-forge/miniforge/releases/download/4.10.3-6/Mambaforge-4.10.3-6-%s-x86_64.sh"
if platform.system() == "Darwin":
sha256 = (
"eabb50e2594d55eeb2a74fa05a919be876ec364e8064e1623ab096f39d6b6dd1"
"955a6255871d9b53975e1c1581910844bcf33cbca613c7dba2842f6269917da6"
)
path = path % "MacOSX"
else:
sha256 = (
"8e76a21311e4fcc9ee8497b72717b276bb960e0151c5b27816502f14bac6303f"
"c63907ba0971d2ca9a8775bd7ea48b635b2bdce4838b2f2d3a8e751876849595"
)
path = path % "Linux"
......@@ -479,7 +479,7 @@ if __name__ == "__main__":
condarc = os.path.join(args.conda_root, "condarc")
install_miniconda(args.conda_root, args.name)
conda_bin = os.path.join(args.conda_root, "bin", "conda")
conda_bin = os.path.join(args.conda_root, "bin", "mamba")
# creates the condarc file
condarc = os.path.join(args.conda_root, "condarc")
......@@ -506,7 +506,8 @@ if __name__ == "__main__":
conda_version = "4"
conda_build_version = "3"
conda_verify_version = "3"
mamba_version = "0.15"
boa_version = "0.6"
conda_verbosity = []
# if args.verbose >= 2:
......@@ -540,7 +541,8 @@ if __name__ == "__main__":
"python",
"conda=%s" % conda_version,
"conda-build=%s" % conda_build_version,
# "conda-verify=%s" % conda_verify_version,
"mamba=%s" % mamba_version,
"boa=%s" % boa_version,
"click",
"twine", # required for checking readme of python (zip) distro
]
......@@ -561,7 +563,8 @@ if __name__ == "__main__":
"python",
"conda=%s" % conda_version,
"conda-build=%s" % conda_build_version,
# "conda-verify=%s" % conda_verify_version,
"mamba=%s" % mamba_version,
"boa=%s" % boa_version,
"twine", # required for checking readme of python (zip) distro
]
+ should_install_git
......
......@@ -222,10 +222,20 @@ def get_output_path(metadata, 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):
"""Renders the recipe and returns the interpreted YAML file."""
with root_logger_protection():
# use mambabuild instead
use_mambabuild()
return conda_build.api.render(recipe_dir, config=config)
......@@ -697,6 +707,7 @@ def base_build(
# if you get to this point, just builds the package(s)
logger.info("Building %s", recipe_dir)
with root_logger_protection():
use_mambabuild()
return conda_build.api.build(recipe_dir, config=conda_config)
......
......@@ -291,10 +291,6 @@ pin_run_as_build:
# names here should not contain dots or dashes. You should replace dots and dashes with
# underlines.
# update this version to the current date when you modify the pins below
bob_devel_version:
- 2021.10.04
# AUTOMATIC PARSING START
# DO NOT MODIFY THIS COMMENT
......
......@@ -20,6 +20,7 @@ from ..build import (
next_build_number,
root_logger_protection,
should_skip_build,
use_mambabuild,
)
from ..constants import (
BASE_CONDARC,
......@@ -264,9 +265,9 @@ def build(
rendered_recipe = get_parsed_recipe(metadata)
logger.debug("Printing rendered recipe")
logger.debug("\n" + yaml.dump(rendered_recipe))
logger.debug("Finished printing rendered recipe")
logger.info("Printing rendered recipe")
logger.info("\n" + yaml.dump(rendered_recipe))
logger.info("Finished printing rendered recipe")
path = get_output_path(metadata, conda_config)[0]
# gets the next build number
......@@ -288,6 +289,7 @@ def build(
# get it right
set_environment("BOB_BUILD_NUMBER", str(build_number))
with root_logger_protection():
use_mambabuild()
paths = conda_build.api.build(
d, config=conda_config, notest=no_test
)
......
......@@ -204,6 +204,7 @@ def create(
this app and use the flag `--overwrite` to re-create from scratch the
development environment.
"""
import pathlib
recipe_dir = recipe_dir or os.path.join(os.path.realpath("."), "conda")
......@@ -211,7 +212,9 @@ def create(
raise RuntimeError("The directory %s does not exist" % recipe_dir)
# this is not used to conda-build, just to create the final environment
conda = os.environ.get("CONDA_EXE")
conda = pathlib.Path(os.environ.get("CONDA_EXE"))
# replace conda with mamba
conda = str(conda.parent / "mamba")
if conda is None:
raise RuntimeError(
"Cannot find `conda' executable (${CONDA_EXEC}) - "
......
......@@ -33,7 +33,8 @@ requirements:
- click-plugins
- conda=4
- conda-build=3
# - conda-verify=3
- mamba=0.15
- boa=0.6
- certifi
- docformatter
- git # [linux]
......
{% set version = datetime.datetime.utcnow().strftime('%Y%m%d.%H.%M.%S') %}
package:
name: bob-devel
version: {{ bob_devel_version }}
version: {{ version }}
build:
number: 0
......
......@@ -459,15 +459,7 @@ you should perform some extra steps:
[your dependecy here]
2. In the file ``bob.devtools/bob/devtools/data/conda_buid_config.yaml``,
update the version of ``bob-devel`` with the current date, in the format preset.
.. code-block:: yaml
bob_devel_version:
- 2021.09.14 <-- HERE
3. Submit a merge request with your changes.
2. Submit a merge request with your changes.
Updating a dependency version
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment