-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.go
134 lines (98 loc) · 4.83 KB
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package store
import (
"github.com/gazebo-web/cloudsim/v4/pkg/simulations"
"time"
)
// Store provides a set of components to store data that needs to be accessed by different services.
type Store interface {
// Machines provides access to a set of configurations for creating machines.
Machines() Machines
// Orchestrator provides access to a set of configurations for cluster management.
Orchestrator() Orchestrator
// Ignition provides access to a set of common cloudsim configurations.
Ignition() Ignition
}
// Machines provides different information for creating machines.
type Machines interface {
// InstanceProfile returns the machine instance profile that should be used when creating a machine.
// It returns nil if the default instance profile should be used.
InstanceProfile() *string
// KeyName returns the name of the SSH private key that should be used when creating a machine.
KeyName() string
// Type returns the machine type that should be used when requesting a simulation machine.
Type() string
// SidecarType returns the machine type that should be used when requesting a sidecar machine.
SidecarType() string
// FirewallRules returns the list of rules that should be applied to the created machine.
FirewallRules() []string
// BaseImage returns the base image that will be used when creating machines.
BaseImage() string
// BaseImageGPU returns the base image with GPU support that will be used when creating simulation machines.
BaseImageGPU() string
// Timeout returns the maximum amount of time that a job should wait until a machine is created.
// Timeout is usually used with PollFrequency.
Timeout() time.Duration
// PollFrequency returns the interval of time that a job should wait until performing another request to create machines.
// PollFrequency is usually used with Timeout.
PollFrequency() time.Duration
// Limit returns the maximum limit of machines that can be created.
Limit() int
// NamePrefix returns the name prefix that should be used when creating a machine.
NamePrefix() string
// ClusterName returns the cluster's name where to launch simulations.
ClusterName() string
}
// Orchestrator provides different information to manage a cluster.
type Orchestrator interface {
// Namespace returns the base namespace that should be used for simulations.
Namespace() string
// TerminationGracePeriod duration that pods need to terminate gracefully.
TerminationGracePeriod() time.Duration
// Nameservers returns a slice of the nameservers used to expose simulations to the internet.
Nameservers() []string
// IngressNamespace returns the namespace where the ingress is running.
IngressNamespace() string
// IngressName returns the ingress name used by Gloo.
IngressName() string
// IngressHost returns a FQDN used to route traffic to cloudsim instances.
IngressHost() string
// Timeout returns the maximum amount of time that a job should wait until a pod is created.
// Timeout is usually used with PollFrequency.
Timeout() time.Duration
// PollFrequency returns the interval of time that a job should wait until performing another request to wait for pods.
// PollFrequency is usually used with Timeout.
PollFrequency() time.Duration
}
// Ignition provides general information about cloudsim and ignition gazebo.
type Ignition interface {
// IP returns the current server's ip.
IP() string
// GazeboServerLogsPath returns the path of the logs from gazebo server containers.
GazeboServerLogsPath() string
// ROSLogsPath returns the path of the logs from bridge containers.
ROSLogsPath() string
// SidecarContainerLogsPath returns the path of the logs from sidecar containers.
SidecarContainerLogsPath() string
// Verbosity returns the level of verbosity that should be used for gazebo.
Verbosity() string
// LogsCopyEnabled determines if ROS logs should be saved in the storage.
LogsCopyEnabled() bool
// Region returns the region where to launch a certain simulation.
Region() string
// SecretsName returns the name of the secrets to access credentials for different cloud providers.
SecretsName() string
// AccessKeyLabel returns the access key label to get the credentials for a certain cloud provider.
// For AWS, it returns: `aws-access-key-id`
AccessKeyLabel() string
// SecretAccessKeyLabel returns the secret access key label to get the credentials for a certain cloud provider.
// For AWS, it returns: `aws-secret-access-key`
SecretAccessKeyLabel() string
// DefaultRecipients returns the list of default emails to send summary emails to.
DefaultRecipients() []string
// DefaultSender returns the default sender for emails.
DefaultSender() string
// LogsBucket returns the bucket for saving simulation logs.
LogsBucket() string
// GetWebsocketPath returns the path of the websocket URL for the given simulations.GroupID.
GetWebsocketPath(groupID simulations.GroupID) string
}