Developer Notes

Setting up your environment

Tested on Ubuntu

  1. Install Anaconda or Miniconda

    Visit https://www.anaconda.com/products/individual for instructions

  2. Create Conda Virtual Environment

    conda create -n pistarlab python=3.7
    
  3. Install PIP

    conda install pip
    
  4. Clone Repo and install

    git clone https://github.com/pistarlab/pistarlab
    cd pistarlab
    pip install -e .[all]
    
  5. Install additional dependencies
    • XVFB to render without display (No MS Windows Support)

    • ffmpeg for video processing

    sudo apt-get install -y xvfb ffmpeg
    
  6. Install NPM/Nodejs for UI and Theia IDE

    bash ./install_node.sh
    
  7. Build Web IDE (optional)

    bash ./build_ide.sh
    

on Windows [Experimental]

Limitation: no headless mode for many environments so rendering may open a window

  1. Install Miniconda

  2. Install GitBash

  3. Follow Ubuntu Instructions

Troubleshooting

Building Theia IDE on Windows. * https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#building-on-windows

Install Scoop

See: https://github.com/lukesampson/scoop#installation

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

# or shorter
iwr -useb get.scoop.sh | iex
# IF SCOOP doesn't get added to path
$env:Path += ";C:\Users\${USER}\scoop\shims"

Making changes to the UI

The UI is build using Vuejs cli and requires npm to run. Once setup, changes to the ui source code will be reflected immidiately in the browser.

Option 1: # Start pistarlab with enable_dev_ui argument. Eg: `pistarlab_launcher --enable_dev_ui`

Option 2: #. Run the UI using `npm run serve` #. By default, changes will be reflected at http://localhost:8080

Building for Readonly Viewing

pip install -e . -no-deps
pip install -r requirements-webreadonly.txt

Building for PiPy

  1. Build Redis Server Binary and copy to pistarlab/thirdparty_lib

    bash ./install_redis.sh_
    
  2. Build and deploy UI in pistarlab/uidist/ package directory

    bash ./build_ui.sh
    
  3. Run Tests with tox

    pip install tox
    tox
    
  4. Building wheel and source distribution and view files

    rm -rf build dist *.egg-info &&
    python setup.py bdist_wheel && python -m build --sdist --wheel && unzip -l dist/*.whl
    
  5. Uploading to PiPy

    pip install twine
    twine upload dist/*
    

Building the Documentation

  1. Install dependencies

    pip install -r docs/requirements.txt
    
  2. Rebuild API Docs

    From the project root, run:

    cd docs
    sphinx-apidoc -o source ../pistarlab
    
  3. Update the HTML

    cd docs
    make html
    

Building and Publishing a new Docker Image

Instructions on how to create a docker image from an Ubuntu environment

  1. Make changes to docker file

  2. Update requirements.txt

    
    

    conda create -n pistarlab377 python=3.7.7 conda activate pistarlab377 pip install -e . pip freeze > requirements.txt

  3. Run Docker Build

    
    

    ./build_docker