Dev Mode Setup (Docker)
Prerequisites
- Docker
- Installation instructions
- Check for successful installation with
docker --version
- Simple Python Version Management (Pyenv)
- Installation instructions
- Check for successful installation with
pyenv --version
- Node Version Manager (NVM)
- Installation instructions
- Check for successful installation with
nvm --version
- NOTE: if after nvm installation you are getting
nvm: not found
you can use the following troubleshooting tips. You may also want to configure your Bash profile to automatically recognize a specificnvm
environment See this post for more info.
- Node Package Manager (NPM)
- Installation instructions
- Check your version with
npm --version
- When having version >= 7, run:
echo "legacy-peer-deps = true" >> ~/.npmrc
- Cairo
- Postgres
- ImageMagick
Steps
- Get the local copy of the UltraViolet source code:
git clone https://github.com/nyudlts/ultraviolet.git && cd ultraviolet
-
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.
- Load correct python version in current environment. (Check result with
python --version
)pyenv install --skip-existing
- Load correct node version (14.x) in current environment. (Check result with
node --version
)nvm install
- Install and/or update pip, pipenv, and invenio-cli
pip install -U --upgrade pip pipenv invenio-cli
- Check Invenio’s requirements
invenio-cli check-requirements
- Create an
.invenio.private
file which is used by the invenio-cli tooltouch .invenio.private echo -e "[cli]\nproject_dir = "$PWD"\nservices_setup = False" >> .invenio.private
- Add .env file which will contain FLASK_SECRET_KEY
touch .env echo FLASK_SECRET_KEY="some random value" > .env
- Reset and build application python environment and web assets
pipenv --rm invenio-cli packages lock --pre --dev
- 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'
- Complete building application python environment and web assets
invenio-cli install --pre --development
-
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).
- 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
andrm -r app_data/db/*
- If you do any local UI customization you need to rebuild applications web assets
invenio-cli assets build --development
- 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.
- Quit the application with
Ctr-C
and spin down the containers withinvenio-cli containers stop
Testing only
- Get the local copy of the UltraViolet app:
git clone https://github.com/nyudlts/ultraviolet && cd ultraviolet
- Create an
.invenio.private
file which is used by the invenio-cli tooltouch .invenio.private echo -e "[cli]\nproject_dir = "$PWD"\nservices_setup = False" >> .invenio.private
- 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/