Closed strophy closed 1 month ago
@shumkov can you give me instructions to reproduce this? When I run:
mn setup testnet
mn start
mn stop
mn config:set core.rpc.port 12345
mn start
The port is reconfigured in the template by mn-bootstrap as expected. The changed environment variable also causes docker-compose to rebuild all containers (example from my branch piping docker-compose stdout to process.stdout):
strophy@W540:~/Code/mn-bootstrap$ mn start
✔ Start testnet full node
✔ Check node is not started
✔ Start services
Starting dash_masternode_testnet_drive_mongodb_1 ... done
Recreating dash_masternode_testnet_core_1 ... done
Recreating dash_masternode_testnet_drive_abci_1 ... done
Recreating dash_masternode_testnet_sentinel_1 ... done
Recreating dash_masternode_testnet_dapi_insight_1 ... done
Recreating dash_masternode_testnet_dapi_tx_filter_stream_1 ... done
Recreating dash_masternode_testnet_drive_tenderdash_1 ... done
Recreating dash_masternode_testnet_dapi_api_1 ... done
Recreating dash_masternode_testnet_dapi_envoy_1 ... done
Recreating dash_masternode_testnet_dapi_nginx_1 ... done
Which settings were not applied for you?
You can try to change any options which are passed as envs to containers in docker-compose config. For example platform.drive.log.level
.
core.rpc.port
is passed as envs to containers, see here: https://github.com/dashevo/mn-bootstrap/blob/v0.18-dev/docker-compose.platform.yml#L26
Changing a config option that is passed as an env causes docker-compose to recreate the container next time it launches, because the envs have changed. The behaviour you are requesting seems to already be the case for me.
mn setup testnet
mn start
mn exec -it dash_masternode_testnet_drive_abci_1 /bin/sh
--> echo $LOGGING_LEVEL // output is "info"
--> exit
mn stop
mn config:set platform.drive.abci.logl.level debug
mn start // output is "Recreating dash_masternode_testnet_drive_abci_1 ... done"
mn exec -it dash_masternode_testnet_drive_abci_1 /bin/sh
--> echo $LOGGING_LEVEL // output is "debug"
--> exit
Oh.. My bad. Sorry for the confusion.
I think I got the problem. I've created .env
file using mn config:envs -o .env
and even if we run docker-compose from NodeJS it still reads this outdated .env
file. Could you please check it, please?
If my idea is valid, maybe we should check on node start that .env
is present and throw an error with a message something like "conflicting configuration detected in .env
please remove it and use mn config
to configure the node?
@strophy can you confirm shumkovs notion of the issue and is it still current in v.20 master?
Fixed
Any changes to config that affect the configuration of a container will not be applied until the container is destroyed and recreated.
Expected Behavior
Changing config and restarting containers should apply config changes
Current Behavior
Changing config and restarting containers keeps the old config
Possible Solution
It should be possible to force docker-compose to rebuild the containers with new settings from images when restarting
Steps to Reproduce (for bugs)
Context
Cannot reconfigure nodes
Your Environment