grapheo12 / iqps

Web-app meant for qp.metakgp.org
MIT License
20 stars 21 forks source link

Ease out installation #34

Open grapheo12 opened 3 years ago

grapheo12 commented 3 years ago

Currently, the installation process is a bit complicated due to the big fat install.sh script. Turns out it can be made much simpler.

grapheo12 commented 3 years ago

@belongstodzire @pasthorizon @dope-dependent You are assigned to this issue. Please go through the official docs of docker-compose. The issue is already divided into 3 parts. Please choose one and start working. Keep all the communications here.

grapheo12 commented 3 years ago

Please self-assign yourself so that I get to know you have started working.

pasthorizon commented 3 years ago

@belongstodzire do you have any preference as to which part you want to work on?

pasthorizon commented 3 years ago

@grapheo12 can you please explain the utility of the pause-resume mechanism?

abhilashdzr commented 3 years ago

@pasthorizon I do not have any preference as such to work on. Have you something in mind?

pasthorizon commented 3 years ago

@belongstodzire Me and @dope-dependent have started in the pause-resume mechanism. You can pick one from the other two and tell us, so there is no overlap initially at least

abhilashdzr commented 3 years ago

@pasthorizon I will then start with the docker-compose.yml issue. Lets see how much I can progress. :)

dope-dependent commented 3 years ago

Hello @grapheo12 Me (@dope-dependent) and @pasthorizon have been thinking about the pause-resume functionality in theinstall.sh file. We have the following prospective solutions for the same (depending on what pause-resume actually means):-

  1. Pauses after every step is completed. Messages like Press [ENTER] to continue or [Q] to abort or Press [Q] to abort or any other key to continue are displayed. Program will NOT continue until a key is pressed.
  2. Timed Pauses with an input inactivity limit of say 5-7 seconds. If the user doesn't type in anything, installation proceeds. If they press [Q], the program exits. Any other keypress results in immediate continuation.
  3. This solution involves creating multiple checkpoints in the install.sh file. If the process is aborted and started again, installer will start either a fresh installation, or start continuing the previous installion from the last synced checkpoint. These options can be selected via keypresses when the program is started again.

Could you tell us if any of the above mentioned strategies would be sufficient? If they aren't, can you give us a very basic idea of the required functionality?

grapheo12 commented 3 years ago

Great thinking! I actually want the 3rd one.

grapheo12 commented 3 years ago

You can create a temporary hidden file to save the state and delete the same when the script completes.

abhilashdzr commented 3 years ago

When I will be working on the local machine, I would have to run the installation process again on the forked repo?

grapheo12 commented 3 years ago

Yeah, and that too multiple times to test out your code, as far as I belive :-)

abhilashdzr commented 3 years ago

I noticed the .template file differs from the .yml file only by the point that the db, static and log volumes has been given the exact local paths in the .yml one and substituted by a phrase in .template. So why is the template necessary?

grapheo12 commented 3 years ago

If I do not use a template file then the install.sh script will not be able to modify the docker-compose.yml file after the placeholder texts have been replaced, since I use text-based substitution.

abhilashdzr commented 3 years ago

I should have gotten this since docker-compose.yml was not initially present before running ./install.sh.

pasthorizon commented 3 years ago

@grapheo12 for the issue of merging install.sh and init.sh, the install.sh file ends with the docker-compose up command, and the init.sh file starts with docker-compose up -d. Does docker-compose up -d have any other caveat other that running in the background? (Because when we tried to replace the docker-compose up in install.sh with docker-compose up -d, it leads to some exceptions)

abhilashdzr commented 3 years ago

What difference will getting rid of the template.env file make, since the inputs made by the user is only once in the earlier case. Will there be any efficiency issue?

pasthorizon commented 3 years ago

@grapheo12 can we use hard-coded sleep timer to ensure that docker-compose up gets stopped automatically after some time?