Skip to content

Commit

Permalink
Merge pull request #458 from nkryuchkov/feature/rename-visor
Browse files Browse the repository at this point in the history
Renaming to (hyper)visor
  • Loading branch information
jdknives authored Jul 15, 2019
2 parents 354a06c + 6341b1b commit 837c95d
Show file tree
Hide file tree
Showing 72 changed files with 302 additions and 301 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
/skywire/
/local*

pkg/node/apps/
pkg/node/bar/
pkg/node/foo/
pkg/visor/apps/
pkg/visor/bar/
pkg/visor/foo/

/node
/users.db
/hypervisor
/*-node
/*-visor
/*-cli
/*-server
/*.json
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- First release of the mainnet Skywire node and apps for testing.
- First release of the mainnet Skywire visor and apps for testing.
69 changes: 35 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.PHONY : docker-run docker-stop

OPTS?=GO111MODULE=on
DOCKER_IMAGE?=skywire-runner # docker image to use for running skywire-node.`golang`, `buildpack-deps:stretch-scm` is OK too
DOCKER_IMAGE?=skywire-runner # docker image to use for running skywire-visor.`golang`, `buildpack-deps:stretch-scm` is OK too
DOCKER_NETWORK?=SKYNET
DOCKER_NODE?=SKY01
DOCKER_OPTS?=GO111MODULE=on GOOS=linux # go options for compiling for docker container
Expand All @@ -19,27 +19,27 @@ check: lint test ## Run linters and tests

build: dep host-apps bin ## Install dependencies, build apps and binaries. `go build` with ${OPTS}

run: stop build config ## Run skywire-node on host
./skywire-node skywire.json
run: stop build config ## Run skywire-visor on host
./skywire-visor skywire.json

stop: ## Stop running skywire-node on host
-bash -c "kill $$(ps aux |grep '[s]kywire-node' |awk '{print $$2}')"
stop: ## Stop running skywire-visor on host
-bash -c "kill $$(ps aux |grep '[s]kywire-visor' |awk '{print $$2}')"

config: ## Generate skywire.json
-./skywire-cli node gen-config -o ./skywire.json -r

clean: ## Clean project: remove created binaries and apps
-rm -rf ./apps
-rm -f ./skywire-node ./skywire-cli ./setup-node ./manager-node ./SSH-cli
-rm -f ./skywire-visor ./skywire-cli ./setup-node ./hypervisor ./SSH-cli

install: ## Install `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli`
${OPTS} go install ./cmd/skywire-node ./cmd/skywire-cli ./cmd/setup-node ./cmd/manager-node ./cmd/therealssh-cli
install: ## Install `skywire-visor`, `skywire-cli`, `hypervisor`, `SSH-cli`
${OPTS} go install ./cmd/skywire-visor ./cmd/skywire-cli ./cmd/setup-node ./cmd/hypervisor ./cmd/therealssh-cli

rerun: stop
${OPTS} go build -race -o ./skywire-node ./cmd/skywire-node
${OPTS} go build -race -o ./skywire-visor ./cmd/skywire-visor
-./skywire-cli node gen-config -o ./skywire.json -r
perl -pi -e 's/localhost//g' ./skywire.json
./skywire-node skywire.json
./skywire-visor skywire.json


lint: ## Run linters. Use make install-linters first
Expand All @@ -51,10 +51,10 @@ vendorcheck: ## Run vendorcheck
GO111MODULE=off vendorcheck ./internal/...
GO111MODULE=off vendorcheck ./pkg/...
GO111MODULE=off vendorcheck ./cmd/apps/...
GO111MODULE=off vendorcheck ./cmd/manager-node/...
GO111MODULE=off vendorcheck ./cmd/hypervisor/...
GO111MODULE=off vendorcheck ./cmd/setup-node/...
GO111MODULE=off vendorcheck ./cmd/skywire-cli/...
GO111MODULE=off vendorcheck ./cmd/skywire-node/...
GO111MODULE=off vendorcheck ./cmd/skywire-visor/...
# vendorcheck fails on ./cmd/therealssh-cli
# the problem is indirect dependency to github.com/sirupsen/logrus
#GO111MODULE=off vendorcheck ./cmd/therealssh-cli/...
Expand Down Expand Up @@ -90,58 +90,58 @@ host-apps: ## Build app
${OPTS} go build ${BUILD_OPTS} -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

# Bin
bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `SSH-cli`
${OPTS} go build ${BUILD_OPTS} -o ./skywire-node ./cmd/skywire-node
${OPTS} go build ${BUILD_OPTS} -o ./skywire-cli ./cmd/skywire-cli
bin: ## Build `skywire-visor`, `skywire-cli`, `hypervisor`, `SSH-cli`
${OPTS} go build ${BUILD_OPTS} -o ./skywire-visor ./cmd/skywire-visor
${OPTS} go build ${BUILD_OPTS} -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build ${BUILD_OPTS} -o ./setup-node ./cmd/setup-node
${OPTS} go build ${BUILD_OPTS} -o ./messaging-server ./cmd/messaging-server
${OPTS} go build ${BUILD_OPTS} -o ./manager-node ./cmd/manager-node
${OPTS} go build ${BUILD_OPTS} -o ./hypervisor ./cmd/hypervisor
${OPTS} go build ${BUILD_OPTS} -o ./SSH-cli ./cmd/therealssh-cli


release: ## Build skywire-node`, skywire-cli, manager-node, SSH-cli and apps without -race flag
${OPTS} go build -o ./skywire-node ./cmd/skywire-node
${OPTS} go build -o ./skywire-cli ./cmd/skywire-cli
release: ## Build `skywire-visor`, `skywire-cli`, `hypervisor`, `SSH-cli` and apps without -race flag
${OPTS} go build -o ./skywire-visor ./cmd/skywire-visor
${OPTS} go build -o ./skywire-cli ./cmd/skywire-cli
${OPTS} go build -o ./setup-node ./cmd/setup-node
${OPTS} go build -o ./manager-node ./cmd/manager-node
${OPTS} go build -o ./hypervisor ./cmd/hypervisor
${OPTS} go build -o ./SSH-cli ./cmd/therealssh-cli
${OPTS} go build -o ./apps/skychat.v1.0 ./cmd/apps/skychat
${OPTS} go build -o ./apps/skychat.v1.0 ./cmd/apps/skychat
${OPTS} go build -o ./apps/helloworld.v1.0 ./cmd/apps/helloworld
${OPTS} go build -o ./apps/socksproxy.v1.0 ./cmd/apps/therealproxy
${OPTS} go build -o ./apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
${OPTS} go build -o ./apps/SSH.v1.0 ./cmd/apps/therealssh
${OPTS} go build -o ./apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

# Dockerized skywire-node
# Dockerized skywire-visor
docker-image: ## Build docker image `skywire-runner`
docker image build --tag=skywire-runner --rm - < skywire-runner.Dockerfile

docker-clean: ## Clean docker system: remove container ${DOCKER_NODE} and network ${DOCKER_NETWORK}
-docker network rm ${DOCKER_NETWORK}
-docker container rm --force ${DOCKER_NODE}
-docker container rm --force ${DOCKER_NODE}

docker-network: ## Create docker network ${DOCKER_NETWORK}
-docker network create ${DOCKER_NETWORK}

docker-apps: ## Build apps binaries for dockerized skywire-node. `go build` with ${DOCKER_OPTS}
docker-apps: ## Build apps binaries for dockerized skywire-visor. `go build` with ${DOCKER_OPTS}
-${DOCKER_OPTS} go build -race -o ./node/apps/skychat.v1.0 ./cmd/apps/skychat
-${DOCKER_OPTS} go build -race -o ./node/apps/helloworld.v1.0 ./cmd/apps/helloworld
-${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy.v1.0 ./cmd/apps/therealproxy
-${DOCKER_OPTS} go build -race -o ./node/apps/socksproxy-client.v1.0 ./cmd/apps/therealproxy-client
-${DOCKER_OPTS} go build -race -o ./node/apps/SSH.v1.0 ./cmd/apps/therealssh
-${DOCKER_OPTS} go build -race -o ./node/apps/SSH-client.v1.0 ./cmd/apps/therealssh-client

docker-bin: ## Build `skywire-node`, `skywire-cli`, `manager-node`, `therealssh-cli`. `go build` with ${DOCKER_OPTS}
${DOCKER_OPTS} go build -race -o ./node/skywire-node ./cmd/skywire-node
docker-bin: ## Build `skywire-visor`, `skywire-cli`, `hypervisor`, `therealssh-cli`. `go build` with ${DOCKER_OPTS}
${DOCKER_OPTS} go build -race -o ./node/skywire-visor ./cmd/skywire-visor

docker-volume: dep docker-apps docker-bin bin ## Prepare docker volume for dockerized skywire-node
docker-volume: dep docker-apps docker-bin bin ## Prepare docker volume for dockerized skywire-visor
-${DOCKER_OPTS} go build -o ./docker/skywire-services/setup-node ./cmd/setup-node
-./skywire-cli node gen-config -o ./node/skywire.json -r
-./skywire-cli node gen-config -o ./skywire-visor/skywire.json -r
perl -pi -e 's/localhost//g' ./node/skywire.json # To make node accessible from outside with skywire-cli

docker-run: docker-clean docker-image docker-network docker-volume ## Run dockerized skywire-node ${DOCKER_NODE} in image ${DOCKER_IMAGE} with network ${DOCKER_NETWORK}
docker-run: docker-clean docker-image docker-network docker-volume ## Run dockerized skywire-visor ${DOCKER_NODE} in image ${DOCKER_IMAGE} with network ${DOCKER_NETWORK}
docker run -it -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} \
--name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-node skywire.json"
--name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-visor skywire.json"

docker-setup-node: ## Runs setup-node in detached state in ${DOCKER_NETWORK}
-docker container rm setup-node -f
Expand All @@ -150,13 +150,13 @@ docker-setup-node: ## Runs setup-node in detached state in ${DOCKER_NETWORK}
--hostname=setup-node skywire-services \
bash -c "./setup-node setup-node.json"

docker-stop: ## Stop running dockerized skywire-node ${DOCKER_NODE}
docker-stop: ## Stop running dockerized skywire-visor ${DOCKER_NODE}
-docker container stop ${DOCKER_NODE}

docker-rerun: docker-stop
-./skywire-cli gen-config -o ./node/skywire.json -r
-./skywire-cli gen-config -o ./node/skywire.json -r
perl -pi -e 's/localhost//g' ./node/skywire.json # To make node accessible from outside with skywire-cli
${DOCKER_OPTS} go build -race -o ./node/skywire-node ./cmd/skywire-node
${DOCKER_OPTS} go build -race -o ./node/skywire-visor ./cmd/skywire-visor
docker container start -i ${DOCKER_NODE}

run-syslog: ## Run syslog-ng in docker. Logs are mounted under /tmp/syslog
Expand All @@ -166,7 +166,7 @@ run-syslog: ## Run syslog-ng in docker. Logs are mounted under /tmp/syslog
docker run -d -p 514:514/udp -v /tmp/syslog:/var/log --name syslog-ng balabit/syslog-ng:latest


integration-startup: ## Starts up the required transports between 'skywire-node's of interactive testing environment
integration-startup: ## Starts up the required transports between `skywire-visor`s of interactive testing environment
./integration/startup.sh

integration-teardown: ## Tears down all saved configs and states of integration executables
Expand All @@ -192,3 +192,4 @@ mod-uncomm: ## Uncomments the 'replace' rule in go.mod

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Loading

0 comments on commit 837c95d

Please sign in to comment.