summaryrefslogtreecommitdiff
path: root/compute/compute_configs.py
blob: fece3b521d9a89fcdce6b473f5ba229f9cb5ebac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""This module contains Google Compute Engine configurations."""

from __future__ import print_function

from chromite.cbuildbot import config_lib


# Metadata keys to tag our GCE artifacts with.
METADATA_IMAGE_NAME = 'cros-image'

PROJECT = 'chromeos-bot'
DEFAULT_BASE_IMAGE = 'ubuntu-14-04-server-v20150324'
DEFAULT_IMAGE_NAME = 'chromeos-bot-v5'
DEFAULT_ZONE = 'us-east1-a'
DEFAULT_MACHINE_TYPE_16 = 'n1-highmem-16'
DEFAULT_SCOPES = ('https://www.googleapis.com/auth/devstorage.full_control',
                  'https://www.googleapis.com/auth/gerritcodereview')

# TODO: We do not archive the official images to Google Storage yet
# because the imaging creating process for this path does not allow
# the rootfs to be larger than 10GB.
GS_IMAGE_ARCHIVE_BASE_URL = ('%s/gce-images' %
                             config_lib.GetConfig().params.ARCHIVE_URL)
IMAGE_SUFFIX = '.tar.gz'

BOOT_DISK = '/dev/sda'
# TODO: Automatically detects the partitions.
DRIVES = ('sda1',)


configs = {}

configs['image-creation'] = dict(
    zone=DEFAULT_ZONE,
    scopes=DEFAULT_SCOPES,
)
IMAGE_CREATION_CONFIG = configs['image-creation']

# The default config for Chrome OS builders.
configs['cros-bot'] = dict(
    machine_type=DEFAULT_MACHINE_TYPE_16,
    zone=DEFAULT_ZONE,
    image=DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
)

# The default config for Chrome OS PreCQ builders.
configs['cros-precq-bot'] = dict(
    machine_type=DEFAULT_MACHINE_TYPE_16,
    zone=DEFAULT_ZONE,
    image=DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
)

# A light-weight config for light jobs, like boardless masters.
configs['cros-master'] = dict(
    machine_type='n1-standard-8',
    zone=DEFAULT_ZONE,
    image=DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
)

# A wimpy config for testing purposes.
configs['cros-test'] = dict(
    machine_type='n1-standard-1',
    zone=DEFAULT_ZONE,
    image=DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
)

# Config to use to launch an instance with the image created for the purposes of
# testing changes to cros_compute.
configs['cros-bot-testing'] = dict(
    machine_type=DEFAULT_MACHINE_TYPE_16,
    zone=DEFAULT_ZONE,
    image='%s-testing' % DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
)

# Same as cros-bot, but launch in the staging network.
configs['cros-bot-staging'] = dict(
    machine_type=DEFAULT_MACHINE_TYPE_16,
    zone=DEFAULT_ZONE,
    image=DEFAULT_IMAGE_NAME,
    scopes=DEFAULT_SCOPES,
    network='staging-network',
)