aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
blob: 91dc6d250b39dba8e8756f723c720334d70d4c69 (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
# General Coding Style

## Code

Abide by [PEP-8] for general code. Some particular points to note:

* Wrap code at 79 characters.
* Use only spaces - no tabs.
* Use implicit string concatenation where possible. Don't use the escape
  character unless absolutely necessary.
* Be liberal in your use of whitespace to group related statements together.
  However, don't leave a space after the docstring and the first statement.
* Use single quotes for all string literals.

## Documentation

Follow [PEP-257] and the [Sphinx guidelines] for documentation. In particular:

* Wrap docstrings at 72 characters.
* Use double-quotes for all docstrings.
* Write all inline comments in lower-case, except where using a name/initialism.
* Document **all** library functions/classes completely. Tests, however, only need a test case docstring.

To summarise the docstring conventions:

```python
def my_function(athing, stuff=5):
   """
   Summary line here in imperative tense.

   Longer description here...

   :param athing: Details about this paramter here
   :param stuff: Ditto

   :returns: None
   """
   pass  # code here...
```

### Validation

All code should be checked with the PyLint linter and PEP8 style guide checker.
Pylint can be run like so:

```bash
pylint <file or directory>
```

Most PyLint errors should be resolved. You will need to do this manually.
However, there are cases where they may not make sense (e.g. you **need** to
pass `N` parameters to a function). In this case, disable the relevant
case using an inline `disable` like so:

```python
# pylint: disable=[code]
```

On the other hand, all PEP8 errors should be resolved.

---

[PEP-8]: http://legacy.python.org/dev/peps/pep-0008/
[PEP-257]: http://legacy.python.org/dev/peps/pep-0257/
[Sphinx guidelines]: https://pythonhosted.org/an_example_pypi_project/sphinx.html
the number of bare metal nodes you have, either by deleting # excess BaremetalNode definitions (if there are too many), or by copying and # pasting the last BaremetalNode in the file until you have the correct number # of baremetal nodes (if there are too few). # # Then in each file, address all additional NEWSITE-CHANGEME markers to update # the data in these files with the right values for your new site. # # *NOTE: The Genesis node is counted as one of the control plane nodes. Note # that the Genesis node does not appear on this bare metal list, because the # procedure to reprovision the Genesis host with MaaS has not yet been # implemented. Therefore there will be only two bare metal nodes in this file # with the 'masters' tag, as the genesis roles are assigned in a different # place (type/cntt/profiles/genesis.yaml). # schema: 'drydock/BaremetalNode/v1' metadata: schema: 'metadata/Document/v1' # NEWSITE-CHANGEME: Replace with the hostname of the first node in the rack, # after (excluding) genesis. name: pod15-node2 layeringDefinition: abstract: false layer: site storagePolicy: cleartext data: # NEWSITE-CHANGEME: The IPv4 address assigned to each logical network on this # node. In the reference Airship deployment, this is all logical Networks defined # in networks/physical/networks.yaml. IP addresses are manually assigned, by-hand. # (what could possibly go wrong!) The instructions differ for each logical # network, which are laid out below. addressing: # The iDrac/iLo IP of the node. It's important that this match up with the # node's hostname above, so that the rack number and node position encoded # in the hostname are accurate and matching the node that IPMI operations # will be performed against (for poweron, poweroff, PXE boot to wipe disk or # reconfigure identity, etc - very important to get right for these reasons). # These addresses should already be assigned to nodes racked and stacked in # the environment; these are not addresses which MaaS assigns. - network: oob address: 10.10.150.12 # The IP of the node on the DMZ network. Refer to the static IP range # defined for the Admin network in networks/physical/networks.yaml. - network: dmz address: 10.10.150.22 # The IP of the node on the Admin network. Refer to the static IP range # defined for the Admin network in networks/physical/networks.yaml. # This network is used for PXE bootstrapping of the bare-metal servers. - network: admin address: 10.10.151.22 # The IP of the node on the Private network. Refer to the static IP range # defined for the Private network in networks/physical/networks.yaml. - network: private address: 10.10.152.22 # The IP of the node on the Storage network. Refer to the static IP range # defined for the Storage network in networks/physical/networks.yaml. - network: storage address: 10.10.153.22 # The IP of the node on the Management network. Refer to the static IP range # defined for the Management network in networks/physical/networks.yaml. - network: management address: 10.10.154.22 # NEWSITE-CHANGEME: Set the host profile for the node. # Note that there are different host profiles depending if this is a control # plane vs data plane node, and different profiles that map to different types # hardware. Select the host profile that matches up to your type of # hardware and function. E.g., the r720 here refers to Dell R720 hardware, the # 'cp' refers to a control plane profile. Refer to profiles/host/ for the list # of available host profiles specific to this site (otherwise, you may find # a general set of host profiles at the "type" or "global" layers/folders. # If you have hardware that is not on this list of profiles, you may need to # create a new host profile for that hardware. host_profile: cp-intel-pod15 metadata: tags: # NEWSITE-CHANGEME: See previous comment. Apply 'masters' tag for control # plane node, and 'workers' tag for data plane hosts. - 'masters' # NEWSITE-CHANGEME: Refer to site engineering package or other supporting # documentation for the specific rack name. This should be a rack name that # is meaningful to data center personnel (i.e. a rack they could locate if # you gave them this rack designation). rack: pod15-rack ... --- schema: 'drydock/BaremetalNode/v1' metadata: schema: 'metadata/Document/v1' # NEWSITE-CHANGEME: The next node's hostname name: pod15-node3 layeringDefinition: abstract: false layer: site storagePolicy: cleartext data: # NEWSITE-CHANGEME: The next node's IPv4 addressing addressing: - network: oob address: 10.10.150.13 - network: dmz address: 10.10.150.23 - network: admin address: 10.10.151.23 - network: private address: 10.10.152.23 - network: storage address: 10.10.153.23 - network: management address: 10.10.154.23 # NEWSITE-CHANGEME: The next node's host profile host_profile: cp-intel-pod15 metadata: # NEWSITE-CHANGEME: The next node's rack designation rack: pod15-rack # NEWSITE-CHANGEME: The next node's role desigatnion tags: - 'masters' ... --- schema: 'drydock/BaremetalNode/v1' metadata: schema: 'metadata/Document/v1' # NEWSITE-CHANGEME: The next node's hostname name: pod15-node4 layeringDefinition: abstract: false layer: site storagePolicy: cleartext data: # NEWSITE-CHANGEME: The next node's IPv4 addressing addressing: - network: oob address: 10.10.150.14 - network: dmz address: 10.10.150.24 - network: admin address: 10.10.151.24 - network: private address: 10.10.152.24 - network: storage address: 10.10.153.24 - network: management address: 10.10.154.24 # NEWSITE-CHANGEME: The next node's host profile host_profile: dp-intel-pod15 metadata: # NEWSITE-CHANGEME: The next node's rack designation rack: pod15-rack # NEWSITE-CHANGEME: The next node's role desigatnion tags: - 'workers' ... --- schema: 'drydock/BaremetalNode/v1' metadata: schema: 'metadata/Document/v1' # NEWSITE-CHANGEME: The next node's hostname name: pod15-node5 layeringDefinition: abstract: false layer: site storagePolicy: cleartext data: # NEWSITE-CHANGEME: The next node's IPv4 addressing addressing: - network: oob address: 10.10.150.15 - network: dmz address: 10.10.150.25 - network: admin address: 10.10.151.25 - network: private address: 10.10.152.25 - network: storage address: 10.10.153.25 - network: management address: 10.10.154.25 # NEWSITE-CHANGEME: The next node's host profile host_profile: dp-intel-pod15 metadata: # NEWSITE-CHANGEME: The next node's rack designation rack: pod15-rack # NEWSITE-CHANGEME: The next node's role desigatnion tags: - 'workers' ...