Skip to content

Update the OpenCHAMI tutorial to use new fabrica-based services#100

Draft
davidallendj wants to merge 3 commits into
mainfrom
allend/update-tutorial-with-new-services
Draft

Update the OpenCHAMI tutorial to use new fabrica-based services#100
davidallendj wants to merge 3 commits into
mainfrom
allend/update-tutorial-with-new-services

Conversation

@davidallendj
Copy link
Copy Markdown
Contributor

@davidallendj davidallendj commented Jun 1, 2026

Pull Request Template

Thank you for your contribution! Please ensure the following before submitting:

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

This PR updates the existing tutorial to replace the old services with the new ones that are being added to the latest release based on OpenCHAMI/release#50. The tutorial already contains a section including boot-service but will now completely replace the BSS sections. In addition, instructions for metadata-service and tokensmith integration is added to replace cloud-init and haproxy/opaal respectively.

This PR is dependent on the following:

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

@davidallendj davidallendj added the documentation Improvements or additions to documentation label Jun 1, 2026
Signed-off-by: David Allen <davidallendj@gmail.com>
@davidallendj davidallendj force-pushed the allend/update-tutorial-with-new-services branch from fc69bed to 08154d8 Compare June 1, 2026 18:03
@davidallendj davidallendj marked this pull request as draft June 1, 2026 18:03
Copy link
Copy Markdown
Contributor

@synackd synackd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this effort, @davidallendj! I haven't run through this yet, but had a few initial comments based on the content.

Comment thread content/docs/tutorial.md Outdated
Comment thread content/docs/tutorial.md Outdated
Comment thread content/docs/tutorial.md Outdated
Comment thread content/docs/tutorial.md
Comment on lines -1209 to +1242
export DEMO_ACCESS_TOKEN=$(sudo bash -lc 'gen_access_token')
export DEMO_ACCESS_TOKEN=$(sudo podman exec tokensmith /bin/sh -c "/usr/local/bin/tokensmith user-token create --audience smd --key-file /tokensmith/data/keys/private.pem --subject 'admin@example.com' --scopes 'admin' --enable-local-user-mint")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... This is a rather large command. I anticipate that tutorial participants will mention this, so I wonder if we should put a note here saying that normally tokens are obtained through the identity provider, but we are doing this method for simplicity for the tutorial.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original gen_access_token was a large command as well. The alternative would be to update the gen_access_token function to use the command above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's still being included in the release on PR 50. We can probably reuse that function and include the note here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll just need to make sure the subject is configurable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean for the tutorial or in general? If in general, we have want to make a few more of the flags configurable since these are user tokens.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah thinking back now, for the tutorial it is fine but yeah in general. I'm wondering if we want to explain the flags in this command line that generates the token. I imagine participants will be curious (I know I am).

Copy link
Copy Markdown
Contributor Author

@davidallendj davidallendj Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should unless we introduce a section going more in-depth about tokensmith/security/JWTs in general and we actively configure the tokens within the tutorial itself, but I think that's a bit unnecessary for the main tutorial. I would rather try to keep the main parts as condensed and relevant to a new user getting all the services up and running and booting a node instead. If we do decide to add a section like that, I think it should be something like with the Slurm tutorial where we can show in more depth how changing the flags can be done in a meaningful way.

I do think that it's fine to point to the tokensmith documentation for more info about the flags here though. In fact, I think that would probably be helpful if referencing this section later.

Comment thread content/docs/tutorial.md Outdated
Comment on lines +1213 to +1246
**Keep this command handy! Tokens expire after an hour.**
**Keep this command handy! Tokens expire after a short period of time.**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do tokens expire with the new tokensmith implementation?

Copy link
Copy Markdown
Contributor Author

@davidallendj davidallendj Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but by default I think it's something like 5 minutes. I don't think it's an hour though unless configured and since tokensmith was changing when I started this, I just put that in its place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I think the 5 mins default was for the bootstrap token and not the user token.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds right. Can we change this back to an hour?

Comment thread content/docs/tutorial.md Outdated
Comment thread content/docs/tutorial.md
Comment on lines -2396 to +2419
cat << EOF | sudo tee /etc/openchami/data/boot/bss/compute-debug-rocky9.yaml
cat << EOF | sudo tee /etc/openchami/data/boot/compute-debug-rocky9.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was meant to stay YAML, yes? The instructions above use YAML as well.

Copy link
Copy Markdown
Contributor Author

@davidallendj davidallendj Jun 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this was supposed to all be in JSON since boot-service takes JSON for the --spec flag. I think I forgot to update the references there and remove the YAML part.

[rocky@openchami-testing boot-service]$ bin/client bootconfiguration create --help
Create a new BootConfiguration.

Examples:
  # Create from stdin
  echo '{"hosts": ["["item1","item2"]"], "macs": ["["item1","item2"]"], "nids": [], "groups": ["["item1","item2"]"], "kernel": "example-value", "initrd": "example-value", "params": "example-value", "priority": 42}' | client bootconfiguration create

  # Create with --spec flag
  client bootconfiguration create --spec '{"hosts": ["["item1","item2"]"], "macs": ["["item1","item2"]"], "nids": [], "groups": ["["item1","item2"]"], "kernel": "example-value", "initrd": "example-value", "params": "example-value", "priority": 42}'

Spec fields:
  hosts ([]string)
  macs ([]string)
  nids ([]int32)
  groups ([]string)
  kernel (string)
  initrd (string)
  params (string)
  priority (int)

Usage:
  client bootconfiguration create [flags]

Flags:
  -h, --help          help for create
      --spec string   BootConfiguration specification in JSON format

Global Flags:
      --config string      config file (default is $HOME/.boot_service-cli.yaml)
  -o, --output string      output format: table, json, yaml (default "table")
      --server string      boot_service server URL (default "http://localhost:8080")
      --timeout duration   request timeout (default 30s)
      --token string       JWT bearer token
  -v, --version string     API version to request (e.g., v1, v2beta1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but I noticed we are using ochami to add the boot configs, which supports -F yaml. Am I correct to presume that keeping it JSON is specifically for lines 2519 to 2527 where the boot-service client is optionally used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think it would be better to change this section a bit. I'm thinking we could have a tabs with a YAML file using just ochami and another tab with JSON using both.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can keep it clean and straightforward, I am for it. 🙂

Comment thread content/docs/tutorial.md
Comment on lines +2430 to +2443

{
"macs": [
"52:54:00:be:ef:01",
"52:54:00:be:ef:02",
"52:54:00:be:ef:03",
"52:54:00:be:ef:04",
"52:54:00:be:ef:05"
],
"params": "nomodeset ro root=live:${URI_IMG} ip=dhcp overlayroot=tmpfs overlayroot_cfgdisk=disabled apparmor=0 selinux=0 console=ttyS0,115200 ip6=off cloud-init=enabled ds=nocloud-net;s=http://172.16.0.254:8081/cloud-init",
"kernel": "${URI_KERNEL}",
"initrd": "${URI_INITRAMFS}"

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be YAML to match the YAML input above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: David Allen <davidallendj@gmail.com>
Copy link
Copy Markdown
Contributor

@synackd synackd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, looks like I never submitted my review.

I meant these to be instant comments but was reviewing at the same time so the responses are part of the review.

Comment thread content/docs/tutorial.md Outdated
Comment on lines +1158 to +1190
ochami bss service status | jq
curl https://demo.openchami.cluster:8443/boot-service/health
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ochami v0.7.3 has boot service status we can use here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I was waiting for that change.

Comment thread content/docs/tutorial.md
Comment on lines -1209 to +1242
export DEMO_ACCESS_TOKEN=$(sudo bash -lc 'gen_access_token')
export DEMO_ACCESS_TOKEN=$(sudo podman exec tokensmith /bin/sh -c "/usr/local/bin/tokensmith user-token create --audience smd --key-file /tokensmith/data/keys/private.pem --subject 'admin@example.com' --scopes 'admin' --enable-local-user-mint")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll just need to make sure the subject is configurable.

Comment thread content/docs/tutorial.md Outdated
Comment on lines +1213 to +1246
**Keep this command handy! Tokens expire after an hour.**
**Keep this command handy! Tokens expire after a short period of time.**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread content/docs/tutorial.md Outdated

```bash
ochami bss boot params set -f yaml -d @/etc/openchami/data/boot/bss/compute-debug-rocky9.yaml
sudo ochami config --system cluster set demo boot-service.uri: /boot-service
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did having the colon after boot-service.uri work for you? I don't think that is supposed to be there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting...I thought it was since I don't get an error when running that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, wonder if that is a koanf thing. I assume ochami config --system cluster show demo cluster.boot-service.uri shows /boot-service?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, but I think that was set beforehand. I tried deleting that and trying again and this is what I see.

[rocky@openchami-testing ~]$ sudo ochami config --system cluster set demo boot-service.uri: /boot-service
[rocky@openchami-testing ~]$ ochami config --system cluster show demo cluster.boot-service.uri
[rocky@openchami-testing ~]$ sudo ochami config --system cluster set demo boot-service.uri /boot-service
[rocky@openchami-testing ~]$ ochami config --system cluster show demo cluster.boot-service.uri

I double-checked the config and it doesn't look like the config file is being updated either for either command variant.

log:
    format: rfc3339
    level: debug
timeout: 30s
default-cluster: demo
clusters:
    - name: demo
      cluster:
        uri: https://demo.openchami.cluster:8443
        enable-auth: true

Here's the ochami version:

[rocky@openchami-testing ~]$ ochami version
Version:    0.7.3
Tag:        v0.7.3
Branch:     HEAD
Commit:     f07bc1e13e8673ad69cc79091208288ea2510364
Git State:  clean
Date:       2026-05-13T22:16:44Z
Go:         go1.26.3
Compiler:   gc
Build Host: runnervmeorf1
Build User: runner

Comment thread content/docs/tutorial.md
Comment on lines -2396 to +2419
cat << EOF | sudo tee /etc/openchami/data/boot/bss/compute-debug-rocky9.yaml
cat << EOF | sudo tee /etc/openchami/data/boot/compute-debug-rocky9.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but I noticed we are using ochami to add the boot configs, which supports -F yaml. Am I correct to presume that keeping it JSON is specifically for lines 2519 to 2527 where the boot-service client is optionally used?

Signed-off-by: David Allen <davidallendj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants