Skip to content

Commit 66fba24

Browse files
authored
Merge pull request #298 from rackerlabs/PUC-503
chore: rename obm to bmc across the repo
2 parents d3dc3af + 123f53d commit 66fba24

27 files changed

+162
-162
lines changed

.github/workflows/build-container-images.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ on:
66
pull_request:
77
paths:
88
- "containers/argo_utils/**"
9-
- "containers/obm-utils/**"
9+
- "containers/bmc-utils/**"
1010
- "containers/python311_alpine/**"
1111
- "containers/python312_alpine/**"
1212
push:
1313
branches:
1414
- main
1515
paths:
1616
- "containers/argo_utils/**"
17-
- "containers/obm-utils/**"
17+
- "containers/bmc-utils/**"
1818
- "containers/python311_alpine/**"
1919
- "containers/python312_alpine/**"
2020

@@ -23,7 +23,7 @@ env:
2323
VERSION_PYTHON311: 0.0.1
2424
VERSION_PYTHON312: 0.0.1
2525
VERSION_ARGO_UTILS: 0.0.1
26-
VERSION_OBM_UTILS: 0.0.1
26+
VERSION_BMC_UTILS: 0.0.1
2727
VERSION_PYTHON_NAUTOBOT: 0.0.1
2828

2929
jobs:
@@ -78,13 +78,13 @@ jobs:
7878
labels: |
7979
org.opencontainers.image.version=${{ env.VERSION_ARGO_UTILS }}
8080
81-
- name: Build and deploy OBM Utils image
81+
- name: Build and deploy BMC Utils image
8282
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
8383
with:
84-
context: containers/obm-utils/
85-
file: containers/obm-utils/Dockerfile.obm_utils
84+
context: containers/bmc-utils/
85+
file: containers/bmc-utils/Dockerfile.bmc_utils
8686
# push for all main branch commits
8787
push: ${{ github.event_name != 'pull_request' }}
88-
tags: ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }}
88+
tags: ghcr.io/${{ github.repository }}/argo-bmc-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-bmc-utils-python3.11.8:${{ env.VERSION_BMC_UTILS }}
8989
labels: |
90-
org.opencontainers.image.version=${{ env.VERSION_OBM_UTILS }}
90+
org.opencontainers.image.version=${{ env.VERSION_BMC_UTILS }}

containers/argo_utils/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Currently Understack is not including any sort of secret store, outside of what
1919
- Credentials will be mounted from a Kubernetes Secret.
2020
- How those credential Secrets are created is up to you.
2121

22-
`workflowtemplates/get-obm-creds.yaml` and the placeholder secret provided in `deps/` are strictly that, placeholder. They have been provided to allow the workflows to execute,
23-
however they will likely fail until a proper get-obm-creds Workflow is created.
22+
`workflowtemplates/get-bmc-creds.yaml` and the placeholder secret provided in `deps/` are strictly that, placeholder. They have been provided to allow the workflows to execute,
23+
however they will likely fail until a proper get-bmc-creds Workflow is created.
2424

2525
## Example
2626
```bash

containers/obm-utils/Dockerfile.obm_utils renamed to containers/bmc-utils/Dockerfile.bmc_utils

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ RUN --mount=type=cache,target=/root/.cache/.pip pip install --no-cache-dir -r /a
1313

1414
FROM ${BASE} as prod
1515

16-
LABEL org.opencontainers.image.title="Python 3.11 image with OBM utils"
17-
LABEL org.opencontainers.image.base.name="ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8"
16+
LABEL org.opencontainers.image.title="Python 3.11 image with BMC utils"
17+
LABEL org.opencontainers.image.base.name="ghcr.io/rackerlabs/understack/argo-bmc-utils-python3.11.8"
1818
LABEL org.opencontainers.image.source=https://github.com/rackerlabs/understack
1919

2020
ENV PATH="/opt/venv/bin:$PATH"
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Overview
22

3-
The WorkflowTemplates provided in this directory were created to provide common lifecycle and maintenance functions on OBM controllers.
3+
The WorkflowTemplates provided in this directory were created to provide common lifecycle and maintenance functions on BMC controllers.
44

55
## Caveats
66

7-
- TODO: the obm-sync-creds workflow logic should probably be broken to include an obm-update-password workflow, which then likely has more utility.
7+
- TODO: the bmc-sync-creds workflow logic should probably be broken to include a bmc-update-password workflow, which then likely has more utility.
88

99
## Example
1010
```bash
11-
argo -n argo-events submit --from workflowtemplate/obm-sync-creds --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca
11+
argo -n argo-events submit --from workflowtemplate/bmc-sync-creds --parameter device_id=1de4f169-9848-4d8e-921b-65338c1e00ca
1212

13-
Name: obm-sync-creds-wrn2c
13+
Name: bmc-sync-creds-wrn2c
1414
Namespace: argo-events
1515
ServiceAccount: unset
1616
Status: Pending
@@ -22,7 +22,7 @@ Parameters:
2222

2323
```bash
2424
argo -n argo-events get @latest
25-
Name: obm-sync-creds-wrn2c
25+
Name: bmc-sync-creds-wrn2c
2626
Namespace: argo-events
2727
ServiceAccount: workflow
2828
Status: Running
@@ -37,14 +37,14 @@ Parameters:
3737
device_id: 1de4f169-9848-4d8e-921b-65338c1e00ca
3838

3939
STEP TEMPLATE PODNAME DURATION MESSAGE
40-
obm-sync-creds-wrn2c main
41-
├─✔ get-obm-creds get-obm-creds/main
42-
│ └─✔ get-obm-creds get-obm-creds-ext/main
43-
│ └─✔ get-obm-creds-ext get-creds-ext/main
40+
bmc-sync-creds-wrn2c main
41+
├─✔ get-bmc-creds get-bmc-creds/main
42+
│ └─✔ get-bmc-creds get-bmc-creds-ext/main
43+
│ └─✔ get-bmc-creds-ext get-creds-ext/main
4444
│ ├─✔ get-ext-num get-ext-num/main
45-
│ └─✔ get-creds-ext get-creds-ext obm-sync-creds-wrn2c-get-creds-ext-2059517959 5s
46-
├─✔ get-obm-ip get-obm-ip/main
45+
│ └─✔ get-creds-ext get-creds-ext bmc-sync-creds-wrn2c-get-creds-ext-2059517959 5s
46+
├─✔ get-bmc-ip get-bmc-ip/main
4747
│ └───✔ nautobot-query nautobot-api/main
4848
│ └───✔ send-request http
49-
└─◷ obm-sync-creds obm-sync-creds obm-sync-creds-wrn2c-obm-sync-creds-2727609696 28s
49+
└─◷ bmc-sync-creds bmc-sync-creds bmc-sync-creds-wrn2c-bmc-sync-creds-2727609696 28s
5050
```

containers/obm-utils/code/obm_firmware_update.py renamed to containers/bmc-utils/code/bmc_firmware_update.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818

1919

2020
if __name__ == "__main__":
21-
parser = argparse.ArgumentParser(prog=os.path.basename(__file__), description="Update OBM firmware")
22-
parser.add_argument("--host", required=True, help="The address of the OBM interface")
21+
parser = argparse.ArgumentParser(prog=os.path.basename(__file__), description="Update BMC firmware")
22+
parser.add_argument("--host", required=True, help="The address of the BMC interface")
2323
parser.add_argument("--firmware-url", required=True, help="URL of firmware")
2424

2525
args = parser.parse_args()
2626
host = args.host
2727
firmware_url = args.firmware_url
28-
username = os.environ["OBM_USERNAME"]
29-
password = os.environ["OBM_PASSWORD"]
28+
username = os.environ["BMC_USERNAME"]
29+
password = os.environ["BMC_PASSWORD"]
3030

31-
logger.info("Fetching OBM update service ...")
31+
logger.info("Fetching BMC update service ...")
3232

3333
authn = sushy.auth.SessionOrBasicAuth(username, password)
3434
c = sushy.Sushy(f"https://{host}/redfish/v1/", verify=False, auth=authn)

containers/obm-utils/code/obm_sync_creds.py renamed to containers/bmc-utils/code/bmc_sync_creds.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def verify_auth(host: str, username: str = "root", password: str = "") -> bool:
4343
return False
4444

4545

46-
def get_obm_accounts(host: str, username: str, password: str) -> List[Dict]:
47-
"""A vendor agnostic approach to crawling the API for OBM accounts"""
46+
def get_bmc_accounts(host: str, username: str, password: str) -> List[Dict]:
47+
"""A vendor agnostic approach to crawling the API for BMC accounts"""
4848
try:
4949
# get account service
5050
r = redfish_request(host, "/redfish/v1", username, password)
@@ -67,10 +67,10 @@ def get_obm_accounts(host: str, username: str, password: str) -> List[Dict]:
6767
raise
6868

6969

70-
def set_obm_creds(host: str, username: str, password: str, expected_username: str, expected_password: str) -> bool:
70+
def set_bmc_creds(host: str, username: str, password: str, expected_username: str, expected_password: str) -> bool:
7171
"""Find the account associated with the username in question"""
7272
try:
73-
accounts = get_obm_accounts(host, username, password)
73+
accounts = get_bmc_accounts(host, username, password)
7474

7575
matched_account = None
7676
for account in accounts:
@@ -83,7 +83,7 @@ def set_obm_creds(host: str, username: str, password: str, expected_username: st
8383
break
8484

8585
if not matched_account:
86-
raise Exception(f"Unable to find OBM account for {expected_username}")
86+
raise Exception(f"Unable to find BMC account for {expected_username}")
8787

8888
account_uri = matched_account["@odata.id"]
8989

@@ -97,39 +97,39 @@ def set_obm_creds(host: str, username: str, password: str, expected_username: st
9797

9898
if __name__ == "__main__":
9999
parser = argparse.ArgumentParser(
100-
prog=os.path.basename(__file__), description="Attempts to find the correct OBM credentials for a device"
100+
prog=os.path.basename(__file__), description="Attempts to find the correct BMC credentials for a device"
101101
)
102-
parser.add_argument("--host", required=True, help="the address of the obm interface for the device")
102+
parser.add_argument("--host", required=True, help="the address of the bmc interface for the device")
103103

104104
args = parser.parse_args()
105105
host = args.host
106-
expected_username = os.environ["OBM_USERNAME"]
107-
expected_password = os.environ["OBM_PASSWORD"]
106+
expected_username = os.environ["BMC_USERNAME"]
107+
expected_password = os.environ["BMC_PASSWORD"]
108108

109-
legacy_passwords = json.loads(os.getenv("OBM_LEGACY_PASSWORDS", "[]"))
109+
legacy_passwords = json.loads(os.getenv("BMC_LEGACY_PASSWORDS", "[]"))
110110
if not legacy_passwords:
111-
logger.info("env variable OBM_LEGACY_PASSWORDS was not set.")
111+
logger.info("env variable BMC_LEGACY_PASSWORDS was not set.")
112112
sys.exit(1)
113113

114-
logger.info("Ensuring OBM credentials are synced correctly ...")
114+
logger.info("Ensuring BMC credentials are synced correctly ...")
115115

116116
if verify_auth(host, expected_username, expected_password):
117-
logger.info("OBM credentials are in sync.")
117+
logger.info("BMC credentials are in sync.")
118118
sys.exit(0)
119119
else:
120-
logger.info("OBM credentials are NOT in sync. Trying known legacy/vendor credentials ...")
120+
logger.info("BMC credentials are NOT in sync. Trying known legacy/vendor credentials ...")
121121

122122
# iDRAC defaults to blocking an IP address after 3 bad login attempts within 60 second. Since we have the
123123
# initial attempt above, we will sleep 35 seconds between any additional attempts.
124124
delay = 60
125-
username = os.getenv("OBM_LEGACY_USER", "root")
125+
username = os.getenv("BMC_LEGACY_USER", "root")
126126
for password in legacy_passwords:
127127
logger.info(f"Delaying for {delay} seconds to prevent failed auth lockouts ...")
128128
time.sleep(delay)
129129
if verify_auth(host, username, password):
130-
if set_obm_creds(host, username, password, expected_username, expected_password):
131-
logger.info("OBM password has been synced.")
130+
if set_bmc_creds(host, username, password, expected_username, expected_password):
131+
logger.info("BMC password has been synced.")
132132
sys.exit(0)
133133

134-
logger.info("Unable to sync the OBM password.")
134+
logger.info("Unable to sync the BMC password.")
135135
sys.exit(1)

docs/component-argo-workflows.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ set of WorkflowTemplates below.
99
| WorkflowTemplate | Description | Input | Output | |
1010
|---------------------- |-----------------------------------------------------------|-------------------------|------------|---|
1111
| get-device-nautobot | Return Device Information from Nautobot | device_id | device | |
12-
| get-obm-creds | Get the credentials for the target Device | device_id | secret | * |
13-
| get-obm-ip | Get OBM IP address for target Device | device_id | ip | |
12+
| get-bmc-creds | Get the credentials for the target Device | device_id | secret | * |
13+
| get-bmc-ip | Get BMC IP address for target Device | device_id | ip | |
1414
| nautobot-api | HTTP Template Workflow to query the Nautobot API | method,nautobot_url,uri | result | |
15-
| obm-firmware-update | Update OBM firmware on target Device | device_id | | |
16-
| obm-sync-creds | Sync's a devices OBM password with what we have on record | device_id | | |
15+
| bmc-firmware-update | Update BMC firmware on target Device | device_id | | |
16+
| bmc-sync-creds | Sync's a devices BMC password with what we have on record | device_id | | |
1717

1818
\* WorkflowTemplate which requires a manual / custom implementation.
1919

2020
As Understack develops, there may be underlying / dependant services which are not included, and require some of the
21-
included WorkflowTemplates to be manually implemented to work in your environment. For example, the get-obm-creds
21+
included WorkflowTemplates to be manually implemented to work in your environment. For example, the get-bmc-creds
2222
WorkflowTemplate will need to be written to communicate with whatever service you're using to store your device
2323
credentials.
2424

@@ -53,7 +53,7 @@ the Pod's uid can be passed via the `KUBERNETES_POD_UID` environment variable. T
5353
completion of the Workflow `.spec.podGC.strategy` can be set to `OnWorkflowCompletion`.
5454

5555
An example WorkflowTemplate demonstrating argo-python usage can be found
56-
[here](https://github.com/rackerlabs/understack/blob/main/workflows/argo-events/workflowtemplates/get-obm-creds.yaml).
56+
[here](https://github.com/rackerlabs/understack/blob/main/workflows/argo-events/workflowtemplates/get-bmc-creds.yaml).
5757

5858
### Argo CLI
5959

python/understack-workflows/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ requests-mock = "^1.12.1"
4545
[tool.poetry.scripts]
4646
sync-keystone = "understack_workflows.main.sync_keystone:main"
4747
sync-interfaces = "understack_workflows.main.sync_interfaces:main"
48-
sync-obm-creds = "understack_workflows.main.sync_obm_creds:main"
48+
sync-bmc-creds = "understack_workflows.main.sync_bmc_creds:main"
4949
sync-server = "understack_workflows.main.sync_server:main"
5050
sync-provision-state = "understack_workflows.main.sync_provision_state:main"
5151
sync-nautobot-interfaces = "understack_workflows.main.sync_nautobot_interfaces:main"

python/understack-workflows/understack_workflows/main/sync_obm_creds.py renamed to python/understack-workflows/understack_workflows/main/sync_bmc_creds.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def main():
4242
)
4343
sys.exit(0)
4444

45-
# Update OBM credentials
46-
expected_username = credential("obm", "username")
47-
expected_password = credential("obm", "password")
45+
# Update BMC credentials
46+
expected_username = credential("bmc", "username")
47+
expected_password = credential("bmc", "password")
4848

4949
updates = [
5050
f"driver_info/redfish_username={expected_username}",

python/understack-workflows/understack_workflows/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def check_manufacturer(cls, manufacturer: str) -> None:
112112
)
113113

114114
@classmethod
115-
def obm_is_ilo4(cls, chassis_data: SushyChassis) -> bool:
115+
def bmc_is_ilo4(cls, chassis_data: SushyChassis) -> bool:
116116
return (
117117
chassis_data.redfish_version == "1.0.0"
118118
and chassis_data.manufacturer == "HPE"
@@ -126,7 +126,7 @@ def from_redfish(cls, oob_obj: Sushy) -> Chassis:
126126

127127
cls.check_manufacturer(chassis_data.manufacturer)
128128

129-
if cls.obm_is_ilo4(chassis_data):
129+
if cls.bmc_is_ilo4(chassis_data):
130130
return cls.from_hp_json(oob_obj, chassis_data.name)
131131

132132
chassis = cls(chassis_data.name, [], [])

workflows/argo-events/docs/sync-nb-server-to-ironic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We initially wanted to listen on the `dcim.Device` record creation events, but
1010
it is more efficient to listen for the updates on the `dcim.Interface` and
1111
perform additional checks to see:
1212

13-
- if the updated Interface is an OBM interface
13+
- if the updated Interface is an BMC interface
1414
- if the updated Interface's device is a Server (currently we determine this by an interface name, since the Network devices don't have DRAC/iLo cards)
1515

1616
## Caveats

workflows/argo-events/docs/sync-srv-redfish-intfs-to-nb.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Overview
22

3-
The workflow templates in this folder are designed to create device interfaces in Nautobot based on Redfish information retrieved from devices using OBM credentials.
3+
The workflow templates in this folder are designed to create device interfaces in Nautobot based on Redfish information retrieved from devices using BMC credentials.
44

5-
The process begins when a sensor detects updates to Nautobot OBM interfaces, prompting the get-obm-creds action to fetch the necessary OBM credentials. This step is crucial as it serves as a prerequisite for the other workflows in this folder. You can find examples of such dependencies in the `deps` folder.
5+
The process begins when a sensor detects updates to Nautobot BMC interfaces, prompting the get-bmc-creds action to fetch the necessary BMC credentials. This step is crucial as it serves as a prerequisite for the other workflows in this folder. You can find examples of such dependencies in the `deps` folder.
66

77
Following this, the sensor initiates the `sync-interfaces-to-nautobot` workflow. This workflow obtains Redfish information from a server and uses it to create new device interfaces in Nautobot.
88

99
It is also worth noting that embedded/integrated interfaces are omitted for the purposes of the Undercloud project.
1010

11-
## Servers/OBMs supported
11+
## Servers/BMCs supported
1212
The code utilizes the Sushy library to obtain Redfish information. However, to accommodate older versions of Redfish, several workarounds have been implemented within the code.
1313

1414
It was successfully tested on:

workflows/argo-events/kustomization.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ namespace: argo-events
66

77
resources:
88
- secrets/openstack-svc-acct.yaml
9-
- secrets/obm-creds.yaml
10-
- secrets/placeholder-obm-creds.yaml
9+
- secrets/bmc-creds.yaml
10+
- secrets/placeholder-bmc-creds.yaml
1111
- secrets/operate-workflow-sa.token.yaml
1212
- secrets/nautobot-token.yaml
13-
- secrets/placeholder-obm-legacy-passwords.yaml
13+
- secrets/placeholder-bmc-legacy-passwords.yaml
1414
- sensors/ironic-node-update.yaml
1515
- sensors/debug-sensor.yaml
1616
- sensors/nb-oob-interface-update.yaml
@@ -21,17 +21,17 @@ resources:
2121
- workflowtemplates/get-device-nautobot.yaml
2222
- workflowtemplates/sync-interfaces-to-nautobot.yaml
2323
- workflowtemplates/sync-nb-server-to-ironic.yaml
24-
- workflowtemplates/get-obm-ip.yaml
24+
- workflowtemplates/get-bmc-ip.yaml
2525
- workflowtemplates/sync-provision-state-to-nautobot.yaml
2626
- workflowtemplates/node-events.yaml
2727
- workflowtemplates/sync-interfaces-to-ironic.yaml
2828
- workflowtemplates/undersync-device.yaml
2929
- workflowtemplates/sync-server-to-ironic.yaml
3030
- workflowtemplates/undersync-switch.yaml
3131
- workflowtemplates/keystone-event-project.yaml
32-
- workflowtemplates/get-obm-creds.yaml
32+
- workflowtemplates/get-bmc-creds.yaml
3333
- workflowtemplates/idrac-enable-network-boot.yaml
34-
- workflowtemplates/obm-sync-creds.yaml
34+
- workflowtemplates/bmc-sync-creds.yaml
3535
- workflowtemplates/sync-srv-redfish-intfs-to-nb.yaml
36-
- workflowtemplates/obm-firmware-update.yaml
37-
- workflowtemplates/sync-obm-creds.yaml
36+
- workflowtemplates/bmc-firmware-update.yaml
37+
- workflowtemplates/sync-bmc-creds.yaml

workflows/argo-events/secrets/obm-creds.yaml renamed to workflows/argo-events/secrets/bmc-creds.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ data:
55
password: Y2FsdmluY2FsdmluCg==
66
kind: Secret
77
metadata:
8-
name: obm-creds
8+
name: bmc-creds
99
namespace: argo-events
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# The credentials here are the Dell OBM default of root:calvin
1+
# The credentials here are the Dell BMC default of root:calvin
22
apiVersion: v1
33
data:
44
username: cm9vdA==
55
password: Y2FsdmluY2Fsdmlu
66
kind: Secret
77
metadata:
88
creationTimestamp: null
9-
name: placeholder-obm-creds
9+
name: placeholder-bmc-creds
1010
namespace: argo-events
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This is a placeholder Secret, used by the bmc-sync-creds.yaml WorkflowTemplate, containing the default Dell BMC password of: '["calvin"]'
2+
apiVersion: v1
3+
data:
4+
passwords: WyJjYWx2aW4iXQ==
5+
kind: Secret
6+
metadata:
7+
creationTimestamp: null
8+
name: placeholder-bmc-legacy-passwords
9+
namespace: argo-events

0 commit comments

Comments
 (0)