Skip to content

Commit

Permalink
receipe: new recipe for repair service
Browse files Browse the repository at this point in the history
For testing:

Use storj-up, include services satellite-rangedloop + satellite-repair

Use the following settings to make the offline node detection faster (minutes instead of hours).

```
storj-up env set storagenode STORJ_CONTACT_INTERVAL=10s
storj-up env set satellite-rangedloop STORJ_OVERLAY_NODE_ONLINE_WINDOW=1m
storj-up env set satellite-repair STORJ_OVERLAY_NODE_ONLINE_WINDOW=1m
storj-up env set satellite-api STORJ_OVERLAY_NODE_CHECK_IN_WAIT_PERIOD=20s
```

Upload keys + stop nodes: `docker-compose stop storagenode...`

Change-Id: I590aa4c558316ee0e4d347156cf6f707bfffb431
  • Loading branch information
elek committed Sep 5, 2023
1 parent d6ba20b commit fb35284
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 7 deletions.
4 changes: 4 additions & 0 deletions pkg/recipe/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ var rangedLoop []byte
//go:embed uplink.yaml
var uplink []byte

//go:embed repair.yaml
var repair []byte

// Defaults is a map for recipes included in the binary.
var Defaults = map[string][]byte{
"minimal": minimal,
Expand All @@ -53,4 +56,5 @@ var Defaults = map[string][]byte{
"gc": gc,
"ranged-loop": rangedLoop,
"uplink": uplink,
"repair": repair,
}
28 changes: 28 additions & 0 deletions pkg/recipe/repair.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: repair
description: "satellite repair service"
add:
- name: satellite-repair
label:
- storj
- core
image: img.dev.storj.io/storjup/storj:1.83.2
command:
- satellite
- run
- repair
- --defaults=dev
- '--identity-dir={{ Environment .This "identityDir" }}'
persistence:
- /var/lib/storj/.local/share/storj
config:
STORJ_DATABASE: '{{ Environment "cockroach" "main" }}'
STORJ_METAINFO_DATABASE_URL: '{{ Environment "cockroach" "metainfo" }}'
STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug"}}'
STORJ_ORDERS_ENCRYPTION_KEYS: '0100000000000000=0100000000000000000000000000000000000000000000000000000000000000'
STORJ_LOG_LEVEL: debug
STORJ_METRICS_APP_SUFFIX: sim
environment:
STORJ_WAIT_FOR_SATELLITE: 1
STORJ_DEFAULTS: dev
STORJ_IDENTITY_DIR: '{{ Environment .This "identityDir" }}'
STORJ_USE_PREDEFINED_IDENTITY: 1
3 changes: 3 additions & 0 deletions pkg/runtime/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ func NewCompose(dir string) (*Compose, error) {
"satellite-rangedloop": {
"identityDir": "/var/lib/storj/.local/share/storj/identity/satellite-api/",
},
"satellite-repair": {
"identityDir": "/var/lib/storj/.local/share/storj/identity/satellite-api/",
},
"linksharing": {
"webDir": "/var/lib/storj/pkg/linksharing/web/",
"staticDir": "/var/lib/storj/pkg/linksharing/web/static",
Expand Down
3 changes: 3 additions & 0 deletions pkg/runtime/nomad/nomad.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func NewNomad(dir string, name string) (*Nomad, error) {
"satellite-rangedloop": {
"identityDir": "/var/lib/storj/identities/1",
},
"satellite-repair": {
"identityDir": "/var/lib/storj/identities/1",
},
"linksharing": {
"webDir": "/var/lib/storj/pkg/linksharing/web/",
"staticDir": "/var/lib/storj/pkg/linksharing/web/static",
Expand Down
1 change: 1 addition & 0 deletions pkg/runtime/runtime/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var basePorts = map[string]int{
"satellite-core": 10300,
"satellite-admin": 10400,
"satellite-rangedloop": 10500,
"satellite-repair": 10600,
"storagenode": 30000,
"gateway-mt": 20000,
"authservice": 21000,
Expand Down
16 changes: 9 additions & 7 deletions pkg/runtime/standalone/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ func (c *Standalone) writeService(s *service) error {
}

var runnerSupported = map[string]string{
"satellite-api": "storj",
"satellite-gc": "storj",
"satellite": "storj",
"storagenode": "storj",
"gateway-mt": "gateway-mt",
"authservice": "gateway-mt",
"linksharing": "gateway-mt",
"satellite-api": "storj",
"satellite-rangedloop": "storj",
"satellite-repair": "storj",
"satellite-gc": "storj",
"satellite": "storj",
"storagenode": "storj",
"gateway-mt": "gateway-mt",
"authservice": "gateway-mt",
"linksharing": "gateway-mt",
}

func (c *Standalone) writeIntelliJRunner(s *service) error {
Expand Down

0 comments on commit fb35284

Please sign in to comment.