hc to satellite rename (#282)

* hc to satellite rename

* rebase with master and fix spelling

* missed out rename

* rebase merge fix
This commit is contained in:
aligeti 2018-08-29 14:32:41 -04:00 committed by GitHub
parent 2bba44fa1c
commit 743ec65204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 65 additions and 65 deletions

View File

@ -84,9 +84,9 @@ test: lint
@echo done
build-binaries:
docker build -t hc .
docker build -t satellite .
run-hc:
run-satellite:
docker network create test-net
docker run -d \
@ -96,23 +96,23 @@ run-hc:
redis
docker run -d \
--name=hc \
--name=satellite \
--network test-net \
-p 127.0.0.1:8080:8080 \
-e REDIS_ADDRESS=redis:6379 \
-e REDIS_PASSWORD="" \
-e REDIS_DB=1 \
-e OVERLAY_PORT=7070 \
hc
satellite
test-captplanet:
@echo "Running ${@}"
@./scripts/test-captplanet.sh
clean-local:
# cleanup heavy client
docker stop hc || true
docker rm hc || true
# cleanup satellite
docker stop satellite || true
docker rm satellite || true
# cleanup redis
docker stop redis || true
docker rm redis || true
@ -131,7 +131,7 @@ images: satellite-image storage-node-image uplink-image
.PHONY: satellite-image
satellite-image:
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/satellite:${TAG} -f cmd/hc/Dockerfile .
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/satellite:${TAG} -f cmd/satellite/Dockerfile .
.PHONY: storage-node-image
storage-node-image:
docker build --build-arg GO_VERSION=${GO_VERSION} -t storjlabs/storage-node:${TAG} -f cmd/storagenode/Dockerfile .

View File

@ -24,8 +24,8 @@ const (
storagenodeCount = 50
)
// HeavyClient is for configuring client
type HeavyClient struct {
// Satellite is for configuring client
type Satellite struct {
Identity provider.IdentityConfig
Kademlia kademlia.Config
PointerDB pointerdb.Config
@ -51,7 +51,7 @@ var (
}
runCfg struct {
HeavyClient HeavyClient
Satellite Satellite
StorageNodes [storagenodeCount]StorageNode
Uplink miniogw.Config
}
@ -76,13 +76,13 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
return err
}
address := runCfg.StorageNodes[i].Identity.Address
if runCfg.HeavyClient.MockOverlay.Enabled &&
runCfg.HeavyClient.MockOverlay.Host != "" {
if runCfg.Satellite.MockOverlay.Enabled &&
runCfg.Satellite.MockOverlay.Host != "" {
_, port, err := net.SplitHostPort(address)
if err != nil {
return err
}
address = net.JoinHostPort(runCfg.HeavyClient.MockOverlay.Host, port)
address = net.JoinHostPort(runCfg.Satellite.MockOverlay.Host, port)
}
storagenode := fmt.Sprintf("%s:%s", identity.ID.String(), address)
storagenodes = append(storagenodes, storagenode)
@ -95,17 +95,17 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
}(i, storagenode)
}
// start heavy client
// start satellite
go func() {
_, _ = fmt.Printf("starting heavy client on %s\n",
runCfg.HeavyClient.Identity.Address)
var o provider.Responsibility = runCfg.HeavyClient.Overlay
if runCfg.HeavyClient.MockOverlay.Enabled {
_, _ = fmt.Printf("starting satellite on %s\n",
runCfg.Satellite.Identity.Address)
var o provider.Responsibility = runCfg.Satellite.Overlay
if runCfg.Satellite.MockOverlay.Enabled {
o = overlay.MockConfig{Nodes: strings.Join(storagenodes, ",")}
}
errch <- runCfg.HeavyClient.Identity.Run(ctx,
runCfg.HeavyClient.Kademlia,
runCfg.HeavyClient.PointerDB,
errch <- runCfg.Satellite.Identity.Run(ctx,
runCfg.Satellite.Kademlia,
runCfg.Satellite.PointerDB,
o)
}()

View File

@ -60,7 +60,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
return nil
}
hcPath := filepath.Join(setupCfg.BasePath, "hc")
hcPath := filepath.Join(setupCfg.BasePath, "satellite")
err = os.MkdirAll(hcPath, 0700)
if err != nil {
return err
@ -117,18 +117,18 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
}
overrides := map[string]interface{}{
"heavy-client.identity.cert-path": setupCfg.HCIdentity.CertPath,
"heavy-client.identity.key-path": setupCfg.HCIdentity.KeyPath,
"heavy-client.identity.address": joinHostPort(
"satellite.identity.cert-path": setupCfg.HCIdentity.CertPath,
"satellite.identity.key-path": setupCfg.HCIdentity.KeyPath,
"satellite.identity.address": joinHostPort(
setupCfg.ListenHost, startingPort+1),
"heavy-client.kademlia.todo-listen-addr": joinHostPort(
"satellite.kademlia.todo-listen-addr": joinHostPort(
setupCfg.ListenHost, startingPort+2),
"heavy-client.kademlia.bootstrap-addr": joinHostPort(
"satellite.kademlia.bootstrap-addr": joinHostPort(
setupCfg.ListenHost, startingPort+4),
"heavy-client.pointer-db.database-url": "bolt://" + filepath.Join(
setupCfg.BasePath, "hc", "pointerdb.db"),
"heavy-client.overlay.database-url": "bolt://" + filepath.Join(
setupCfg.BasePath, "hc", "overlay.db"),
"satellite.pointer-db.database-url": "bolt://" + filepath.Join(
setupCfg.BasePath, "satellite", "pointerdb.db"),
"satellite.overlay.database-url": "bolt://" + filepath.Join(
setupCfg.BasePath, "satellite", "overlay.db"),
"uplink.cert-path": setupCfg.ULIdentity.CertPath,
"uplink.key-path": setupCfg.ULIdentity.KeyPath,
"uplink.address": joinHostPort(

View File

@ -1,17 +0,0 @@
# Heavy client
Documentation for developing and building the heavy client service
Usage:
First make an identity:
```
go install storj.io/storj/cmd/hc
hc setup
```
You can edit `~/.storj/hc/config.yaml` to your liking. Then run it!
```
hc run
```

View File

@ -7,7 +7,7 @@ RUN apk update && \
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
COPY . /go/src/storj.io/storj
RUN cd /go/src/storj.io/storj && dep ensure -vendor-only
RUN cd /go/src/storj.io/storj/cmd/hc && go build -o satellite
RUN cd /go/src/storj.io/storj/cmd/satellite && go build -o satellite
# final stage
@ -19,8 +19,8 @@ ENV REDIS_ADDR=redis:6379 \
HTTP_PORT=:8080 \
BOOTSTRAP_ADDR=bootstrap.storj.io:8080
WORKDIR /app
COPY --from=build-env /go/src/storj.io/storj/cmd/hc/satellite /app/
COPY cmd/hc/entrypoint /entrypoint
COPY --from=build-env /go/src/storj.io/storj/cmd/satellite/satellite /app/
COPY cmd/satellite/entrypoint /entrypoint
EXPOSE 8081/udp \
8080 \
7070

17
cmd/satellite/README.md Normal file
View File

@ -0,0 +1,17 @@
# Satellite
Documentation for developing and building the satellite service
Usage:
First make an identity:
```
go install storj.io/storj/cmd/satellite
satellite setup
```
You can edit `~/.storj/satellite/config.yaml` to your liking. Then run it!
```
satellite run
```

View File

@ -19,12 +19,12 @@ import (
var (
rootCmd = &cobra.Command{
Use: "hc",
Short: "Heavy client",
Use: "satellite",
Short: "Satellite",
}
runCmd = &cobra.Command{
Use: "run",
Short: "Run the heavy client",
Short: "Run the satellite",
RunE: cmdRun,
}
setupCmd = &cobra.Command{
@ -47,7 +47,7 @@ var (
Overwrite bool `default:"false" help:"whether to overwrite pre-existing configuration files"`
}
defaultConfDir = "$HOME/.storj/hc"
defaultConfDir = "$HOME/.storj/satellite"
)
func init() {
@ -74,7 +74,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
_, err = os.Stat(setupCfg.BasePath)
if !setupCfg.Overwrite && err == nil {
fmt.Println("An hc configuration already exists. Rerun with --overwrite")
fmt.Println("An satellite configuration already exists. Rerun with --overwrite")
return nil
}

View File

@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: hc
name: satellite
labels:
app: hc
app: satellite
spec:
ports:
- name: grpc
@ -17,14 +17,14 @@ spec:
port: 8080
target: 8080
selector:
app: hc
app: satellite
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hc
name: satellite
labels:
app: hc
app: satellite
spec:
minReadySeconds: 10
revisionHistoryLimit: 3
@ -35,13 +35,13 @@ spec:
template:
metadata:
labels:
app: hc
app: satellite
spec:
terminationGracePeriodSeconds: 60
containers:
- image: "docker.io/storjlabs/hc"
- image: "docker.io/storjlabs/satellite"
imagePullPolicy: Always
name: hc
name: satellite
livenessProbe:
httpGet:
path: /health