Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs with sequence diagrams for operations #456

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions docs/sequence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Slurm Appliance Sequences



## Image build

This sequence applies to both "fatimage" builds (usually only done in StackHPC CI) and "extra" builds. The differences are:
- Which image the build VM uses, i.e. the starting image: A genericcloud image for fatimage builds or a fatimages build for an extra build.
- Which inventory groups the build VM is added to.

Note that ansible-init does not run during an image build. It is disabled via a metadata flag.

```mermaid
sequenceDiagram
participant ansible as Ansible Deploy Host
participant cloud as Cloud
ansible->>cloud: Create VM
create participant pulp as Local Pulp Server
cloud->>pulp: Create VM
ansible->>pulp: Run ansible/adhoc/deploy-pulp.yml
note over pulp: Pulp server installed & configured
ansible->>pulp: Run ansible/adhoc/sync-pulp.yml # needs to point at ark too somehow
participant ark as Ark
ark-->>pulp: Sync repos
note over ansible: $ packer build ...
ansible->>cloud: Create VM
create participant packer as Build VM
cloud->>packer: Create VM
note over packer: Boot
sjpb marked this conversation as resolved.
Show resolved Hide resolved
packer->>cloud: Query metadata
cloud->>packer: Metadata sent
packer->>packer: Skip ansible-init
ansible->>packer: Wait for ssh connection
rect rgb(204, 232, 252)
note right of ansible: fatimage.yml
ansible->>packer: Overwrite repo files with Pulp repos and update
packer->>pulp: dnf update
pulp-->>packer: Package updates
ansible->>packer: Perform installation tasks
ansible->>packer: Shutdown
end
ansible->>cloud: Create image from Build VM root disk
destroy packer
note over cloud: Image openhpc-... created

```

## Cluster Creation

```mermaid
sequenceDiagram
participant ansible as Ansible Deploy Host
participant cloud as Cloud
note over ansible: $ ansible-playbook ansible/adhoc/generate-passwords.yml
ansible->>ansible: Template secrets to inventory group_vars and tofu metadata
note over ansible: $ tofu apply ....
ansible->>cloud: Create infra
create participant nodes as Cluster Instances
cloud->>nodes: Create instances
note over nodes: Boot
rect rgb(204, 232, 252)
note over nodes: ansible-init
nodes->>cloud: Query metadata
cloud->>nodes: Metadata sent
nodes->>nodes: Start k3s and connect to its peers
end
note over ansible: $ ansible-playbook ansible/site.yml
ansible->>nodes: Wait for ansible-init completion
ansible->>nodes: Ansible tasks
note over nodes: All services running