open-nomad/client/allocrunner/config.go

55 lines
1.8 KiB
Go
Raw Normal View History

2018-10-04 23:22:01 +00:00
package allocrunner
2018-06-22 00:35:07 +00:00
import (
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/client/allocwatcher"
2018-06-22 00:35:07 +00:00
clientconfig "github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/client/consul"
"github.com/hashicorp/nomad/client/devicemanager"
2018-07-19 00:06:44 +00:00
"github.com/hashicorp/nomad/client/interfaces"
"github.com/hashicorp/nomad/client/pluginmanager/drivermanager"
cstate "github.com/hashicorp/nomad/client/state"
2018-07-12 23:15:33 +00:00
"github.com/hashicorp/nomad/client/vaultclient"
2018-06-22 00:35:07 +00:00
"github.com/hashicorp/nomad/nomad/structs"
)
// Config holds the configuration for creating an allocation runner.
type Config struct {
// Logger is the logger for the allocation runner.
Logger log.Logger
// ClientConfig is the clients configuration.
ClientConfig *clientconfig.Config
// Alloc captures the allocation that should be run.
Alloc *structs.Allocation
2018-06-22 00:35:07 +00:00
// StateDB is used to store and restore state.
StateDB cstate.StateDB
2018-06-22 00:35:07 +00:00
// Consul is the Consul client used to register task services and checks
Consul consul.ConsulServiceAPI
2018-07-12 23:15:33 +00:00
// Vault is the Vault client to use to retrieve Vault tokens
Vault vaultclient.VaultClient
2018-07-19 00:06:44 +00:00
// StateUpdater is used to emit updated task state
StateUpdater interfaces.AllocStateHandler
// DeviceStatsReporter is used to lookup resource usage for alloc devices
DeviceStatsReporter interfaces.DeviceStatsReporter
// PrevAllocWatcher handles waiting on previous or preempted allocations
PrevAllocWatcher allocwatcher.PrevAllocWatcher
// PrevAllocMigrator allows the migration of a previous allocations alloc dir
PrevAllocMigrator allocwatcher.PrevAllocMigrator
// DeviceManager is used to mount devices as well as lookup device
// statistics
DeviceManager devicemanager.Manager
// DriverManager handles dispensing of driver plugins
DriverManager drivermanager.Manager
2018-06-22 00:35:07 +00:00
}