Code Monkey home page Code Monkey logo

boyarin's Introduction

Orbs Network Core Node

Orbs is a public blockchain infrastructure built for the needs of decentralized apps with millions of users. For more information, please check https://orbs.com and read the white papers.

This repo contains the node core reference implementation in golang.

The project is thoroughly tested with unit tests, component tests per microservice, acceptance tests, E2E tests and E2E stress tests running the system under load.

Building Docker images only

If you only want to build the Docker images containing the node binaries, you don't need to have golang on your own machine (the node will be compiled inside the image).

  • Make sure Docker is installed.

    Verify with docker version

  • Run ./docker/build/build-docker-node.sh to create node image orbs:export.

  • Run ./docker/build/build-gamma.sh to create gamma image:

    • orbs:gamma-server contains self-sufficient development binary (similar to Ethereum's Ganache) and gamma-cli to communicate with its server counterpart.

Building from source

Prerequisites

  • Make sure Go is installed (version 1.10 or later).

    Verify with go version

  • Make sure Go workspace bin is in your path.

    Install with export PATH=$PATH:`go env GOPATH`/bin

    Verify with echo $PATH

  • Make sure Git is installed (version 2 or later).

    Verify with git --version

  • If you're interested in building Docker images as well, install Docker.

    Verify with docker version

Build

  • Clone the repo to your Go workspace:

    cd `go env GOPATH`
    go get github.com/orbs-network/orbs-network-go
    cd src/github.com/orbs-network/orbs-network-go
    git checkout master
    
  • Install dependencies with ./git-submodule-checkout.sh. To understand dependency management flow please refer to the dependency documentation.

  • Build with go install

  • You can build all the binaries (orbs-node, gamma-cli and gamma-server) with ./build-binaries.sh.

Run

  • To run the pre-built binary (should be in path):

    orbs-network-go
    
  • To rebuild from source and run (this will take you to project root):

    cd `go env GOPATH`
    cd src/github.com/orbs-network/orbs-network-go
    go run *.go
    

Testing from command line

Test runner

We use the official go test runner go test. It has minimal UI and result caching.

Please install go-junit-reporter prior to running tests for the first time:

go get -u github.com/orbs-network/go-junit-report

Test

  • Run all tests using a script:

    ./test.sh

  • Manually run all tests from project root:

    go test ./...

  • Manually run only fast tests (no E2E and similar):

    go test -short ./...

  • Check unit test coverage:

    go test -cover `go list ./...`

Test types

E2E tests (slow)

End-to-end tests check the entire system in a real life scenario mimicking real production with multiple nodes. It runs on docker with several nodes connected in a cluster. Due to their nature, E2E tests are slow to run.

  • The tests are found in /test/e2e
  • Run the suite from project root with go test ./test/e2e

Integration tests (slow)

Integration tests check the system adapters and make sure they meet the interface contract they implement. For example connection to a database or network sockets.

Acceptance tests (fast)

Acceptance tests check the internal hexagon of the system (it's logic with all microservices) with faster adapters that allow the suite to run extremely fast.

  • The tests are found in /test/acceptance
  • Run the suite from project root with go test ./test/acceptance

Component tests (fast)

Component tests check that a single service meets its specification while mocking the other services around it. They allow development of a service in isolation.

Unit tests (fast)

Unit tests are very specific tests that check a single unit or two. They test the unit in isolation and stub/mock everything around it.

  • The tests are found next to the actual unit in a file with _test.go suffix, eg. sha256_test.go sitting next to sha256.go

Testing on Docker

For Troubleshooting, see the Docker Guide

All tests run automatically when the Docker images are built. The script ./test.sh is part of the Docker build.

  • Run ./docker/build/build.sh && ./docker/test/test.sh to build all images and run E2E tests in a dockerized environment.

  • The logs for all E2E nodes will be placed on your machine under the ./_logs directory of the project (and will be overridden on every E2E run).

Component tests on Docker

To detect flaky tests of specific components, run component tests multiple times on Docker:

  • To enable running component tests multiple times, edit test.sh and uncomment the line ./test.components.sh
  • To modify the number of times each component test runs, edit test.components.sh and modify the value of the COUNT variable (you may also need to modify the various timeouts)
  • optional To run a specific test (component, unit, of any other) multiple times (useful when debugging a specific scenario for flakiness), edit test.components.sh, comment the line run_component_tests, then uncomment the line starting with run_specific_test and modify the test name to run that one specific test multiple times on Docker.

After you've finished editing, run ./docker/build/build.sh && ./docker/test/test.sh

You should probably not commit any of these edits you've made for testing, as they are transient in nature.

Developer experience

Git hooks

Please run git config --local core.hooksPath .githooks after cloning the repository.

Debugging issues on Docker

Occasionally, local tests with go test will pass but the same tests on Docker will fail. This usually happens when tests are flaky and sensitive to timing (we do our best to avoid this).

  • Run ./docker/build/build.sh and ./docker/test/test.sh.

  • If the E2E test gets stuck or docker-compose stops working properly, try to remove all containers with this handy command: docker rm -f $(docker ps -aq). But remember that ALL YOUR LOCAL CONTAINERS WILL BE GONE (even from other projects).

  • Debugging the acceptance suite is problematic out of the box, since the debugger (Delve) doesn't support any code importing the plugin package. Luckily, the acceptance suite relies on a fake compiler; to enable debugging:

    • in Goland
      1. Go to Preferences -> Go -> Vendoring & Build Tags
      2. Add the tag nonativecompiler under 'custom tags'
      3. Create a run configuration for the desired test (by clicking the "play" icon to the left of the test name)
      4. Run it once (to create the run config)
      5. Edit the run config and check "use all custom build tags"
      6. Debug your test

IDE

  • We recommend working on the project with GoLand IDE. Recommended settings:

    • Under Preferences | Editor | Code Style | Go make sure Use tab character is checked
  • We reccommend using the same version of Go as per our CI (1.12.9 at the time this line is written)

    • To change Go SDK version in GoLand, go to Preferences | Go | GOROOT, click the + button, choose Download, and choose the version you want to use for this project. As soon as the selected SDK version is installed, GoLand will notify you in the Event Log window. Then go to Preferences | Go | GOPATH and under Project GOPATH choose the location of the SDK you have installed.
  • For easy testing, under Run | Edit Configurations add these Go Test configurations:

    • "Fast" with Directory set to project root and -short flag added to Go tool arguments
    • "All" with Directory set to project root
    • It's also recommended to uncheck Show Ignored tests and check Show Passed in the test panel after running the configuration
    • If you have a failed test which keeps failing due to cache click Rerun Failed Tests in the test panel (it will ignore cache)
  • Running some tests that are unsafe for production deployments requires a special build flag, enable it if you're a core developer:

    • Under Preferences | Go | Vendoring & Build Tags | Custom tags add the tag unsafetests
  • You may enable the following automatic tools that run on file changes:

    • "go fmt" in Preferences | Tools | File Watchers, add with + the go fmt watcher
    • To run tests automatically on save, check Toggle auto-test in the test panel (it's now a core feature of GoLand)
  • Debugging tests may contain very verbose logs, increase console buffer size in Preferences | Editor | General | Console | Override console cycle buffer size = 10024 KB

  • If you experience lags or Low Memory warnings while working with GoLand, increasing its default VM heap size can help:

  • Go to Help | Edit Custom VM Options... and set:

    -Xms256m
    -Xmx1536m
    

Profiling

To enable profiling: put "profiling": true in your config.json.

It will enable net/http/pprof package, and you will be able to query pprof via http just as described in the docs.

Debugging with logs

By default, log output is filtered to only errors and metrics. To enable full log, put "logger-full-log": true in your node configuration. It will permanently remove the filter.

If you want to enable or disable this filter in production, there is a way to do that via HTTP API:

curl -XPOST http://$NODE_IP/vchains/$VCHAIN/debug/logs/fiter-on

Or

curl -XPOST http://$NODE_IP/vchains/$VCHAIN/debug/logs/fiter-off

Development principles

Refer to the Contributor's Guide (work in progress)

License

MIT

boyarin's People

Contributors

bolshchikov avatar itamararjuan avatar jlevison avatar netoneko avatar noambergil avatar ronnno avatar uv-orbs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

thtnt2

boyarin's Issues

Panic in monitoring goroutine

goroutine panicked at [github.com/orbs-network/boyarin/boyar.getVcidFromServiceName:31]: runtime error: index out of range
goroutine 22 [running]:
runtime/debug.Stack(0xc420449c58, 0x1, 0x1)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/orbs-network/boyarin/supervized.recoverPanics()
	/go/src/github.com/orbs-network/boyarin/supervized/supervized.go:42 +0x167
panic(0x93f5c0, 0xce4e30)
	/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/orbs-network/boyarin/boyar.getVcidFromServiceName(0x0, 0x0, 0xe)
	/go/src/github.com/orbs-network/boyarin/boyar/helpers.go:31 +0xc4
github.com/orbs-network/boyarin/boyar.ReportStatus(0xa4cc40, 0xc420098020, 0xa4f500, 0xc420276e40, 0x0, 0x0)
	/go/src/github.com/orbs-network/boyarin/boyar/report_status.go:34 +0x589
main.execute.func1()
	/go/src/github.com/orbs-network/boyarin/boyar/main/main.go:142 +0x8f
github.com/orbs-network/boyarin/supervized.tryOnce(0xc42036c200)
	/go/src/github.com/orbs-network/boyarin/supervized/supervized.go:35 +0x43
github.com/orbs-network/boyarin/supervized.GoForever.func1(0xc42036c200)
	/go/src/github.com/orbs-network/boyarin/supervized/supervized.go:25 +0x2b
created by github.com/orbs-network/boyarin/supervized.GoForever
	/go/src/github.com/orbs-network/boyarin/supervized/supervized.go:23 +0x62

Flexible volume management

volumes on host:
/var/log/orbs-node/{vcid} - logs (you could also put it in /opt/orbs-node and create a symlink under /var/log)
/opt/orbs-node/config/{vcid} - config files
/opt/orbs-node/storage/{vcid} - block persistence (in the future)

per comments on #2

Fix socket leak

ERROR: failed to provision virtual chain 42: error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.38/images/create?fromImage=506367651493.dkr.ecr.us-west-2.amazonaws.com%2Forbs-network-v1&tag=sha256%3A3592a44a647fa05944c354c22088333117efd7f132ff1ff76eaf44c15a915761: dial unix /var/run/docker.sock: socket: too many open files

Next round of feedback

  • Replace Println with t.Log in tests
  • Add messages to ethereum tests
  • Reevaluate if I need ABI utility functions
  • Add unhappy flow test for Test_RawTopology_FederationNodes
  • Rename Ethereum E2E to Ethereum integration
  • Extract GetConfiguration as a separate adapter object

log harvesting mode

add ability to collect nodes output through stdout and log all of them in a single agent.
consider implementing as separate tool

Review feedback

  1. convert e2e to golang
  2. move setup of test out of docker-test.sh and into the e2e test (above)
  3. assert that block height changes (monotonously increasing) over time
  4. flag parsing is weird - investigate: is there a better way?
  5. rename KeysConfigPath to KeyPairConfigFilePath
  6. add an acceptance test mocking FS/Docker adapters
  7. DockerImageConfig - give Prefix a more meaningful name
  8. introduce either FileSystemAdapter or VolumeAdapter ? acceptance tests should not use file system
  9. virtualChainVolumes - clarify for each field whether it is a file or directory path
  10. extract getNetworkConfigJSON to its own unit JSONConfigFileGenerator and add unit tests
  11. push calls to buildDockerNetworkOptions and buildDockerConfig into DockerAPI

Add healthcheck

Check virtual chain health (metrics response) after provisioning.

Needs to be able to output the errors from docker service ps stack-orbs-network-chain-2019 --no-trunc and docker service logs.

Seek and destroy tests flakiness in Boyar

There is a flakiness in Boyar's test which needs to be eliminated even though as per @netoneko it's related to Docker and not poses a real issue I would personally feel more comfortable to see it stable and hopefully get on top of it in the next 2 weeks.

Expose node count metric via HTTP endpoint

Boyar exposes a simple json api for "metrics" (currently only has version data).
See if we can add the number of EC2 instances the scheduler has available to this page.

log file truncates too frequently

Copying issue orbs-network/scribe#13 to this repo since it appears to be a usage issue after adding tests in Scribe

@netoneko wrote:

From auditor node:

tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:12:45.261319Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:13:30.807733Z removed virtual chain node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a vcid=1000 function=boyar.(*boyar).removeVirtualChain.func1 source=boyar/boyar.go:170
info 2019-10-22T09:13:30.807715Z removed virtual chain node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a vcid=1000000 function=boyar.(*boyar).removeVirtualChain.func1 source=boyar/boyar.go:170
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:13:45.260939Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name=http-api-reverse-proxy-stack state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:02Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:13:45.261212Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:13:45.261376Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-15T09:32:28Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:13:45.261505Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:14:31.620999Z waiting to apply new configuration node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a delay=0s function=main.execute.func2 source=boyar/main/main.go:145
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:14:45.261043Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name=http-api-reverse-proxy-stack state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:02Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:14:45.261163Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:15:31.623395Z removed virtual chain node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a vcid=1000 function=boyar.(*boyar).removeVirtualChain.func1 source=boyar/boyar.go:170
info 2019-10-22T09:15:31.623382Z removed virtual chain node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a vcid=1000000 function=boyar.(*boyar).removeVirtualChain.func1 source=boyar/boyar.go:170
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:15:45.261186Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41
tail: /var/log/boyar.log: file truncated
info 2019-10-22T09:15:45.261296Z service status node=d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556 app=boyar version=v0.20.0 commit=89192391aaefbe34d6833233e6c684b91cb18b0a name= state=started workerId=td6ngosb9io3y7xq2u9ts52ya createdAt=2019-10-02T17:59:01Z function=boyar.ReportStatus source=boyar/report_status.go:41

It seems like the truncating happens very often, however, in this commit 2fe68b9#diff-06d71548e4a828db7710d17bfd25432cR27 DEFAULT_TRUNCATE_WINDOW value is 1 week.

Reevaluate boyar provisioning strategy

Right now virtual chains provisions gets aborted on any error, maybe there should be a different approach: fail if X% of chains failed, anything else, etc.

Some demonet vchains are down because of repeated disk errors

ID                          NAME                                   IMAGE                                                                                                          NODE                DESIRED STATE       CURRENT STATE                 ERROR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          PORTS
04ri846sczf3vkh4sdqfttv0x   orbs-network-chain-1003-stack.1        orbsnetwork/node:experimental-js@sha256:cc22b8dfa43a21282b5894b09f37ec742f59568ec851171f7a3dd11097eb5da3       ip-172-31-4-76      Running             Starting 18 seconds ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
ze4zy6mvcp9mjt1b9c9iw9x2b   orbs-network-chain-1000-stack.1        orbsnetwork/node:experimental-extlib@sha256:e777e2b7826c8e045d4eeb0b6f1f521f34fb5bd1c0a605b903bea32180f7a959   ip-172-31-4-76      Running             Starting about a minute ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
d7gyw97219o7q9dewni7on89j   orbs-network-chain-1003-stack.1        orbsnetwork/node:experimental-js@sha256:cc22b8dfa43a21282b5894b09f37ec742f59568ec851171f7a3dd11097eb5da3       ip-172-31-4-76      Shutdown            Failed 29 seconds ago         "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/8008c3ded78f1981e17151e5d8fcedff0010267424b7890377bbd4dad7052f33/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data: no such file or directory\\\"\"": unknown"   
8a4sqd8f8g1ctjpz2ml1cc9sh   orbs-network-chain-1000-stack.1        orbsnetwork/node:experimental-extlib@sha256:e777e2b7826c8e045d4eeb0b6f1f521f34fb5bd1c0a605b903bea32180f7a959   ip-172-31-4-76      Shutdown            Failed about a minute ago     "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/7a7c437806d4abbd9d42134fa9bdeba015c0af3ab082ad33f4118302e4034cf4/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data: no such file or directory\\\"\"": unknown"   
tyi18xyve40sjuethh26940is   orbs-network-chain-1003-stack.1        orbsnetwork/node:experimental-js@sha256:cc22b8dfa43a21282b5894b09f37ec742f59568ec851171f7a3dd11097eb5da3       ip-172-31-4-76      Shutdown            Failed about a minute ago     "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/b5f6f64111b53a18d82a2337c8b7f6f924986b690bf7e3f70be7dd2868ff36ec/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data: no such file or directory\\\"\"": unknown"   
s2cifkyc812j8vfxcgyv1k8b6   orbs-network-chain-1000-stack.1        orbsnetwork/node:experimental-extlib@sha256:e777e2b7826c8e045d4eeb0b6f1f521f34fb5bd1c0a605b903bea32180f7a959   ip-172-31-4-76      Shutdown            Failed 2 minutes ago          "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/eede5320feacd3324eaffd2eeffe0fc4b58e9f6b0e1e11997045bc4c9ab7fe4b/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data: no such file or directory\\\"\"": unknown"   
0durm4th9vvrb1rep225ky7d8   orbs-network-chain-1003-stack.1        orbsnetwork/node:experimental-js@sha256:cc22b8dfa43a21282b5894b09f37ec742f59568ec851171f7a3dd11097eb5da3       ip-172-31-4-76      Shutdown            Failed 3 minutes ago          "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/4709868a97d07e52c2c3908f88d8fab9798a83a23f1c2fecc92145803a529ea2/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data: no such file or directory\\\"\"": unknown"   
fwhx1wak09n8qb7njf7xwzf18   orbs-network-chain-1000-stack.1        orbsnetwork/node:experimental-extlib@sha256:e777e2b7826c8e045d4eeb0b6f1f521f34fb5bd1c0a605b903bea32180f7a959   ip-172-31-4-76      Shutdown            Failed 4 minutes ago          "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/a2ff8cb491ed150b8a0598e8b844a784b87507fcb6992b84fe8e8b4dd4df7ffa/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data: no such file or directory\\\"\"": unknown"   
zph7v0pxh75olhuyg3lxohcgl   orbs-network-chain-1003-stack.1        orbsnetwork/node:experimental-js@sha256:cc22b8dfa43a21282b5894b09f37ec742f59568ec851171f7a3dd11097eb5da3       ip-172-31-4-76      Shutdown            Failed 4 minutes ago          "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/b497a8c61131954b65fd81643ea1ccae65922546ddc31aaac1e1ca6da58b2861/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1003-logs/data: no such file or directory\\\"\"": unknown"   
sabjmywqtd3rotxd8bu7wqv37   orbs-network-chain-1000-stack.1        orbsnetwork/node:experimental-extlib@sha256:e777e2b7826c8e045d4eeb0b6f1f521f34fb5bd1c0a605b903bea32180f7a959   ip-172-31-4-76      Shutdown            Failed 5 minutes ago          "starting container failed: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data\\\" to rootfs \\\"/mnt/data/var/lib/docker/overlay2/40191f9b1a8afef06162b18638d87056c12c7bc62c740c854396f8ce578ad9aa/merged\\\" at \\\"/opt/orbs/logs\\\" caused \\\"stat /mnt/data/var/lib/docker/plugins/bacfb66c29de7b3de1ec20da1403ab6d131c0a5d5376ec1f6df6dd4dd41fc660/propagated-mount/volumes/a328846cd5b4979d68a8c58a9bdfeee657b34de7-1000-logs/data: no such file or directory\\\"\"": unknown"   
r7muqjjmsqnqwkvcrmki08cgc   http-api-reverse-proxy-stack.1         nginx:latest@sha256:aeded0f2a861747f43a01cf1018cf9efe2bdd02afd57d2b11fcc7fcadc16ccd1                           ip-172-31-4-76      Running             Running 57 minutes ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
im4m98jdha38bnk4zmyd66c4v   orbs-node-signer-service-stack.1       orbsnetwork/signer:experimental@sha256:7edfabf21bfc7b3f283e58dc6c7f7af59debba299d43519cb8b1c9c0ada63063        ip-172-31-4-76      Running             Running 57 minutes ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
p77uey14786ns7kunrunjcxhl    \_ orbs-node-signer-service-stack.1   orbsnetwork/signer:experimental@sha256:7edfabf21bfc7b3f283e58dc6c7f7af59debba299d43519cb8b1c9c0ada63063        ip-172-31-4-76      Shutdown            Failed 57 minutes ago         "task: non-zero exit (2)"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
ro3d7ukp94f27uyo8r3nagu18   http-api-reverse-proxy-stack.1         nginx:latest@sha256:aeded0f2a861747f43a01cf1018cf9efe2bdd02afd57d2b11fcc7fcadc16ccd1                           ip-172-31-4-76      Shutdown            Complete 57 minutes ago                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

Review feedback part 2

  1. introduce either FileSystemAdapter or VolumeAdapter ? acceptance tests should not use file system
  2. push calls to buildDockerNetworkOptions and buildDockerConfig into DockerAPI

Review feedback

  • get rid of TestE2E because I don't really need it
  • move logic from boyar main function

Dockerize it

  • Boyar runs as a container in the swarm
  • Boyar can upgrade itself

Report Ethereum node version

Boyar serves a "metrics" page exposing its version number and commit hash.
Add to it the version number and provider (Geth, Parity, etc) of the Ethereum node. This can be achieved using the web3_clientVersion Ethereum RPC call, supported by all providers:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' eth.orbs.com

{"jsonrpc":"2.0","result":"Parity-Ethereum//v2.6.6-beta-5162bc2-20191205/x86_64-linux-gnu/rustc1.39.0","id":67}

Logs missing "service" tag

Log messages reported by Boyar are missing the Service tag (service=boyar), and as a result we can't easily filter out Boyar-related logs in logz.io

{
  "_index": "logzioCustomerIndex191121_v7",
  "_type": "doc",
  "_id": "AW6MkAFCq1R_4Y9gv_1M.account-65212",
  "_version": 1,
  "_score": null,
  "_source": {
    "commit": "89192391aaefbe34d6833233e6c684b91cb18b0a",
    "source": "boyar/report_status.go:41",
    "type": "prod",
    "createdAt": "2019-11-20T11:11:41Z",
    "function": "boyar.ReportStatus",
    "state": "started",
    "app": "boyar",
    "workerId": "go83fvun34ezwsnqgf9kprdgs",
    "level": "info",
    "message": "service status",
    "version": "v0.20.0",
    "tags": [
      "_logz_http_bulk_json_8070"
    ],
    "node": "d5F2f401742568bcb6Fc0fd54C2B2eb1B75f8556",
    "@timestamp": "2019-11-21T06:04:37.864911039Z",
    "_logzio_pattern": 3447044,
    "name": "orbs-network-chain-1000001-stack",
    "vcid": 1000001
  },
  "fields": {
    "@timestamp": [
      1574316277864
    ]
  },
  "highlight": {
    "message": [
      "@kibana-highlighted-field@service@/kibana-highlighted-field@ @kibana-highlighted-field@status@/kibana-highlighted-field@"
    ]
  },
  "sort": [
    1574316277864
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.