Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Config struct {
Kafka KafkaConfig `yaml:"kafka"`
Zookeeper ZookeeperConfig `yaml:"zookeeper"`
Redis RedisConfig `yaml:"redis"`
Utapi UtapiConfig `yaml:"utapi"`
}

type GlobalConfig struct {
Expand All @@ -30,6 +31,7 @@ type GlobalConfig struct {
type FeatureConfig struct {
Scuba ScubaFeatureConfig `yaml:"scuba"`
BucketNotifications BucketNotificationsFeatureConfig `yaml:"bucket_notifications"`
Utapi UtapiFeatureConfig `yaml:"utapi"`
}

type ScubaFeatureConfig struct {
Expand All @@ -46,6 +48,10 @@ type BucketNotificationsFeatureConfig struct {
} `yaml:"destinationAuth"`
}

type UtapiFeatureConfig struct {
Enabled bool `yaml:"enabled"`
}

type CloudserverConfig struct {
Image string `yaml:"image"`
EnableNullVersionCompatMode bool `yaml:"enableNullVersionCompatMode"`
Expand All @@ -62,6 +68,11 @@ type VaultConfig struct {
LogLevel string `yaml:"log_level"`
}

type UtapiConfig struct {
Image string `yaml:"image"`
LogLevel string `yaml:"log_level"`
}

type VFormat string

func (vf VFormat) String() string {
Expand Down Expand Up @@ -160,6 +171,9 @@ func DefaultConfig() Config {
Type: "none",
},
},
Utapi: UtapiFeatureConfig{
Enabled: false,
},
},
Cloudserver: CloudserverConfig{},
S3Metadata: MetadataConfig{
Expand All @@ -185,6 +199,7 @@ func DefaultConfig() Config {
RaftSessions: 1,
// LogLevel: "info",
},
Utapi: UtapiConfig{},
}
}

Expand Down
5 changes: 5 additions & 0 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func configureEnv(cfg Config, envDir string) error {
generateS3MetadataConfig,
generateScubaMetadataConfig,
generateKafkaConfig,
generateUtapiConfig,
}

configDir := filepath.Join(envDir, "config")
Expand Down Expand Up @@ -132,3 +133,7 @@ func generateKafkaConfig(cfg Config, path string) error {

return renderTemplates(cfg, "templates/kafka", filepath.Join(path, "kafka"), templates)
}

func generateUtapiConfig(cfg Config, path string) error {
return renderTemplateToFile(getTemplates(), "templates/utapi/config.json", cfg, filepath.Join(path, "utapi", "config.json"))
}
4 changes: 4 additions & 0 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func getComposeProfiles(cfg Config) []string {
profiles = append(profiles, "feature-notifications")
}

if cfg.Features.Utapi.Enabled {
profiles = append(profiles, "feature-utapi")
}

return profiles
}

Expand Down
15 changes: 15 additions & 0 deletions templates/cloudserver/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,20 @@
{{ else }}
"bucketNotificationDestinations": [],
{{ end }}
{{ if .Features.Utapi.Enabled }}
"localCache": {
"host": "localhost",
"port": 6379
},
"utapi": {
"host": "localhost",
"port": 8100,
"workers": 1,
"redis": {
"host": "localhost",
"port": 6379
}
},
{{ end }}
"testingMode": true
}
6 changes: 6 additions & 0 deletions templates/global/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ features:
username: admin
password: admin123

utapi:
enabled: false

cloudserver:
image: ghcr.io/scality/cloudserver:7.70.62

Expand All @@ -39,3 +42,6 @@ zookeeper:

redis:
image: redis:7

utapi:
image: ghcr.io/scality/utapi:7.70.7
1 change: 1 addition & 0 deletions templates/global/defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CLOUDSERVER_IMAGE="{{ .Cloudserver.Image }}"
VAULT_IMAGE="{{ .Vault.Image }}"
SCUBA_IMAGE="{{ .Scuba.Image }}"
BACKBEAT_IMAGE="{{ .Backbeat.Image }}"
UTAPI_IMAGE="{{ .Utapi.Image }}"

METADATA_S3_DB_VERSION="{{ .S3Metadata.VFormat }}"
CLOUDSERVER_ENABLE_NULL_VERSION_COMPAT_MODE="{{ .Cloudserver.EnableNullVersionCompatMode }}"
13 changes: 13 additions & 0 deletions templates/global/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ services:
profiles:
- feature-crr
- feature-notifications
- feature-utapi

zookeeper:
build:
Expand Down Expand Up @@ -219,3 +220,15 @@ services:
- feature-notifications
volumes:
- ./config/kafka/config.properties:/opt/kafka/config/config.properties:ro

utapi:
profiles:
- feature-utapi
image: ${UTAPI_IMAGE}
container_name: workbench-utapi
network_mode: host
command: ["bash", "-c", "yarn start"]
volumes:
- ./config/utapi/config.json:/conf/config.json:ro
environment:
UTAPI_CONFIG_FILE: /conf/config.json
21 changes: 21 additions & 0 deletions templates/utapi/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"port": 8100,
"workers": 10,
"healthChecks": {
"allowFrom": ["127.0.0.1/8", "::1"]
},
"log": {
"logLevel": "info",
"dumpLevel": "error"
},
"redis": {
"host": "127.0.0.1",
"port": 6379
},
"vaultd": {
"host": "127.0.0.1",
"port": 8500
},
"expireMetrics": false,
"expireMetricsTTL": 0
}