denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Update source install #180

Closed gjost closed 4 years ago

gjost commented 4 years ago

Update INSTALL.srt and configs so that it's easy to install from source on a fresh machine.

ddr-cmdln install is borked on VMs that are not my dev VM:

@geoff.froh 2020-04-13 16:13

TL;DR, there are a number of lower-level errors to resolve in ddr-cmdln on develop before it’s ready to test. The make installs (make install-configs and make install app) both appeared to function correctly with very minor dir chowning issues:

mkdir-ddr-cmdln --------------------------------------------------------
mkdir /var/log/ddr
mkdir: cannot create directory '/var/log/ddr': File exists
make: [Makefile:320: mkdir-ddr-cmdln] Error 1 (ignored)
chown -R ddr.ddr /var/log/ddr
chmod -R 775 /var/log/ddr
mkdir -p 
mkdir: missing operand
Try 'mkdir --help' for more information.
make: [Makefile:323: mkdir-ddr-cmdln] Error 1 (ignored)
chown -R ddr.ddr 
chown: missing operand after 'ddr.ddr'
Try 'chown --help' for more information.
make: *** [Makefile:324: mkdir-ddr-cmdln] Error 1

But when attempting to run ddr in the virtualenv as the ddr user I kept running into errors.

  1. No section [debug] in configs I added it to ddrlocal-local.cfg and that helped

  2. Tabs instead of spaces in: https://github.com/densho/ddr-defs/blob/develop/repo_models/entity.py#L1362 https://github.com/densho/ddr-defs/blob/develop/repo_models/segment.py#L1369 https://github.com/densho/ddr-defs/blob/develop/repo_models/files.py#L683 When I replaced the tabs with spaces, it seemed to solve that problem.

  3. Undefined type in files.py

    (cmdln) ddr@ishigura:/etc/ddr$ ddr
    Traceback (most recent call last):
    File "/opt/ddr-cmdln/venv/cmdln/bin/ddr", line 4, in <module>
    __import__('pkg_resources').run_script('ddr-cmdln==0.9.4b0', 'ddr')
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1446, in run_script
    exec(code, namespace, namespace)
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/ddr_cmdln-0.9.4b0-py3.7.egg/EGG-INFO/scripts/ddr", line 13, in <module>
    from DDR.commands import OPERATIONS, description, epilog
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/ddr_cmdln-0.9.4b0-py3.7.egg/DDR/commands.py", line 13, in <module>
    from DDR import dvcs
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/ddr_cmdln-0.9.4b0-py3.7.egg/DDR/dvcs.py", line 20, in <module>
    from DDR import util
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/ddr_cmdln-0.9.4b0-py3.7.egg/DDR/util.py", line 6, in <module>
    from DDR import identifier
    File "/opt/ddr-cmdln/venv/cmdln/lib/python3.7/site-packages/ddr_cmdln-0.9.4b0-py3.7.egg/DDR/identifier.py", line 444, in <module>
    from repo_models.elastic import ELASTICSEARCH_CLASSES
    File "/opt/ddr-defs/repo_models/elastic.py", line 56, in <module>
    from . import collection, entity, segment, files
    File "/opt/ddr-defs/repo_models/files.py", line 187, in <module>
    'model_type': long,
    NameError: name 'long' is not defined (edited)
gjost commented 4 years ago

Provisionally fixed in ddr-cmdln commit 3a9bf9f and ddr-defs commit 4af7575. IMPORTANT: these fixes are on the develop branches. To install properly, you will need to run git checkout develop on ddr-cmdln after cloning and again on ddr-defs after downloading using make get.

gjost commented 4 years ago

Fixed in ddr-cmdln commit 4d52bd2 for package ddrlocal-_5.0.0-rc1~deb10.