V6/y0lan/installer
Proposed Changes
- automatically install otnode without needing user input
someone can run the script using the options and arguments:
--secret
--public --auto (bypass any user input) if --auto then your must have the variable in .env.default setup in your shell OR pass the value as parameters of the script
The idea here is that I was trying to make my own Dockerfile, installing otnode into it using Calvin's script. For that I needed a way to launch it without needing to intervene so that the Dockerfile could run the script and install the node inside the docker automatically.
Did some clean up. Sorry for the useless files added to the request.
Can someone test it out and tell me if they find any misbehaviour ?
Hey there, so I tested your docker build on my testnet that already has a dockerless node running on default rpc port 8900 and port 9000. I went ahead and changed your ubuntu.yaml to 8901, 9001 and changed my RC file accordingly, ran the docker-compose and ended up with this error:
root@TESTNET:~/ot-node2# docker-compose -f docker/docker-compose-ubuntu.yaml pull Pulling graphdb ... done Pulling ot-node ... done root@TESTNET:~/ot-node2# docker-compose -f docker/docker-compose-ubuntu.yaml up Creating graphdb ... done Creating ot-node ... done Attaching to graphdb, ot-node graphdb | [REPO INIT] Starting to check whether repositories need to be initialized. graphdb | [REPO INIT] Could not check the subfolders of directory '/repository.init'. open /repository.init: no such file or directory graphdb | [SPARQL PRELOAD] Starting to check whether SPARQL queries need to be executed. graphdb | [SPARQL PRELOAD] Could not check the subfolders of directory '/repository.init'. open /repository.init: no such file or directory graphdb | /opt/graphdb/bin/graphdb: line 75: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) graphdb | WARNING: Unknown module: jdk.management.agent specified to --add-exports graphdb | [INFO ] 2022-03-12 21:08:08,683 [main | c.o.g.Config] Using 'file:/opt/graphdb/conf/logback.xml' as logback's configuration file graphdb | [INFO ] 2022-03-12 21:08:09,139 [main | c.o.g.s.GraphDB] Starting GraphDB in workbench mode. graphdb | [INFO ] 2022-03-12 21:08:21,082 [main | c.o.g.Config] GraphDB Home directory: /opt/graphdb graphdb | [INFO ] 2022-03-12 21:08:21,082 [main | c.o.g.Config] GraphDB Config directory: /opt/graphdb/conf graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Data directory: /opt/graphdb/data graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Work directory: /opt/graphdb/work graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Logs directory: /opt/graphdb/logs graphdb | [INFO ] 2022-03-12 21:08:26,765 [main | c.o.g.s.GraphDB] Started GraphDB in workbench mode at port 7200. ot-node | * Stopping MySQL database server mysqld ot-node | ...done. ot-node | * Starting MySQL database server mysqld ot-node | ...fail! ot-node exited with code 1
Upon looking at your ubuntu.yaml, it seems to only support graphDB despite me precising blazegraph on the rc file, and for some reason it failed at mysql step. Would that be because of a conflict with the current mysql I am running ? I also noticed you are using forever index.js but the team has since moved on to starting the node as a service, any plans on updating that ? My apologies if my write up is lacking in details, I am not very familiar with docker-compose. I am leaving my setup as it is for now so let me know if there's anything you want me to troubleshoot.
Thanks !
Hey there, so I tested your docker build on my testnet that already has a dockerless node running on default rpc port 8900 and port 9000. I went ahead and changed your ubuntu.yaml to 8901, 9001 and changed my RC file accordingly, ran the docker-compose and ended up with this error:
root@TESTNET:~/ot-node2# docker-compose -f docker/docker-compose-ubuntu.yaml pull Pulling graphdb ... done Pulling ot-node ... done root@TESTNET:~/ot-node2# docker-compose -f docker/docker-compose-ubuntu.yaml up Creating graphdb ... done Creating ot-node ... done Attaching to graphdb, ot-node graphdb | [REPO INIT] Starting to check whether repositories need to be initialized. graphdb | [REPO INIT] Could not check the subfolders of directory '/repository.init'. open /repository.init: no such file or directory graphdb | [SPARQL PRELOAD] Starting to check whether SPARQL queries need to be executed. graphdb | [SPARQL PRELOAD] Could not check the subfolders of directory '/repository.init'. open /repository.init: no such file or directory graphdb | /opt/graphdb/bin/graphdb: line 75: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) graphdb | WARNING: Unknown module: jdk.management.agent specified to --add-exports graphdb | [INFO ] 2022-03-12 21:08:08,683 [main | c.o.g.Config] Using 'file:/opt/graphdb/conf/logback.xml' as logback's configuration file graphdb | [INFO ] 2022-03-12 21:08:09,139 [main | c.o.g.s.GraphDB] Starting GraphDB in workbench mode. graphdb | [INFO ] 2022-03-12 21:08:21,082 [main | c.o.g.Config] GraphDB Home directory: /opt/graphdb graphdb | [INFO ] 2022-03-12 21:08:21,082 [main | c.o.g.Config] GraphDB Config directory: /opt/graphdb/conf graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Data directory: /opt/graphdb/data graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Work directory: /opt/graphdb/work graphdb | [INFO ] 2022-03-12 21:08:21,083 [main | c.o.g.Config] GraphDB Logs directory: /opt/graphdb/logs graphdb | [INFO ] 2022-03-12 21:08:26,765 [main | c.o.g.s.GraphDB] Started GraphDB in workbench mode at port 7200. ot-node | * Stopping MySQL database server mysqld ot-node | ...done. ot-node | * Starting MySQL database server mysqld ot-node | ...fail! ot-node exited with code 1
Upon looking at your ubuntu.yaml, it seems to only support graphDB despite me precising blazegraph on the rc file, and for some reason it failed at mysql step. Would that be because of a conflict with the current mysql I am running ? I also noticed you are using forever index.js but the team has since moved on to starting the node as a service, any plans on updating that ? My apologies if my write up is lacking in details, I am not very familiar with docker-compose. I am leaving my setup as it is for now so let me know if there's anything you want me to troubleshoot.
Thanks !
This pull request is about some code in installer.sh
I did not do any Docker stuff that is working at the moment.
my bad ! saw some changes on docker-compose and thought it was related
Alright take 2 I managed to use the installer without any user input by running installer.sh --secret --public --auto after running export PUBLIC_KEY=yourpublickey export PRIVATE_KEY=yourprivatekey
However, despite having set those variables on .env.default as such: ODE_ENV=development PUBLIC_KEY=mypubkey... PRIVATE_KEY=myprivkey... AUTO=true
I was unable to run installer.sh --secret --public --auto without using the export command first.
Installer exited on this note :
When installer in automatic mode, you need to pass parameters or set PUBLIC_KEY and PRIVATE_KEY variable in your environment
Usage: ot-installer [ -p | --public
I thought putting those keys on the .env.default should allow me not to use export command ? Or I might be wrong. Once I did it though, the installer ran just fine.
One thing I want to add though is the installer might have a conflict with the current one, as the current one has been updated to integrate blazegraph support as well. Other than that, it works !
Hey thanks for the idea! I did not think about that. Fixed i think.
Yes I should do the merge.
Proposed a merge. I Did not test 🦺 !!
Ok, the installer seems to work now with variables set in .env.default !
As a sidenote, if the goal is to allow no user input while running the script, the choice of running blazegraph or graphdb could be added as an option / argument when you run the script, just food for thought.
I think your idea is great to have both options available, either install with option / argument and no user input, or run the installer and input variables as requested.
Cheers !