Skip to content

Commit

Permalink
pkg/recipe: remove versioncontrol from minimal
Browse files Browse the repository at this point in the history
Also use invalid or non-started versioncontrol server address as
argument. When version control server is not available then the specific
components will skip the check.

Change-Id: I745055228d402d93e398c143bbbe7771ab6d642c
  • Loading branch information
egonelbre committed May 29, 2024
1 parent f876847 commit af8fc3f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 57 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Here `selector` can be either a service (like `storagenode`) or a name of a serv
After running `storj-up init`, you can use the following command to replace binaries based on a specific Gerrit changeset:

```
storj-up build remote gerrit -f refs/changes/65/6365/1 satellite-api satellite-core satellite-admin uplink versioncontrol
storj-up build remote gerrit -f refs/changes/65/6365/1 satellite-api satellite-core satellite-admin uplink
```

You will need to change `refs/changes/65/6365/1` to the Gerrit patchset you want to use, and change the binaries that follow it based on what you are trying to replace.
Expand Down
4 changes: 1 addition & 3 deletions cmd/testdata/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ services:
STORJ_STORAGE2_MONITOR_MINIMUM_DISK_SPACE: "0"
STORJ_STORAGE2_TRUST_SOURCES: 12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4@satellite-api:7777
STORJ_STORAGE_ALLOCATED_DISK_SPACE: 1G
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol:8080/
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol.invalid:8080
STORJ_WAIT_FOR_SATELLITE: "true"
image: img.dev.storj.io/storjup/storj:1.64.1
networks:
Expand All @@ -272,8 +272,6 @@ services:
BINARY_STORAGENODE_UPDATER_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_UPLINK_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
DEFAULTS: dev
STORJUP_AUTHSERVICE: http://authservice:8888
STORJUP_SATELLITE: satellite-api
STORJ_DEBUG_ADDR: 0.0.0.0:11111
STORJ_DEFAULTS: dev
STORJ_LOG_LEVEL: debug
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func Test_ResolveService(t *testing.T) {
services, err := ResolveServices([]string{"minimal", "db"})
require.NoError(t, err)
expected := []string{"cockroach", "redis", "satellite-api", "storagenode", "versioncontrol"}
expected := []string{"cockroach", "redis", "satellite-api", "storagenode"}
require.ElementsMatch(t,
expected,
services)
Expand Down
31 changes: 4 additions & 27 deletions pkg/files/templates/docker-compose.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ services:
STORJ_PAYMENTS_STORJSCAN_AUTH_SECRET: us1secret
STORJ_PAYMENTS_STORJSCAN_DISABLE_LOOP: "false"
STORJ_PAYMENTS_STORJSCAN_ENDPOINT: http://storjscan:12000
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol.invalid:8080/
STORJUP_ROLE: satellite-admin
STORJ_WAIT_FOR_SATELLITE: "true"
STORJUP_SATELLITE: satellite-api
Expand Down Expand Up @@ -226,6 +227,7 @@ services:
STORJ_SERVER_EXTENSIONS_REVOCATION: "false"
STORJ_SERVER_REVOCATION_DBURL: redis://redis:6379?db=1
STORJ_SERVER_USE_PEER_CA_WHITELIST: "false"
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol.invalid:8080/
STORJ_WAIT_FOR_DB: "true"
STORJUP_SATELLITE: satellite-api
STORJUP_AUTHSERVICE: http://authservice:8888
Expand Down Expand Up @@ -265,6 +267,7 @@ services:
STORJ_PAYMENTS_STORJSCAN_AUTH_SECRET: us1secret
STORJ_PAYMENTS_STORJSCAN_DISABLE_LOOP: "false"
STORJ_PAYMENTS_STORJSCAN_ENDPOINT: http://storjscan:12000
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol.invalid:8080/
STORJUP_ROLE: satellite-core
STORJ_WAIT_FOR_SATELLITE: "true"
STORJUP_SATELLITE: satellite-api
Expand Down Expand Up @@ -294,7 +297,7 @@ services:
STORJ_STORAGE2_MONITOR_MINIMUM_DISK_SPACE: "0"
STORJ_STORAGE2_TRUST_SOURCES: 12whfK1EDvHJtajBiAUeajQLYcWqxcQmdYQU5zX5cCf6bAxfgu4@satellite-api:7777
STORJ_STORAGE_ALLOCATED_DISK_SPACE: 1G
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol:8080/
STORJ_VERSION_SERVER_ADDRESS: http://versioncontrol.invalid:8080/
STORJ_WAIT_FOR_SATELLITE: "true"
STORJUP_SATELLITE: satellite-api
STORJUP_AUTHSERVICE: http://authservice:8888
Expand Down Expand Up @@ -331,32 +334,6 @@ services:
image: img.dev.storj.io/storjup/storj:1.62.4
networks:
default: null
versioncontrol:
command:
- versioncontrol
- run
environment:
BINARY_GATEWAY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_IDENTITY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_SATELLITE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_UPDATER_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_UPLINK_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
DEFAULTS: dev
STORJ_DEBUG_ADDR: 0.0.0.0:11111
STORJ_DEFAULTS: dev
STORJ_LOG_LEVEL: debug
STORJ_METRICS_APP_SUFFIX: sim
STORJUP_SATELLITE: satellite-api
STORJUP_AUTHSERVICE: http://authservice:8888
image: img.dev.storj.io/storjup/storj:1.62.4
networks:
default: null
ports:
- mode: ingress
target: 8080
published: 7070
protocol: tcp
prometheus:
image: prom/prometheus
volumes:
Expand Down
26 changes: 1 addition & 25 deletions pkg/recipe/minimal.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
name: minimal
description: "The absolute minimal services to persist a file: satellite-api, storagenodes and versioncontrol"
description: "The absolute minimal services to persist a file: satellite-api and storagenodes"
add:
- name: versioncontrol
label:
- storj
- versioncontrol
image: img.dev.storj.io/storjup/storj:1.104.5
command:
- versioncontrol
- run
persistence:
- /var/lib/storj/.local/share/storj
config:
BINARY_GATEWAY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_IDENTITY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_SATELLITE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_UPDATER_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_UPLINK_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"

STORJ_LOG_LEVEL: debug
STORJ_METRICS_APP_SUFFIX: sim
STORJ_ADDRESS: '{{ Host .This "listen" }}:{{ Port .This "public" }}'
STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug" }}'
environment:
STORJ_DEFAULTS: dev
- name: satellite-api
label:
- storj
Expand Down
27 changes: 27 additions & 0 deletions pkg/recipe/versioncontrol.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: versioncontrol
description: "version control service"
add:
- name: versioncontrol
label:
- storj
- versioncontrol
image: img.dev.storj.io/storjup/storj:1.104.5
command:
- versioncontrol
- run
persistence:
- /var/lib/storj/.local/share/storj
config:
BINARY_GATEWAY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_IDENTITY_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_SATELLITE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_STORAGENODE_UPDATER_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"
BINARY_UPLINK_ROLLOUT_SEED: "0000000000000000000000000000000000000000000000000000000000000001"

STORJ_LOG_LEVEL: debug
STORJ_METRICS_APP_SUFFIX: sim
STORJ_ADDRESS: '{{ Host .This "listen" }}:{{ Port .This "public" }}'
STORJ_DEBUG_ADDR: '{{ Host .This "listen" }}:{{ Port .This "debug" }}'
environment:
STORJ_DEFAULTS: dev
4 changes: 4 additions & 0 deletions pkg/runtime/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ func (c *Compose) GetPort(service runtime.ServiceInstance, portType string) runt
if portType == "console" {
return runtime.PortMap{Internal: 8080, External: 9080, Protocol: "tcp"}
}
case "versioncontrol":
if portType == "public" {
return runtime.PortMap{Internal: 8080, External: 8080, Protocol: "tcp"}
}
}

return runtime.PortMap{Internal: -1, External: -1, Protocol: "tcp"}
Expand Down

0 comments on commit af8fc3f

Please sign in to comment.