OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Recipe to build CIPD package with sealed Conda environment. | 5 """Recipe to build CIPD package with sealed Conda environment. |
6 | 6 |
7 Supposed to be used from manually triggered Buildbot builders. We aren't | 7 Supposed to be used from manually triggered Buildbot builders. We aren't |
8 expecting rebuilding this environment often, so setting up and periodic schedule | 8 expecting rebuilding this environment often, so setting up and periodic schedule |
9 is a waste of resources. | 9 is a waste of resources. |
10 | 10 |
11 To build a new package for all platforms: | 11 To build a new package for all platforms: |
12 1. Manually trigger all builders by clicking buttons in Buildbot. | 12 1. Manually trigger all builders by clicking buttons in Buildbot. |
13 2. Once they all complete, tag the with some release identifier by running: | 13 2. Once they all complete, tag the with some release identifier by running: |
14 ./cipd set-tag infra/conda_python/scientific/ \ | 14 ./cipd set-tag infra/conda_python/scientific/ \ |
15 -tag=release:<name> \ | 15 -tag=release:<name> \ |
16 -version=latest | 16 -version=latest |
17 3. Update Puppet configs to use 'release:<name>' as a version. | 17 3. Update Puppet configs to use 'release:<name>' as a version. |
18 """ | 18 """ |
19 | 19 |
20 DEPS = [ | 20 DEPS = [ |
21 'cipd', | 21 'cipd', |
22 'conda', | 22 'conda', |
23 'depot_tools/infra_paths', | |
24 'file', | 23 'file', |
25 'recipe_engine/path', | 24 'recipe_engine/path', |
26 'recipe_engine/platform', | 25 'recipe_engine/platform', |
27 'recipe_engine/properties', | 26 'recipe_engine/properties', |
28 ] | 27 ] |
29 | 28 |
30 | 29 |
31 # See https://repo.continuum.io/miniconda/. Miniconda3 is not supported. | 30 # See https://repo.continuum.io/miniconda/. Miniconda3 is not supported. |
32 CONDA_VERSION = 'Miniconda2-3.18.3' | 31 CONDA_VERSION = 'Miniconda2-3.18.3' |
33 | 32 |
34 | 33 |
35 # These conda packages will be installed into Conda environment. | 34 # These conda packages will be installed into Conda environment. |
36 EXTRA_CONDA_PACKAGES = [ | 35 EXTRA_CONDA_PACKAGES = [ |
37 'matplotlib', | 36 'matplotlib', |
38 'numpy', | 37 'numpy', |
39 'scipy', | 38 'scipy', |
40 ] | 39 ] |
41 | 40 |
42 | 41 |
43 def RunSteps(api): | 42 def RunSteps(api): |
44 api.cipd.install_client() | 43 api.cipd.install_client() |
45 cipd_pkg_name = 'infra/conda_python/scientific/' + api.cipd.platform_suffix() | 44 cipd_pkg_name = 'infra/conda_python/scientific/' + api.cipd.platform_suffix() |
46 cipd_pkg_file = api.infra_paths['slave_build'].join('conda_python.cipd') | 45 cipd_pkg_file = api.path['slave_build'].join('conda_python.cipd') |
47 | 46 |
48 # Prepare staging directory to install conda into. | 47 # Prepare staging directory to install conda into. |
49 staging_dir = api.infra_paths['slave_build'].join('conda_staging_dir') | 48 staging_dir = api.path['slave_build'].join('conda_staging_dir') |
50 api.file.rmtree('cleaning staging dir', staging_dir) | 49 api.file.rmtree('cleaning staging dir', staging_dir) |
51 | 50 |
52 # Install miniconda and all Conda packages, package in CIPD and upload. | 51 # Install miniconda and all Conda packages, package in CIPD and upload. |
53 with api.conda.install(CONDA_VERSION, staging_dir) as conda: | 52 with api.conda.install(CONDA_VERSION, staging_dir) as conda: |
54 for pkg in EXTRA_CONDA_PACKAGES: | 53 for pkg in EXTRA_CONDA_PACKAGES: |
55 conda.install(pkg) | 54 conda.install(pkg) |
56 try: | 55 try: |
57 conda.convert_to_cipd_package(cipd_pkg_name, cipd_pkg_file) | 56 conda.convert_to_cipd_package(cipd_pkg_name, cipd_pkg_file) |
58 if api.platform.is_win: | 57 if api.platform.is_win: |
59 creds = 'C:\\creds\\service_accounts\\service-account-cipd-builder.json' | 58 creds = 'C:\\creds\\service_accounts\\service-account-cipd-builder.json' |
(...skipping 25 matching lines...) Expand all Loading... |
85 yield ( | 84 yield ( |
86 api.test('mac') + | 85 api.test('mac') + |
87 api.platform.name('mac') + | 86 api.platform.name('mac') + |
88 api.properties.generic() | 87 api.properties.generic() |
89 ) | 88 ) |
90 yield ( | 89 yield ( |
91 api.test('win') + | 90 api.test('win') + |
92 api.platform.name('win') + | 91 api.platform.name('win') + |
93 api.properties.generic() | 92 api.properties.generic() |
94 ) | 93 ) |
OLD | NEW |