Skip to content

Commit

Permalink
disable storage container, too
Browse files Browse the repository at this point in the history
  • Loading branch information
canercidam committed May 9, 2023
1 parent ed92a06 commit 626776d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion config/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var (
DockerUpdaterImage = "forta-network/forta-node:latest"
UseDockerImages = "local"

DockerSupervisorManagedContainers = 7
DockerSupervisorManagedContainers = 6
DockerUpdaterContainerName = fmt.Sprintf("%s-updater", ContainerNamePrefix)
DockerSupervisorContainerName = fmt.Sprintf("%s-supervisor", ContainerNamePrefix)
DockerNatsContainerName = fmt.Sprintf("%s-nats", ContainerNamePrefix)
Expand Down
62 changes: 32 additions & 30 deletions services/supervisor/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,38 +233,40 @@ func (sup *SupervisorService) start() error {
}
sup.registerMessageHandlers()

sup.storageContainer, err = sup.client.StartContainer(
sup.ctx, clients.DockerContainerConfig{
Name: config.DockerStorageContainerName,
Image: commonNodeImage,
Cmd: []string{config.DefaultFortaNodeBinaryPath, "storage"},
Env: map[string]string{
config.EnvReleaseInfo: releaseInfo.String(),
},
Volumes: map[string]string{
// give access to host docker
"/var/run/docker.sock": "/var/run/docker.sock",
hostFortaDir: config.DefaultContainerFortaDirPath,
},
Ports: map[string]string{
"": config.DefaultHealthPort, // random host port
},
Files: map[string][]byte{
"passphrase": []byte(sup.config.Passphrase),
if sup.config.Config.AdvancedConfig.IPFSExperiment {
sup.storageContainer, err = sup.client.StartContainer(
sup.ctx, clients.DockerContainerConfig{
Name: config.DockerStorageContainerName,
Image: commonNodeImage,
Cmd: []string{config.DefaultFortaNodeBinaryPath, "storage"},
Env: map[string]string{
config.EnvReleaseInfo: releaseInfo.String(),
},
Volumes: map[string]string{
// give access to host docker
"/var/run/docker.sock": "/var/run/docker.sock",
hostFortaDir: config.DefaultContainerFortaDirPath,
},
Ports: map[string]string{
"": config.DefaultHealthPort, // random host port
},
Files: map[string][]byte{
"passphrase": []byte(sup.config.Passphrase),
},
DialHost: true,
NetworkID: nodeNetworkID,
MaxLogFiles: sup.maxLogFiles,
MaxLogSize: sup.maxLogSize,
},
DialHost: true,
NetworkID: nodeNetworkID,
MaxLogFiles: sup.maxLogFiles,
MaxLogSize: sup.maxLogSize,
},
)
if err != nil {
return err
}
sup.addContainerUnsafe(sup.storageContainer)
)
if err != nil {
return err
}
sup.addContainerUnsafe(sup.storageContainer)

if err := sup.client.WaitContainerStart(sup.ctx, sup.storageContainer.ID); err != nil {
return fmt.Errorf("failed while waiting for the storage container to start: %v", err)
if err := sup.client.WaitContainerStart(sup.ctx, sup.storageContainer.ID); err != nil {
return fmt.Errorf("failed while waiting for the storage container to start: %v", err)
}
}

sup.jsonRpcContainer, err = sup.client.StartContainer(
Expand Down

0 comments on commit 626776d

Please sign in to comment.