diff --git a/docs/identity/readme.md b/docs/identity/identity.md similarity index 98% rename from docs/identity/readme.md rename to docs/identity/identity.md index 342569ed7..d2ea8f6b5 100644 --- a/docs/identity/readme.md +++ b/docs/identity/identity.md @@ -2,7 +2,7 @@ ## ZBus -Storage module is available on zbus over the following channel +Identity module is available on zbus over the following channel | module | object | version | |--------|--------|---------| @@ -15,9 +15,7 @@ identity keeps some data in the following locations |----|---| | root| `/var/cache/modules/identity`| - ## Introduction - Identity manager is responsible for node identification on the grid. The manager make sure the node has one valid ID during the entire lifetime of the node, and that node id is registered on the grid. On first boot, the identity manager will generate an ID and then persist this ID for life. The node registration happens to the BCDB once the network is reachable, and after that the node will be available for reservations. diff --git a/docs/identity/readmd.md b/docs/identity/readmd.md new file mode 100644 index 000000000..ac38c31ee --- /dev/null +++ b/docs/identity/readmd.md @@ -0,0 +1,7 @@ +# Identity Module + + +## Introduction +Identity daemon is responsible for major two operations that is crucial for the node operation +- [Node ID generation and registration on the grid](identity.md) +- [Node live software update](upgrade.md) diff --git a/docs/upgrade/readme.md b/docs/identity/upgrade.md similarity index 70% rename from docs/upgrade/readme.md rename to docs/identity/upgrade.md index e87630aa8..d18b2a87f 100644 --- a/docs/upgrade/readme.md +++ b/docs/identity/upgrade.md @@ -1,33 +1,5 @@ # Upgrade module -## Zbus - -Upgrade module is available on zbus over the following channel - -| module | object | version | -|--------|--------|---------| -|upgrade |[upgrade](#public-interface)| 0.0.1 - -## Public interface [![GoDoc](https://godoc.org/github.com/threefoldtech/zos/pkg/flist?status.svg)](https://godoc.org/github.com/threefoldtech/zos/pkg/upgrade#Upgrader.Version) - -```go -type UpgradeModule interface { - // version return the current version 0-OS is running - Version() (semver.Version, error) -} -``` - - -## Home Directory -Upgraded does not have a home directory, although it can keep track of some files under /tmp. The reason that those files -are kept in a tmpfs filesystem, and not persisted on disk is that they are only needed during the runtime. On reboot new -files will be written. More on that later - -## zinit unit - -Upgrade module depends on network and flist module. This is because is requires network connection to check for new update and the flist module to download the upgrade flist on the node. - - ## Philosophy 0-OS is meant to be a black box no one can access. While this provide some nice security features it also makes it harder to manage. Specially when it comes to update/upgrade. @@ -53,13 +25,13 @@ after initial start of the system, the boot program kicks in and it does the fol - Boot process continues. ## Runtime upgrade of a node -Once the node is up and running, upgraded takes over and it does the following: +Once the node is up and running, identityd takes over and it does the following: - It loads the boot info files `/tmp/flist.name` and `/tmp/flist.info` -- If the `flist.name` file does **not** exist, `upgraded` will assume the node is booted with other means than an flist (for example overlay). In that case, upgraded will log this, and disable live upgrade of the node. +- If the `flist.name` file does **not** exist, `identityd` will assume the node is booted with other means than an flist (for example overlay). In that case, identityd will log this, and disable live upgrade of the node. - If the `flist.name` file exists, the flist will be monitored on the `https://hub.grid.tf` for changes. Any change in the version will initiate a life upgrade routine. -- Once the flist change is detected, upgraded will mount the flist, make sure upgraded is running the latest version. If not, upgraded will update itself first before continuing. +- Once the flist change is detected, identityd will mount the flist, make sure identityd is running the latest version. If not, identityd will update itself first before continuing. - services that will need update will be gracefully stopped. -- `upgraded` will then make sure to update all services from the flist, and config files. and restart the services properly. +- `identityd` will then make sure to update all services from the flist, and config files. and restart the services properly. - services are started again after all binaries has been copied @@ -90,7 +62,6 @@ Example: /etc/zinit/flistd.yaml /etc/zinit/readme.md /etc/zinit/internet.yaml -/etc/zinit/upgraded.yaml /etc/zinit/containerd.yaml /etc/zinit/boot.yaml /etc/zinit/provisiond.yaml @@ -100,9 +71,8 @@ Example: /bin/zlf /bin/provisiond /bin/flistd -/bin/upgraded -/bin/contd /bin/identityd +/bin/contd /bin/capacityd /bin/storaged /bin/networkd diff --git a/docs/upgrade/upgrade_flow.pu b/docs/upgrade/upgrade_flow.pu deleted file mode 100644 index 33e4af444..000000000 --- a/docs/upgrade/upgrade_flow.pu +++ /dev/null @@ -1,36 +0,0 @@ -@startuml - -title 0-OS upgrade flow - -:download upgrade flist; -partition "Atomic Upgrade" { - floating note right: If any of these steps fail, rollback is executed - :execute pre-copy; - :create copy of current data; - :create copy of current modules; - :copy new file into cache; - :execute post-copy; - :stop services; - :call migrate on current data; - :start services; - :call post-start; -} -if (atomic upgrade applied?) then (yes) - :upgrade done; - stop -else (no) - :rollback data; - :rollback modules; - :blacklist upgrade ID; - note right: prevent this upgrade to be applied again - :start services; - if (service started?) then (yes) - :upgrade done; - stop - else (no) - :notify owner system is not healthy anymore; - stop - endif -endif - -@enduml