SatoshiPortal / cyphernode

Modular Bitcoin full-node microservices API server architecture and utilities toolkit to build scalable, secure and featureful apps and services without trusted third parties
MIT License
364 stars 68 forks source link

v0.8.0 testdeployment.sh fail while cyphernode is ok #250

Closed BHodl closed 2 years ago

BHodl commented 2 years ago

Reproduce the problem Delete all docker images and volumes. Remove start.sh and testdeployment.sh script from the dist dir. With an up to date repo on releases/v0.8.0 branch. ./build.sh cd dist/ ./setup.sh ./start.sh Then the test fail but cyphernode work properly. After further investigation I found out that the test container was mounting cyphernode_container_monitor docker volume while others containers were mounting dist_container_monitor docker volume.

BHodl commented 2 years ago

Also, there is weird log while testing Notifier.

Testing Notifier... listening on [::]:1111 ... connect to [::ffff:172.18.0.14]:1111 from dist_notifier_1.cyphernodenet:37550 ([::ffff:172.18.0.9]:37550) Tue Mar 22 02:35:03 UTC 2022 GET /notifiertest HTTP/1.1 Host: 29a98d9b6674:1111 User-Agent: curl/7.79.1 Accept: / Notifier rocks!

And the Postgres testing

Testing Postgres... postgres:5432 - accepting connections Postgres rocks!

BHodl commented 2 years ago

Both issues are solved, tested and working. See PR #251 for details. La ça rocks! XD

Kexkey commented 2 years ago

Hi @BHodl !

I can't reproduce what you are describing. I created a brand new Debian VM, installed Docker from scratch, git cloned cyphernode, went to dist/ and ran ./setup.sh followed by ./start.sh and everything ran fine. The images (master branch, v0.8.0 tag) were downloaded as expected. Can you reproduce with master/v0.8.0?

kexkey@debian:~$ docker volume ls
DRIVER    VOLUME NAME
local     5c3d29806bfd3986edf2c4449e9f8f970c5e25fac07fc6fc1f28383807d18bbb
local     69da4eb7131045cebcb4ac6a9c34af0262380b2c9c2b8956195129d39b30ce85
local     b29bb568771c8098e20ad576179323be5846ac8ee8bebf942d9a6e3e6dc51a48
local     be8f3916afca20c6fb9e08c4abd2e9f95f9e47a3c759efad4469efc67be52231
local     cyphernode_container_monitor
local     f9fae717bd34194542eb425c38f5bdb494eadec09b09bcadd05ed3cdafd9b9b3
kexkey@debian:~$ 

I have no idea where your dist_container_monitor volume comes from. It's nowhere in the cyphernode project. I've never seen this volume in any of my multiple cyphernode environments.

Can you give me more information about your set?

Thanks!

Kexkey commented 2 years ago

The dist_ prefix on the volume name is the name of the stack. You can find it in start.sh:

<% if (docker_mode == 'swarm') { %>
docker stack deploy -c $current_path/docker-compose.yaml cyphernode
<% } else if(docker_mode == 'compose') { %>
docker-compose -f $current_path/docker-compose.yaml up -d --remove-orphans
<% } %>

Are you using Swarm or docker-compose?

Kexkey commented 2 years ago

Ahh ok I just installed it using docker-compose and I can reproduce now.

kexkey@debian:~/.cyphernode/cyphernode/proxy_docker/app/tests$ docker volume ls
DRIVER    VOLUME NAME
local     3b63ad384244d0a8093b2cd8d4a503d1317c02a60afc651b09aac14dd830a463
local     3c0f508de2e9ea797de2f5401b3d5c27e233a8ca4abcd29b16ccb11a0704d19a
local     5e4012f20c9232c415c03f0dbc344aa816b51192cd2848f2c3cb96f40a9485b5
local     6f4e387b42c7774cf348b9c1a0e0c169a4e232bd95cf5d70d908ed20bde0b3b3
local     23e3ae3c29bbed5bd9721b47d7d1c26066058d1ce3c7ebe862136531c850fa72
local     cyphernode_container_monitor
local     deda92e33cb9a7d7cb7053028367460d409bb4286e3b6e711d4a916a59839ef6
local     dist_container_monitor
local     f4c98f76ac71a49a6aa44c634f78880b41acab483577508f83d1bd4c90224543
kexkey@debian:~/.cyphernode/cyphernode/proxy_docker/app/tests$ 

Ok let's go to your PR! :-D

Kexkey commented 2 years ago

While testing with docker-compose (which I never use!) I noticed the welcome app doesn't even start properly because of the restart_policy condition that is not understood by docker-compose. Only by Docker Swarm.

Ok, so, the simplest solution to fix all that:

Add this just before services: in the file cyphernodeconf_docker/templates/installer/docker/docker-compose.yaml:

name: cyphernode

Also, in the cypherapps repo, we need to remove for each docker-compose.yaml file:

        condition: "any"

I think that would fix a bunch of problems for docker-compose.