Skip to content

WISE Local Development using Windows Subsystem for Linux (WSL)

Jonathan Lim-Breitbart edited this page Nov 18, 2019 · 26 revisions

Enable Windows Subsystem for Linux and install a Linux distribution

Follow the instructions here: https://docs.microsoft.com/en-us/windows/wsl/install-win10. (I'm using Ubuntu from the Windows Store for my Linux distribution)

Set your Linux distribution to use WSL 2 (if supported)

Depending on your version of Windows, your system may support WSL 2, which includes a native Linux kernel and significant performance improvements.

Ensure that you are using WSL 2 on supported systems by following these instructions: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install.

Install WISE

Start the Linux distro and complete initialization (if you haven't already done so): https://docs.microsoft.com/en-us/windows/wsl/initialize-distro.

1. Install Maven

$ sudo apt install maven
$ mvn -v

You should see output similar to:

Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.4, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.19.79-microsoft-standard", arch: "amd64", family: "unix"

2. Install Node & NPM

The following steps follow these instructions for install Node using nvm: https://gist.github.com/noygal/6b7b1796a92d70e24e35f94b53722219.

$ sudo apt-get install build-essential
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
$ nvm install --lts
$ nvm use --lts
$ echo "nvm use --lts" >> .bash_profile

Run node -v and npm -v to verify installation.

3. Install Redis

Instructions for Ubuntu: https://anggo.ro/note/installing-redis-in-ubuntu-wsl/. (May vary slightly depending on your Linux distro).

Once Redis is installed, run redis-cli config set notify-keyspace-events Egx

4. Install Git, clone WISE project, install dependencies

$ sudo apt install git
$ git clone https://github.com/WISE-Community/WISE.git
$ cd WISE
# install node dependencies
WISE $ npm install
WISE $ chmod u+x wise.sh

5. Install MySQL and create WISE database

Install MySQL and start service

WISE $ sudo apt install mysql-server
WISE $ sudo service mysql start

Create WISE database and user:

# login as root (or set a password for root user and run `mysql -u root -p`)
WISE $ sudo mysql
# create new user wiseuser, password wisepass
mysql> create user 'wiseuser'@'localhost' identified by 'wisepass';
# create wise_database
mysql> create database wise_database default character set=utf8;
# give wiseuser access to the new database
mysql> grant all privileges on wise_database.* to 'wiseuser'@'localhost';
mysql> flush privileges;  
mysql> exit;

Create tables for wise_database by reading in the src/main/resources/wise_db_init.sql file:

# create tables for wise_database and load it with initial values
WISE $ mysql wise_database -u wiseuser -p < src/main/resources/wise_db_init.sql

6. Run WISE

Build the applications: npm run build-dev-all (development mode) or npm run build-prod-all (production mode)

Start WISE: ./wise.sh

Clone this wiki locally