Skip to content

Setting up a Development Environment

Oliver Kennedy edited this page Sep 18, 2023 · 31 revisions

Setup

Note: These instructions describe how to set up a 2.x development environment. Look at the history of this page if you need instructions for 1.x

These instructions were tested on Debian Bullseye and Ubuntu 21.04 LTS, and should be viable for any ubuntu/debian based distribution of Linux.


Install pyenv

  1. See instructions here.
  2. pyenv has dependencies on several component libraries (e.g., bz2, sqlite3, and readline) which you may need to also install; see guidance here.

Install python3

pyenv install 3.9.5

PyEnv maintains a common build problems page with guidance on how to resolve issues during this step.


Install Java 11 (or 1.8 if necessary)

MacOS/Windows Users:

  • Get the Java 11 SE Development Kit (JDK) here
  • Get the Java 8 SE Development Kit (JDK) here

Debian/Ubuntu Users:

sudo apt install openjdk-11-jdk

Install Scala and Mill via Coursier

  1. Follow the instructions here.
  2. Install Mill: coursier install mill:0.11.1 (mill 0.11.2 is broken due to an upstream issue)

Clone Vizier

The following commands checkout vizier and its python dependencies

git clone https://github.com/VizierDB/vizier-scala.git -b v2.0
cd vizier-scala
pip3 install -r vizier/resources/requirements.txt

Run Vizier

Run Vizier with

mill vizier.run

You should now be able to connect to the Vizier UI at http://localhost:5000

Attention Windows/WSL2 Users: If you get an error about DBus connectivity, make sure you run with the -n flag. You may also need to install a web browser in the WSL2 VM (e.g., sudo apt install firefox)

Attention Chrome Users: If chrome complains that you don't have permission to connect to http://localhost:5000, try running vizier on a different port (e.g., adding the -p 5050 flag will run Vizier on port 5050)

Compile Vizier
mill vizier.compile

Compiled class files will be in out/vizier/compile/dest

Run Test Cases
mill vizier.test
mill vizier.ui.test

The UI test cases require node and jsdom. Install node and then

npm install jsdom

To run a single test case:

mill vizier.test.testOnly [classname]

To run a single example:

mill vizier.test.testOnly [classname] -- ex "[any text in the example label]"
Run Vizier
mill vizier.run [vizier arguments]

Vizier defaults to running on port 5000 on localhost.

Hack on the UI

Vizier takes a few seconds to start. If you're only editing the UI, you can get a faster development cycle by only rebuilding and reloading the resources directory

mill -w vizier.ui.resourceDir

Mill's -w flag watches for changes to files in the UI directory. Any changes will trigger a recompile. Vizier uses the generated resources directory in-situ, so reloading the UI in your web browser will load the updated version.

Publish the Repo
mill vizier.publishLocal
Set up bloop/metals
mill mill.contrib.Bloop/install