summaryrefslogtreecommitdiff
path: root/clusters/mason-system-x86_64-openstack-deploy.morph
blob: 6bdb1cbbc8358011fcdb4af22dc205a7f7846c0b (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: mason-system-x86_64-openstack-deploy
kind: cluster
description: |
  An example cluster morphology demonstrating how to deploy a Mason
  instance into an OpenStack Cloud.

  Mason consists of a distbuild system and Zuul/turbo-hipster to run
  tests. In the future, we should make it possible to deploy a Mason
  instance which uses an existing distbuild network for builds,
  rather than setting up its own.

  The Mason configure extension takes a whole load of parameters:

    * TROVE_ID: the same as for distbuild, this is the short ID of
      your upstream Trove.
    * TROVE_HOST: the same as for distbuild, this is the FQDN or
      IP address of your upstream Trove.
    * ARTIFACT_CACHE_SERVER: this is the FQDN or IP address of the
      artifact cache you wish to use - normally the same as
      TROVE_HOST.

    * GERRIT_USER: the username of the Gerrit account Zuul should
      use to look for and report on changes.
    * GERRIT_HOSTNAME: the FQDN or IP address of the Gerrit instance
      to be used.
    * GERRIT_HTTP_PORT: the port used to access the HTTP frontend of
      Gerrit - normally 8080.
    * GERRIT_GIT_PORT: the port used to access Gerrit's git interface
      (and via SSH) - normally 29418.
    * GERRIT_SSH_KEY: the location of the SSH key to be added to the
      system for use when accessing Gerrit. If this is not the same
      WORKER_SSH_KEY then GERRIT_SSH_KEY_PATH should *not* be
      "/root/.ssh/id_rsa"
    * GERRIT_SSH_KEY_PATH: the location to put the SSH key for Gerrit
      in the system. Normally, "/root/.ssh/id_rsa" is sufficient,
      unless WORKER_SSH_KEY and GERRIT_SSH_KEY are not the same.

    * GEARMAN_HOST: the FQDN or IP address of the Gearman server. If
      START_GEARMAN is yes, then this should be 127.0.0.1
    * GEARMAN_PORT: the port used for accessing the Gearman server.
      This is normally 4730.
    * START_GEARMAN: yes or no. If yes, then a Gearman server is run
      on the Mason instance by Zuul.

    * MASON_ARCHITECTURE: this is currently used to determine which
      artifacts need to be uploaded. Artifacts from systems in
      MASON_CLUSTER_MORPHOLOGY with arch: MASON_ARCHITECTURE are
      uploaded.
    * MASON_CLUSTER_MORPHOLOGY: this is the cluster morphology which
      contains the systems to be tested.
    * MASON_DISTBUILD_CONTROLLERS: this is a comma separated list of
      pairs of the form "architecture:ip" which defines the distbuild
      networks available for Mason. It is not used by the tests at
      the moment however.
    * MASON_TEST_HOSTS: this is a comma separated list of pairs of the
      form "architecture:user@url" which defines the places to deploy
      test systems to. If MASON_TEST_INFRASTRUCTURE_TYPE is "openstack"
      then use your OpenStack auth URL.
    * MASON_TEST_INFRASTRUCTURE_TYPE: this can be 'kvm' or 'openstack',
      depending on if you are deploying your test instances to a kvm
      host or an OpenStack cloud.
    * MASON_UPSTREAM_TROVE: this is the Trove to which artifacts are
      uploaded on success by Mason.

The following are only required if MASON_TEST_INFRASTRUCTURE_TYPE is
openstack:

    * MASON_OPENSTACK_AUTH_URL: the auth url of the OpenStack instance
      test systems are deployed to.
    * MASON_OPENSTACK_NETWORK_ID: the network ID that test systems will
      be connected to.
    * MASON_OPENSTACK_USER: the username used by Mason to deploy test
      systems with Glance.
    * MASON_OPENSTACK_TENANT: the tenancy to deploy test systems in.
    * MASON_OPENSTACK_TENANT_ID: the ID of the above tenancy. We
      probably don't actually need this, but whilst we expect it to
      be here you should use the real value. Using the wrong value
      will cause Mason to fail to deploy test instances.
    * MASON_OPENSTACK_PASSWORD: the password of the Mason user on
      OpenStack. Note that this will be stored in plaintext on the
      Mason instance. Perhaps pass this via the command line?

It is possible to deploy a generic Mason which you can then boot
and give configuration to at a later date:

    MASON_GENERIC: yes

To configure a generic Mason, add a YAML file containing all the required
variables in the form at /etc/mason/mason.conf:

    VARIABLE: value
    VARIABLE: value
    ...       ...

However, you will still need to provide ARTIFACT_CACHE_SERVER,
TROVE_ID and TROVE_HOST as they are also used by distbuild.configure.


systems:
- morph: systems/mason-system-x86_64-generic.morph
  deploy-defaults:
    # The following are all needed for extensions other than mason.configure
    ARTIFACT_CACHE_SERVER: cache.baserock.org
    CONTROLLERHOST: mason-system-x86-64
    DISTBUILD_CONTROLLER: true
    DISTBUILD_WORKER: true
    RAM_SIZE: 8G
    DISK_SIZE: 4G
    VCPUS: 2
    TROVE_HOST: git.baserock.org
    TROVE_ID: baserock
    WORKERS: mason-system-x86-64
    WORKER_SSH_KEY: ssh-keys/worker.key
    HOSTNAME: mason-system-x86-64
    CLOUD_INIT: yes
    KERNEL_ARGS: console=ttyS0 console=tty0
    INSTALL_FILES: distbuild/manifest
    # It could be worthwhile setting these in your environment instead of here
    OPENSTACK_AUTH_URL: auth-url
    OPENSTACK_IMAGENAME: mason-system-x86_64
    OPENSTACK_NETWORK_ID: network-id
    OPENSTACK_USER: openstack-username
    OPENSTACK_TENANT: openstack-tenant
    OPENSTACK_TENANT_ID: tenant-id
  deploy:
      mason:
          type: openstack
          location: auth-url
          MASON_OPENSTACK_AUTH_URL: auth-url
          MASON_OPENSTACK_NETWORK_ID: network-id
          MASON_OPENSTACK_USER: mason
          MASON_OPENSTACK_TENANT: mason-tenant
          MASON_OPENSTACK_TENANT_ID: mason-tenant-id
          GERRIT_USER: mason
          GERRIT_HOSTNAME: gerrit.example.com
          GERRIT_HTTP_PORT: 8080
          GERRIT_GIT_PORT: 29418
          GERRIT_SSH_KEY: ssh-keys/worker.key
          GERRIT_SSH_KEY_PATH: /root/.ssh/id_rsa
          GEARMAN_HOST: 127.0.0.1
          GEARMAN_PORT: 4730
          START_GEARMAN: yes
          MASON_CLUSTER_MORPHOLOGY: clusters/ci.morph
          MASON_ARCHITECTURE: x86_64
          MASON_TEST_HOSTS: "x86_64:user@auth-url"
          MASON_DISTBUILD_CONTROLLERS: "x86_64:not-yet-used"
          MASON_TEST_INFRASTRUCTURE_TYPE: openstack
          MASON_UPSTREAM_TROVE: some-writeable-artifact-cache