Skip to content

Setting up a Development Environment [June 2019]

Oliver Kennedy edited this page Aug 18, 2019 · 7 revisions

Setup

These instructions were tested on Linux Mint 19 and Ubuntu 16, and should be viable for any ubuntu/debian based distribution of Linux.

Install pyenv and python 2.7.16

See instructions here

$> git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$> echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
$> echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
$> echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc
$> source ~/.bashrc
$> pyenv install 2.7.16

Install sbt

See instructions here. The following commands install SBT in /opt/sbt.

$> apt install scala
$> if [ ! -d /opt ] ; then sudo mkdir /opt; fi
$> curl -OL https://piccolo.link/sbt-1.2.8.tgz 
$> sudo tar -zxvf -C /opt sbt-1.2.8.tgz
$> echo 'export PATH="$PATH:/opt/sbt/bin"' >> ~/.bashrc
$> export PATH="$PATH:/opt/sbt/bin"

Install yarn

$> apt install yarn

You may need to set up the repositories for yarn and nodejs.

Install Vizier Stack

Run these commands in the working directory where you plan to edit Vizier.

Install and run Mimir

See instructions here. Make sure SBT is installed and on your path.

$> git clone https://github.com/UBOdin/mimir.git
$> cd mimir.git
$> git checkout mimir-vizier-api
$> sbt compile

Run Mimir-Vizier with

$> sbt runMimirVizier

You can test that the Mimir server is running with:

$> curl http://localhost:8089

Install and run Vizier-API

See instructions here and here.

$> git clone https://github.com/VizierDB/web-api-async.git
$> cd web-api-async
$> git checkout mimir-vizier-api
$> pyenv local 2.7.16
$> pip install git+https://github.com/VizierDB/Vistrails.git
$> pip install -r requirements.txt
$> pip install -e .

Instructions on configuring Vizier-API can be found here. Configuration is done through environment variables, so the easiest thing to do is create a launcher script such as the one below. This will need some massaging if you want to put your development server behind a proxy.

#!/bin/bash

#
# For instructions on configuring this script, see
# https://github.com/VizierDB/web-api-async/blob/master/doc/configuration.md
#

export VIZIERSERVER_ENGINE="MIMIR"
export VIZIERSERVER_NAME="Vizier"
export VIZIERSERVER_BASE_URL="http://localhost"
export VIZIERSERVER_SERVER_PORT="5000"
export VIZIERSERVER_SERVER_LOCAL_PORT="5000"
export VIZIERSERVER_MAX_UPLOAD_SIZE="16777216"
export VIZIERSERVER_DEBUG="True"
export VIZIERENGINE_DATA_DIR="./vizier"
export VIZIERSERVER_PACKAGE_PATH="./resources/packages/common:./resources/packages/mimir"
export VIZIERSERVER_PROCESSOR_PATH="./resources/processors/common:./resources/processors/mimir"

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi


cd $(dirname $0)
FLASK_APP=vizier.wsgi:app flask run

This script, when run will start an API server on port 5000. You can test to see that the server is running with:

$> curl http://localhost:5000

Install, Configure, and Run Vizier-UI

See instructions here.

$> git clone https://github.com/VizierDB/web-ui
$> cd web-ui
$> yarn install

Most UI configuration is in the file public/env.js. The key thing to edit is the API URL, which should point at wherever the API server is being hosted. The configuration listed above would place it here:

  API_URL: 'http://localhost:5000/vizier-db/api/v1/'

By default, this command starts the server on port 8000. If you want to run on a different port, edit package.json and change the line that reads "start": "react-scripts start",, replacing 5001 with the port you want to run on.

"start": "PORT=5001 react-scripts start",

Start the development server with:

$> yarn start

You should now be able to access vizier at http://localhost:8000/vizier-db (replacing 8000 if you chose a different port.)

You can’t perform that action at this time.