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', |
23 'file', | 24 'file', |
24 'recipe_engine/path', | 25 'recipe_engine/path', |
25 'recipe_engine/platform', | 26 'recipe_engine/platform', |
26 'recipe_engine/properties', | 27 'recipe_engine/properties', |
27 ] | 28 ] |
28 | 29 |
29 | 30 |
30 # See https://repo.continuum.io/miniconda/. Miniconda3 is not supported. | 31 # See https://repo.continuum.io/miniconda/. Miniconda3 is not supported. |
31 CONDA_VERSION = 'Miniconda2-3.18.3' | 32 CONDA_VERSION = 'Miniconda2-3.18.3' |
32 | 33 |
33 | 34 |
34 # These conda packages will be installed into Conda environment. | 35 # These conda packages will be installed into Conda environment. |
35 EXTRA_CONDA_PACKAGES = [ | 36 EXTRA_CONDA_PACKAGES = [ |
36 'matplotlib', | 37 'matplotlib', |
37 'numpy', | 38 'numpy', |
38 'scipy', | 39 'scipy', |
39 ] | 40 ] |
40 | 41 |
41 | 42 |
42 def RunSteps(api): | 43 def RunSteps(api): |
43 api.cipd.install_client() | 44 api.cipd.install_client() |
44 cipd_pkg_name = 'infra/conda_python/scientific/' + api.cipd.platform_suffix() | 45 cipd_pkg_name = 'infra/conda_python/scientific/' + api.cipd.platform_suffix() |
45 cipd_pkg_file = api.path['slave_build'].join('conda_python.cipd') | 46 cipd_pkg_file = api.infra_paths['slave_build'].join('conda_python.cipd') |
46 | 47 |
47 # Prepare staging directory to install conda into. | 48 # Prepare staging directory to install conda into. |
48 staging_dir = api.path['slave_build'].join('conda_staging_dir') | 49 staging_dir = api.infra_paths['slave_build'].join('conda_staging_dir') |
49 api.file.rmtree('cleaning staging dir', staging_dir) | 50 api.file.rmtree('cleaning staging dir', staging_dir) |
50 | 51 |
51 # Install miniconda and all Conda packages, package in CIPD and upload. | 52 # Install miniconda and all Conda packages, package in CIPD and upload. |
52 with api.conda.install(CONDA_VERSION, staging_dir) as conda: | 53 with api.conda.install(CONDA_VERSION, staging_dir) as conda: |
53 for pkg in EXTRA_CONDA_PACKAGES: | 54 for pkg in EXTRA_CONDA_PACKAGES: |
54 conda.install(pkg) | 55 conda.install(pkg) |
55 try: | 56 try: |
56 conda.convert_to_cipd_package(cipd_pkg_name, cipd_pkg_file) | 57 conda.convert_to_cipd_package(cipd_pkg_name, cipd_pkg_file) |
57 if api.platform.is_win: | 58 if api.platform.is_win: |
58 creds = 'C:\\creds\\service_accounts\\service-account-cipd-builder.json' | 59 creds = 'C:\\creds\\service_accounts\\service-account-cipd-builder.json' |
(...skipping 25 matching lines...) Expand all Loading... |
84 yield ( | 85 yield ( |
85 api.test('mac') + | 86 api.test('mac') + |
86 api.platform.name('mac') + | 87 api.platform.name('mac') + |
87 api.properties.generic() | 88 api.properties.generic() |
88 ) | 89 ) |
89 yield ( | 90 yield ( |
90 api.test('win') + | 91 api.test('win') + |
91 api.platform.name('win') + | 92 api.platform.name('win') + |
92 api.properties.generic() | 93 api.properties.generic() |
93 ) | 94 ) |
OLD | NEW |