Skip to content

Commit

Permalink
Update docs for identityd
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamadazmy committed Oct 17, 2019
1 parent 58b9940 commit 1e17909
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 74 deletions.
4 changes: 1 addition & 3 deletions docs/identity/readme.md → docs/identity/identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|--------|--------|---------|
Expand All @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions docs/identity/readmd.md
Original file line number Diff line number Diff line change
@@ -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)
40 changes: 5 additions & 35 deletions docs/upgrade/readme.md → docs/identity/upgrade.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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


Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
36 changes: 0 additions & 36 deletions docs/upgrade/upgrade_flow.pu

This file was deleted.

0 comments on commit 1e17909

Please sign in to comment.