Considerit / ConsiderIt

For deliberation and opinion visualization
GNU Affero General Public License v3.0
90 stars 14 forks source link

Developer installation guide issues #143

Open smangham opened 2 years ago

smangham commented 2 years ago

The developer installation guide appears to be a bit out of date. I'm trying to build a Docker image using Ubuntu 14.04 base as suggested and:

I'm not really a big Ruby/Gem/Bundler person so it may be that a bunch of this is just known issues where it doesn't play nice with Docker. But as far as I can tell it's no longer possible to follow those instructions.

tkriplean commented 2 years ago

Hi @smangham!

Sorry about this, you're absolutely right that this installation guide is out of date. How kind of you to say "a bit".

I'd love to update the guide, and get Ubuntu & Mac installation instructions in there. As far as I know, Consider.it has never been run inside of a container like Docker, and I have zero experience creating a containerized install.

Updating these instructions is not a priority for me at the moment unless you're interested in working with me to get a working version for yourself. If you do want that, I will make it a priority and I will try to document the steps to get it to work on a vanilla mac and Ubuntu environment. Please let me know.

FWIW, for local development, I have it running directly on my mac (no VM). In production, I'm running it on Ubuntu 18.04 and 20.04.

smangham commented 2 years ago

Thanks! I've been trying to Dockerize it on a fork (documented my work here), and have it up and running.

I'm aware the 'correct' thing to do would be a proper docker-compose orchestration with a mysql container running alongside a server container based on a ruby image (annoyingly there's no official rails images) and an off-image database file... but I don't actually have any experience of that, I normally just use single Docker images to develop within using PyCharm.

To avoid jumping in at the deep end and introducing a lot of new bugs, I've set it up as a single Docker image based on the deployment guide, and slowly hammered it into shape deviating as little as possible. It should run fine and be accessible on localhost:3001 with either:

  1. docker-compose up .

Or

  1. docker build -t considerit .
  2. docker run --name considerit -p 3001:3001 considerit

Once it's up you can create an account, then use docker exec -it considerit /bin/bash to get a shell inside the running container and use rails -c to give it superadmin as per the example.

It'll let you upload images, name the forum, and create new lists of proposals, but when trying to add a proposal to a list (whatever the settings of the proposal list, or the forum e.g. Forum Plan, Dialogue State, Moderation, Permissions & Roles) I get (on Firefox):

Uncaught TypeError: proposal.roles is undefined
    InitializeProposalRoles roles.coffee:49
    onClick new_proposal.coffee:315
    React 14

Chrome/Chromium also fail but with less descriptive errors. This happens even when I'm defined as a host. role I don't know enough (or, uh, any) Ruby to tell if this is down to some incompatible versions in the framework install, failure to initialise the roles in the DB, or I've just misunderstood something about how the site is supposed to work.

If we can nail down this and get it working I'm happy to write a basic 'running in Docker' guide, and (depending on what the PI on this project wants) use a bit more time to rejig it to use docker-compose.

Though that said, I've just noticed you have the option to stand up a free form through your website which I can only assume he missed, since he only wanted a toy instance to play around with. So I might not actually have a lot more dev time to work on this :/.

tkriplean commented 2 years ago

Hahah, good job burying the lede "Though that said, I've just noticed you have the option to stand up a free form through your website which I can only assume he missed, since he only wanted a toy instance to play around with. So I might not actually have a lot more dev time to work on this :/." Please let the person you're setting up a toy instance for know that I'm available to help if needed travis at consider.it.

This is awesome though, what you managed to do already. I would really appreciate the offer for a "running in Docker" guide.

That error is pretty odd to me. It doesn't look like an error with your setup. It looks like a Consider.it error. But I'm not able to reproduce the error on any of my standing installations. I just pushed a major system upgrade. Could you pull and try again? I'm hoping for a turn-it-off-then-back-on-again kind of resolution.

Is your Docker image at a point where you could share it with me? Like I said before, I'm not familiar with Docker, so it might be fun to try to get it working. I could see if I get the same problem you do then.

smangham commented 2 years ago

Thanks! If you'd like to play around with the Docker version, I just made a quick readme - my fork is here and the usage guide is here.

Unfortunately, pulling the latest version hasn't worked, so I'm not quite sure what could be going on. I noticed that the Google login doesn't work, presumably as I haven't exposed enough ports on the Docker container to talk to Google - so it's possible if the role initialisation relies on external access that might explain it.

You'll probably get a lot of warnings during the image build, too many to be useful for debugging I think. I'm going to spend the next couple of days trying to build this 'properly' with multiple containers and see if that helps. So the current setup might be a bit more immediately comprehensible as it's most like the development guide, but the updated 'proper' setup should hopefully have fewer spurious warnings and weird quirks arising from me forcing Docker to do it all in one container.

I'll definitely pass your email on to the PI. They'd discussed having me to implement a very similar system for a local consultation, but I think it'd be reinventing the wheel but worse and I'll encourage him to just use Consider.it.