onboarding

package
v0.4.159 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

README

Introduction

This file explains the onboarding functionality of Device Management Service (DMS). This functionality is catered towards compute providers who wish provide their hardware resources to Nunet for running computational tasks as well as developers who are contributing to platform development.

Stucture and organisation

Here is quick overview of the contents of this directory:

  • README: Current file which is aimed towards developers who wish to modify the onboarding functionality and build on top of it.

  • handler: This is main file where the code for onboarding functionality exists.

  • addresses: This file houses functions to generate Ethereum and Cardano wallet addresses along with its private key.

  • addresses_test: This file houses functions to test the address generation functions defined in addresses.

  • available_resources: This file houses functions to get the total capacity of the machine being onboarded.

  • init: This files initializes the loggers associated with onboarding package.

Contributing

For guidelines of how to contribute, install and test the device-management-service component which contains onboarding package, please refer to package level documentation:

Specifications and functionality

Versioning and lifecycle of above mentioned specifications is aligned to the lifecycle and branching of the platform code (see branching strategy):

  • develop branches contain specifications of the functionality of current unstable branch of development at any given moment;
  • main branches contain specifications of the current production version of the platform at any given moment in time;
  • proposed branches are reserved only for test-suite and platform-data-model repositories which and contain new functionality and data model specifications, accepted for development, but not yet implemented and merged to any above branch.

Links to these two branches are provided with each interface endpoint description as applicable.

Interface endpoints

Onboard Compute Provider

endpoint: /onboarding/onboard
methosd: HTTP POST
output: Machine Metadata

This endpoint executes the onboarding process for a compute provider device. See table below for links to the onboarding specification and data models.

Spec type this branch proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Data (at rest) entityDiagrams (.mermaid,.svg) n.a.
Processes / Functions sequenceDiagram (.mermaid,.svg) n.a.

Note: Indicated data models and structures should be understood as the result of the process. The onboarding process contains subprocesses which are reponsible for constructing the indicated data structures specifically.

DMS communicates to two external components during the onboarding process

  • Elasticsearch: Currently used to log status updates. It is proposed that benchmarking data to be stored here

  • Logbin: During onboarding, the device is only registered with this component. The main usage of Logbin is to monitor and record logs generated during execution of jobs.

Get Device Info

endpoint: /onboarding/metadata
methods: HTTP GET
output: Machine Metadata

This endpoint fetches the current metadata of the onboarded device.

Note: This endpoint is not being utilised at present. Instead this functionality is executed directly through a ReadMetadataFile method implementation in device-management-service/utils/utils.go

See table below for links to the specification and data models.

Spec type this branch proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Return payload entityDiagrams (TBD) n.a.
Request payload entityDiagrams (TBD) n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Get Provisioned Capacity

endpoint: /onboarding/provisioned
methods: HTTP GET
output: Provisioned Capacity

This endpoint fetches the total capacity of the machine that is onboarded to Nunet.

See table below for links to the specification and data models.

Spec type this branch proposed
Features / test case specifications Senarios (.gherkin) n.a.
Return payload entityDiagrams (TBD) n.a.
Request payload entityDiagrams (TBD) n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Create Payment Address

endpoint: /onboarding/address/new
methods: HTTP GET
output: Public-Private key pair & Mnemonic

This endpoint creates a new blockchain payment address for the user.

See table below for links to the specification and data models.

Spec type develop proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Return payload entityDiagrams (TBD) n.a.
Request payload entityDiagrams (TBD) n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Get Onboarding Status

endpoint: /onboarding/status
method: HTTP GET
output: models.OnboardingStatus

This endpoint returns onboarding status of the machine along with some metadata.

See table below for links to the specification and data models.

Spec type this branch proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Return payload entityDiagrams (TBD) n.a.
Request payload entityDiagrams (TBD) n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Change ResourceConfig

endpoint: /onboarding/resource-config
methods: HTTP POST
output: Metadata

This endpoint allows the user to change the configuration of the resources onboarded to Nunet.

See table below for links to the specification and data models.

Spec type this branch proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Return payload entityDiagrams (.mermaid,.svg)* n.a.
Request payload entityDiagrams (.mermaid,.svg)* n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Offboard

endpoint: /onboarding/offboard
methods: HTTP DELETE
output: Success Message & Forced parameter

This endpoint allows the user to remove the resources onboarded to Nunet. It provides flexibility by allowing a forced offboarding even in the presence of errors. The force parameter helps handle situations where it might be necessary to proceed with offboarding despite encountering issues.

See table below for links to the specification and data models.

Spec type this branch proposed
Features / test case specifications Scenarios (.gherkin) n.a.
Return payload (error) entityDiagrams (.mermaid,.svg) n.a.
Return payload (success) entityDiagrams (TBD) n.a.
Request payload entityDiagrams (.mermaid,.svg) n.a.
Processes / Functions sequenceDiagrams (.mermaid,.svg) n.a.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AFS *afero.Afero = &afero.Afero{Fs: FS}

Functions

func CreatePaymentAddress

func CreatePaymentAddress(wallet string) (*models.BlockchainAddressPrivKey, error)

func GetCardanoAddressAndMnemonic

func GetCardanoAddressAndMnemonic() (*models.BlockchainAddressPrivKey, error)

func GetEthereumAddressAndPrivateKey

func GetEthereumAddressAndPrivateKey() (*models.BlockchainAddressPrivKey, error)

func GetMetadata

func GetMetadata() (*models.MetadataV2, error)

GetMetadata reads metadataV2.json file and returns a models.MetadataV2 struct

func GetTotalProvisioned

func GetTotalProvisioned() *models.Provisioned

GetTotalProvisioned returns Provisioned struct with provisioned memory and CPU.

func Offboard added in v0.4.118

func Offboard(ctx context.Context, force bool) error

func Onboard

func Onboard(ctx context.Context, capacity models.CapacityForNunet) (*models.MetadataV2, error)

func ResourceConfig

func ResourceConfig(ctx context.Context, capacity models.CapacityForNunet) (*models.MetadataV2, error)

func Status added in v0.4.118

func Status() (*models.OnboardingStatus, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL