Skip to content
Mike Holt edited this page Oct 17, 2018 · 4 revisions

Setting up a development environment

After cloning the Scale repo locally run one of the operating system specific setup scripts found in /scale/environment for your platform.

Development Platforms

Scale development requires a local Postgres database with PostGIS extensions installed. The easiest way to get started on most platforms is with a Docker container and all the bootstrap configurations described, except Cloud9, use this method. The following are the baseline prerequisites for Scale development:

  • Running Docker Community Edition 1.11+ Engine (use Docker for Windows or Mac on those platforms)
  • Python 2.7.x The core Scale team uses JetBrains PyCharm or Cloud9 IDE for development. These are in no way required but are our preferred choices.

Cloud IDEs

Cloud9 and Codeanywhere come with built in support for Postgres / PostGIS databases, making development of Scale both portable and quick to start using a hosted cloud environment. Cloud9 requires an AWS account, while Codeanywhere can be used without providing any payment information. Both providers offer a hosted workspace option that are built with Ubuntu containers and our init script will get you up and running quickly. Once your workspace has initialized, open the terminal and enter the following commands to initialize for development:

# Change to Python code directory
cd scale
# Initialize database and install Scale Python packages.
sudo sh environment/cloud-init.sh

Virtual environments have not been used for cloud IDE providers as workspaces are already sandboxed eliminating the need to isolate dependencies per project.

Linux

Platform specific prerequisites:

  • Root access on CentOS7 / RHEL7 Linux OS From a fresh clone of Scale run the following commands to initialize your environment:
# Change to Python code directory
cd scale
# Initialize database and install native dependencies.
sudo sh environment/cent7-init.sh
# Activate virtualenv
source environment/scale/bin/activate

Going forward, anytime you need to develop Scale, just activate your virtualenv and you're ready:

# Activate virtualenv
source environment/scale/bin/activate

MacOS

Platform specific prerequisites:

  • Homebrew
  • Docker for Mac 1.17 installed and running From a fresh clone of Scale run the following commands to initialize your environment:
# Change to Python code directory
cd scale
# Initialize database and install native dependencies.
sh environment/mac-init.sh
# Activate virtualenv
source environment/scale/bin/activate

Going forward, anytime you need to develop Scale, just activate your virtualenv and you're ready:

# Activate virtualenv
source environment/scale/bin/activate

Windows (10+ only)

Platform specific prerequisites:

REM Change to Python code directory
cd scale
REM Initialize database and configure Scale to point to it.
environment\win-init.bat
REM Activate virtualenv
environment\scale\Scripts\activate.bat

Going forward, anytime you need to develop Scale, just activate your virtualenv and you're ready:

REM Activate virtualenv
environment\scale\Scripts\activate.bat
Clone this wiki locally