usgo / online-ratings

AGA Online Ratings protocol and implementation
MIT License
23 stars 12 forks source link

Difficulty with dev setup for Ubuntu 16.04 #82

Open nshiff opened 7 years ago

nshiff commented 7 years ago

seigenblues mentioned on reddit that the project was interested in some frontend work. I don't see any to-dos for frontend, so I figured I would clone the project and just see the state of things. I'm attempting to follow along with the readme instructions, but here's where I am.

  1. Install Python3 - ok

  2. Install pip - ok

  3. Install postgres - this seemed to work. On my version Ubuntu 16.04, there is the package postgresql and postgresql-9.5. In order to get 9.4, I used the linked instructions to use an alternate repository. This seemed to work.

  4. Install the python dependencies with pip. - This does not appear to be working. Here's what I have.

~/src/online-ratings/web$ pip install -r requirements.txt
<snip, lots of ok-looking output>
  Skipping optional fixer: idioms
  Skipping optional fixer: set_literal
  Skipping optional fixer: ws_comma
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090505 -DHAVE_LO64=1 -I/usr/include/python3.5m -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.5/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for psycopg2
  Running setup.py clean for psycopg2

Failed to build psycopg2

I found a few references on Stack Overflow with failures to build this package, but none of the suggestions worked for me (installed autotools, ran pip with sudo).

  1. Run the tests! - ok

Linux: Install docker and docker-compose - ran hello-world with success

$ cp .env_example .env
$ docker-compose build
WARNING: Please be aware that .yml is the expected extension in most cases, and using .yaml can cause compatibility issues in future.

ERROR: In file './docker-compose.yaml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.

So I commented out the "version" line, but then fail with:

WARNING: The DB_NAME variable is not set. Defaulting to a blank string.
WARNING: The DB_USER variable is not set. Defaulting to a blank string.
ERROR: Validation failed in file './docker-compose.yaml', reason(s):
Unsupported config option for 'volumes' service: 'pgdata'
Unsupported config option for 'services' service: 'psql'

I don't understand... I modified .env with the values for an empty database I set up in Postgres. Any tips appreciated.

brilee commented 7 years ago

Can you run docker --version?

brilee commented 7 years ago

They changed the docker-compose.yml file format in 1.8 I think, to accept a new version: '2' config, so if you have a really old version for some reason, it won't understand the new version.