provider

package
v0.16.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

README

Akash Provider Daemon

This folder contains the Akash Provider Daemon. This piece of software listens to events emitted from the Akash blockchain (code in ../app/app.go) and takes actions on a connected Kubernetes cluster to provision compute capacity based on the bids that the configured provider key wins. The following are the pieces of the daemon:

bidengine

The bid engine queries for any existing orders on chain, and based on the on-chain provider configuration, places bids on behalf of the configured provider based on configured selling prices for resources. The daemon listens for changes in the configuration so users can use automation tooling to dynamically change the prices they are charging w/o restarting the daemon. You can see the key management code for provider tx signing in cmd/run.go.

cluster

The cluster package contains the necessary code for interacting with clusters of compute that a provider is offering on the open marketplace to deploy orders on behalf of users creating deployments based on manifests. Right now only kubernetes is supported as a backend, but providers could easily implement other cluster management solutions such as OpenStack, VMWare, OpenShift, etc...

cmd

The cobra command line utility that wraps the rest of the code here and is buildable.

event

Declares the pubsub events that the provider needs to take action on won leases an recieved manifests.

gateway

Contains hanlder code for the rest server exposed by the provider

manifest

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClusterReadTimedout = errors.New("timeout waiting for cluster ready")
)

Functions

This section is empty.

Types

type BalanceCheckerConfig added in v0.12.2

type BalanceCheckerConfig struct {
	PollingPeriod           time.Duration
	MinimumBalanceThreshold uint64
	WithdrawalPeriod        time.Duration
}

type Client added in v0.7.3

type Client interface {
	StatusClient
	ValidateClient
	Manifest() manifest.Client
	Cluster() cluster.Client
	Hostname() clustertypes.HostnameServiceClient
	ClusterService() cluster.Service
}

type Config added in v0.9.1

type Config struct {
	ClusterWaitReadyDuration        time.Duration
	ClusterPublicHostname           string
	ClusterExternalPortQuantity     uint
	InventoryResourcePollPeriod     time.Duration
	InventoryResourceDebugFrequency uint
	BidPricingStrategy              bidengine.BidPricingStrategy
	BidDeposit                      sdk.Coin
	CPUCommitLevel                  float64
	MemoryCommitLevel               float64
	StorageCommitLevel              float64
	MaxGroupVolumes                 int
	BlockedHostnames                []string
	BidTimeout                      time.Duration
	ManifestTimeout                 time.Duration
	BalanceCheckerCfg               BalanceCheckerConfig
	Attributes                      types.Attributes
	DeploymentIngressStaticHosts    bool
	DeploymentIngressDomain         string
	ClusterSettings                 map[interface{}]interface{}
	RPCQueryTimeout                 time.Duration
	CachedResultMaxAge              time.Duration
}

func NewDefaultConfig added in v0.9.1

func NewDefaultConfig() Config

type Service

type Service interface {
	Client

	Close() error
	Done() <-chan struct{}
}

Service is the interface that includes StatusClient interface. It also wraps ManifestHandler, Close and Done methods.

func NewService

func NewService(ctx context.Context, cctx client.Context, accAddr sdk.AccAddress, session session.Session, bus pubsub.Bus, cclient cluster.Client, cfg Config) (Service, error)

type Status added in v0.6.0

type Status struct {
	Cluster               *ctypes.Status    `json:"cluster"`
	Bidengine             *bidengine.Status `json:"bidengine"`
	Manifest              *manifest.Status  `json:"manifest"`
	ClusterPublicHostname string            `json:"cluster_public_hostname,omitempty"`
}

Status is the data structure that stores Cluster, Bidengine and Manifest details.

type StatusClient added in v0.3.4

type StatusClient interface {
	Status(context.Context) (*Status, error)
}

StatusClient is the interface which includes status of service

type ValidateClient added in v0.12.0

type ValidateClient interface {
	Validate(context.Context, dtypes.GroupSpec) (ValidateGroupSpecResult, error)
}

ValidateClient is the interface to check if provider will bid on given groupspec

type ValidateGroupSpecResult added in v0.12.0

type ValidateGroupSpecResult struct {
	MinBidPrice sdk.DecCoin `json:"min_bid_price"`
}

Jump to

Keyboard shortcuts

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