Skip to content

Commit 97a3ee7

Browse files
committed
pkg/recipe: use spanner as default satellite and db recipes
Change-Id: Ibb1b7616b2feb18a8195c6e21a9b778c9a651d23
1 parent 5e10e90 commit 97a3ee7

File tree

14 files changed

+39
-36
lines changed

14 files changed

+39
-36
lines changed

Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION 0.8
2-
FROM golang:1.24.3
2+
FROM golang:1.25.1
33
WORKDIR /go/storj-up
44

55
lint-deps:

Jenkinsfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ pipeline {
4545
sh "earthly -P ./test/edge+test"
4646
}
4747
}
48-
stage('Storjscan') {
49-
steps {
50-
sh "earthly -P ./test/storjscan+test"
51-
}
52-
}
48+
// stage('Storjscan') {
49+
// steps {
50+
// sh "earthly -P ./test/storjscan+test"
51+
// }
52+
// }
5353
}
5454
}
5555
}

cmd/health.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ func healthCmd() *cobra.Command {
3434
cmd.PersistentFlags().StringVarP(&table, "table", "t", "nodes", "table to use for health check")
3535
cmd.PersistentFlags().IntVarP(&number, "number", "n", 10, "number of entries to expect in the table")
3636
cmd.PersistentFlags().IntVarP(&timeout, "duration", "d", 0, "time to wait (in seconds) for health check")
37-
cmd.PersistentFlags().StringVarP(&host, "host", "", "127.0.0.1", "host/ip address to use for health check. Defaults to 127.0.0.1 or STORJ_DOCKER_HOST if set.")
38-
cmd.PersistentFlags().IntVarP(&port, "port", "p", 26257, "port to use for health check")
37+
cmd.PersistentFlags().StringVarP(&host, "host", "", "localhost", "host/ip address to use for health check. Defaults to localhost or STORJ_DOCKER_HOST if set.")
38+
cmd.PersistentFlags().IntVarP(&port, "port", "p", 9010, "port to use for health check")
3939
cmd.Flags().StringVarP(&user, "user", "u", "root", "user to connect to the DB as")
4040
cmd.Flags().StringVarP(&dbname, "dbname", "", "master", "DB name to connect to")
41-
cmd.Flags().StringVarP(&dbtype, "dbtype", "", "cockroach", "database type (cockroach, postgres, or spanner)")
41+
cmd.Flags().StringVarP(&dbtype, "dbtype", "", "spanner", "database type (spanner, postgres, or cockroach)")
4242
cmd.Flags().StringVarP(&spannerURL, "spanner-url", "", "", "URL for Spanner connection in format spanner://projects/PROJECT/instances/INSTANCE/databases/DATABASE")
4343
return cmd
4444
}

cmd/modify/image_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestSetImage(t *testing.T) {
1919
st, rt, err := testdata.InitCompose(dir)
2020
require.NoError(t, err)
2121

22-
err = setImage(st, rt, []string{"cockroach", "xxx"})
22+
err = setImage(st, rt, []string{"spanner", "xxx"})
2323
require.NoError(t, err)
2424

2525
require.NoError(t, rt.Write())

cmd/modify/persist_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ import (
1111
"github.com/stretchr/testify/require"
1212

1313
"storj.io/storj-up/cmd/testdata"
14+
"storj.io/storj-up/pkg/runtime/runtime"
1415
)
1516

16-
func TestPersist(t *testing.T) {
17+
func TestPersistCockroach(t *testing.T) {
1718
dir := t.TempDir()
1819

1920
st, rt, err := testdata.InitCompose(dir)
2021
require.NoError(t, err)
2122

23+
err = runtime.ApplyRecipes(st, rt, []string{"cockroach"}, 0)
24+
require.NoError(t, err)
25+
2226
err = persist(st, rt, []string{"cockroach"})
2327
require.NoError(t, err)
2428

pkg/common/compose_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
func Test_ResolveService(t *testing.T) {
1313
services, err := ResolveServices([]string{"minimal", "db"})
1414
require.NoError(t, err)
15-
expected := []string{"cockroach", "redis", "satellite-api", "storagenode"}
15+
expected := []string{"spanner", "redis", "satellite-api", "storagenode"}
1616
require.ElementsMatch(t,
1717
expected,
1818
services)

pkg/common/presets_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ import (
1212
func TestResolveServices(t *testing.T) {
1313
res, err := ResolveServices([]string{"db", "satellite-api"})
1414
require.NoError(t, err)
15-
require.Equal(t, []string{"cockroach", "redis", "satellite-api"}, res)
15+
require.Equal(t, []string{"spanner", "redis", "satellite-api"}, res)
1616
}

pkg/recipe/core.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ add:
1414
persistence:
1515
- /var/lib/storj/.local/share/storj
1616
config:
17-
STORJ_DATABASE: '{{ Environment "cockroach" "main" }}'
17+
STORJ_DATABASE: '{{ Environment "spanner" "main" }}'
1818
STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug"}}'
1919
STORJ_LIVE_ACCOUNTING_STORAGE_BACKEND: '{{ Environment "redis" "url" }}?db=1'
2020
STORJ_LOG_LEVEL: debug
2121
STORJ_MAIL_FROM: Storj <[email protected]>
2222
STORJ_MAIL_SMTP_SERVER_ADDRESS: smtp.gmail.com:587
23-
STORJ_METAINFO_DATABASE_URL: '{{ Environment "cockroach" "metainfo" }}'
23+
STORJ_METAINFO_DATABASE_URL: '{{ Environment "spanner" "metainfo" }}'
2424
STORJ_METRICS_APP_SUFFIX: sim
2525
STORJ_ORDERS_ENCRYPTION_KEYS: '0100000000000000=0100000000000000000000000000000000000000000000000000000000000000'
26-
26+
SPANNER_EMULATOR_HOST: '{{ Environment "spanner" "emulatorHost" }}'
2727
STORJ_VERSION_SERVER_ADDRESS: 'http://{{ Host "versioncontrol" "external"}}:{{ Port "versioncontrol" "public"}}'
2828
environment:
2929
STORJUP_AUTHSERVICE: http://authservice:8888

pkg/recipe/db.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
name: db
22
description: Cockroach and redis required by other services.
33
add:
4-
- name: cockroach
5-
image: cockroachdb/cockroach:v24.2.1
4+
- name: spanner
5+
image: img.dev.storj.io/storjup/spanner-emulator:1.5.31
66
port:
7-
- name: cockroach
8-
description: Cockroach Postgres-compatible SQL port
9-
target: 26257
10-
command:
11-
- cockroach
12-
- start-single-node
13-
- --insecure
14-
- --http-addr=localhost:8086
15-
- --store="{{ Environment .This "dir" }}"
16-
persistence:
17-
- /cockroach/cockroach-data
7+
- name: gRPC
8+
description: Spanner gRPC port
9+
target: 9010
10+
- name: REST
11+
description: Spanner REST port
12+
target: 9020
13+
environment:
14+
PROJECT_ID: test-project
15+
INSTANCE_NAME: test-instance
16+
SPANNER_EMULATOR_URL: http://localhost:9020/
1817
- name: redis
1918
image: redis:6.0.9
2019
command:

pkg/recipe/minimal.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ add:
2424
STORJ_CONSOLE_OPEN_REGISTRATION_ENABLED: "true"
2525
STORJ_CONSOLE_RATE_LIMIT_BURST: "10000"
2626
STORJ_CONSOLE_SIGNUP_ACTIVATION_CODE_ENABLED: "false"
27-
STORJ_DATABASE: '{{ Environment "cockroach" "main" }}'
27+
STORJ_DATABASE: '{{ Environment "spanner" "main" }}'
2828
STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug"}}'
2929
STORJ_LIVE_ACCOUNTING_STORAGE_BACKEND: '{{ Environment "redis" "url" }}?db=0'
3030
STORJ_LOG_LEVEL: debug
3131
STORJ_MAIL_FROM: Storj <[email protected]>
3232
STORJ_MAIL_SMTP_SERVER_ADDRESS: smtp.gmail.com:587
33-
STORJ_METAINFO_DATABASE_URL: '{{ Environment "cockroach" "metainfo" }}'
33+
STORJ_METAINFO_DATABASE_URL: '{{ Environment "spanner" "metainfo" }}'
3434
STORJ_METAINFO_RATE_LIMITER_ENABLED: "false"
3535
STORJ_METRICS_APP_SUFFIX: sim
3636
STORJ_ORDERS_ENCRYPTION_KEYS: '0100000000000000=0100000000000000000000000000000000000000000000000000000000000000'
@@ -43,7 +43,7 @@ add:
4343
STORJ_CONSOLE_EXTERNAL_ADDRESS: 'http://{{ Host .This "external"}}:{{ Port .This "console"}}/'
4444
STORJ_SERVER_PRIVATE_ADDRESS: '{{ Host .This "listen" }}:{{ Port .This "private" }}'
4545
STORJ_VERSION_RUN_MODE: disable
46-
46+
SPANNER_EMULATOR_HOST: '{{ Environment "spanner" "emulatorHost" }}'
4747
STORJ_VERSION_SERVER_ADDRESS: 'http://{{ Host "versioncontrol" "external"}}:{{ Port "versioncontrol" "public"}}'
4848
environment:
4949
STORJ_DEFAULTS: dev

0 commit comments

Comments
 (0)