Dev Mode Setup (Docker)

Prerequisites

Steps

  1. Get the local copy of the UltraViolet source code:
      git clone https://github.com/nyudlts/ultraviolet.git && cd ultraviolet
    
  2. Make sure your Docker Desktop is running. If planning to do sustained work, you may want to increase the memory allocation to at least 4 GB but this isn’t necessary.

  3. Load correct python version in current environment. (Check result with python --version)
      pyenv install --skip-existing
    
  4. Load correct node version (14.x) in current environment. (Check result with node --version)
      nvm install
    
  5. Install and/or update pip, pipenv, and invenio-cli
      pip install -U --upgrade pip pipenv invenio-cli
    
  6. Check Invenio’s requirements
      invenio-cli check-requirements
    
  7. Create an .invenio.private file which is used by the invenio-cli tool
      touch .invenio.private
      echo -e "[cli]\nproject_dir = "$PWD"\nservices_setup = False" >> .invenio.private
    
  8. Add .env file which will contain FLASK_SECRET_KEY
      touch .env
      echo FLASK_SECRET_KEY="some random value" > .env
    
  9. Reset and build application python environment and web assets
      pipenv --rm
      invenio-cli packages lock --pre --dev
    
  10. Due to a known bug in the current version of InvenioRDM we can only use setuptools version smaller then 58.
      pipenv run python3.8 -m pip install 'setuptools~=57.5.0'
    
  11. Complete building application python environment and web assets
      invenio-cli install --pre --development
    
  12. If you have used the Invenio Framework before, this is a good time to make sure that you do not have old images or running containers. (Check Docker troubleshooting tips for helpful commands).

  13. Build application services (database, search, cache) and setup the application for running
      invenio-cli services setup -N
    

    IMPORTANT: if services setup reported any errors, and you have to restart the setup process, make sure to run destroy service command first (or you will get “Failed to setup services” error ) and delete db files by running invenio-cli services destroy and rm -r app_data/db/*

  14. If you do any local UI customization you need to rebuild applications web assets
      invenio-cli assets build --development
    
  15. Start the application.
      invenio-cli run
    

The UltraViolet instance should now be available at this URL: https://127.0.0.1:5000/
Because of the invalid TLS warning, you will need to use Firefox.

You can login using account admin@test.com which you’ve just created and start uploading data.

  1. Quit the application with Ctr-C and spin down the containers with invenio-cli containers stop

Testing only

  1. Get the local copy of the UltraViolet app:
      git clone https://github.com/nyudlts/ultraviolet && cd ultraviolet
    
  2. Create an .invenio.private file which is used by the invenio-cli tool
      touch .invenio.private
      echo -e "[cli]\nproject_dir = "$PWD"\nservices_setup = False" >> .invenio.private
    
  3. Build docker containers using invenio-cli tool
      invenio-cli containers start --lock --build --setup
    

    The UltraViolet instance should now be running at https://127.0.0.1:5000/