Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer installation guide issues #143

Open
smangham opened this issue Jul 25, 2022 · 4 comments
Open

Developer installation guide issues #143

smangham opened this issue Jul 25, 2022 · 4 comments

Comments

@smangham
Copy link

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:

  • It doesn't pin the version of Bundler it wants, which means it tries a recent version that then requires you to use a newer version of Ruby and Gem than the pinned versions.
  • The Gemfile.lock pins minitest (~> 5.1), which requires Ruby > 2.6, though the instructions pin 2.2.
  • The command to install Bundler uses arguments that aren't valid for 2.1.4, the version the lock file was made with - it should be --no-document instead of --no-rdoc --no-ri (I think?)
  • SQLite3 is required as a system-level install for some of the NPM packages but missed from the apt install earlier.
  • Some of the packages just won't download full stop, which looks like it might be because the Ubuntu 14.04 versions of Node and NPM are now too old to read some of the packages from the NPM lists (at the very least, you have to override the certificate requirements because they've timed out)

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
Copy link
Member

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
Copy link
Author

smangham commented Aug 8, 2022

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
Copy link
Member

tkriplean commented Aug 10, 2022

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
Copy link
Author

smangham commented Aug 17, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants