These quickstart instructions will get you up and running with nscale in a local development configuration. For more advanced use cases including production configrations on top of AWS please see the documentation.
nscale requires the following to be installed on your machine:
- Docker
- Node.js
- Git
If you are on Mac OS X, you need to install and run boot2docker. Once you have installed boot2docker start it using:
boot2docker init
boot2docker up
IMPORTANT!!!! - Follow the instructions given by boot2docker and ensure that the correct environement variables are set!
If you are on Linux, you will need to install docker. Once you have docker installed and running you will need to add your user account to the docker group. To do this run the following:
sudo usermod -G docker -a `whoami`
You may need to log out and log back in again for this change to take effect. To confirm that you have the appropriate permissions run:
groups
You should see that your user is included in the docker group. If this is not apparent you may need to close your current termial session and login again.
IMPORTANT!!!! nscale will not function correctly unless the group permissions are set as above
We understand that there exist other operating systems, however at this time we do not support nscale on them. If you are feeling brave by all means give it a try, we always appreciate pull requests!!
Check out our document which outlines our favourite ways of installing node.
nscale uses git as a backing store for system configuration and versioning. git can be installed using the package manager on your system of choice (i.e. homebrew on osx, apt-get on ubuntu...)
Once git is installed, it should be configured for use with github if you wish to follow along with the nscale tutorials. You should run the following to set you username and email address:
git config --global user.name "<user name>"
git config --global user.email "<email>"
You will need to configure ssh access to github. See this guide to get ssh keys setup.
nscale can be installed using npm. To install the latest version run:
[sudo] npm install -g nscale
Before running nscale please ensure that the terminal you are running in is correctly configured with the above pre-requisties.
Ensure github is correctly configured by checking the output of the following command
ssh -T -o "VerifyHostKeyDNS yes" [email protected]
Ensure that docker can run correctly by executing the following command
docker ps
Note that this command should run WITHOUT NEEDING SUDO.
IMPORTANT!!! If the above checks do not run cleanly, please go back and check your configuration. Don't even think about starting nscale until this is corrected. Seriously... we mean it - We'll be very sad otherwise :(
Now that everything is configured you are good to start nscale:
nscale start
If you are running on Linux, you need to add yourself to the docker
group before running any nscale
command. To do that:
nscale login
Finally lets check that nscale is good to go by running:
nscale system list
You should see output similar to the following
Name Id
You should now be able to clone and run a small demo application. To do this cd into a new empty working directory and clone the repository:
mkdir ~/work; cd ~/work
git clone [email protected]:nearform/nscaledemo.git
This will create a sub directory named nscaledemo. You now need to link this repository into nscale. By running:
nscale system link nscaledemo
Check that the system was linked in correctly by running a system list command again. Which should now contian the linked system:
nscale system list
Name Id
nscaledemo e1144711-47bb-5931-9117-94f01dd20f6f
In order to work with the demo system we first need to run a compile.
nscale system compile nscaledemo
Once the compile has completed you should be able to list the available containers in the system. Run:
nscale container list nscaledemo
You should see the following output
Name Type Id
root container 85d99b2c-06d0-5485-9501-4d4ed429799c
web process web$2f9f7ddadc8bead84de4a74665085d362b1..
Next you will need to build the example container. To do this run:
nscale container build nscaledemo web
This command will create a docker container ready for nscale to start.
Before we run the system, take a quick look at the revision list:
nscale revision list nscaledemo
This command shows a list of the revisions on this system repository. You will see a number of commits from the repository that was originally cloned plus a fresh commit representing the compile that was executed a few steps above. Go ahead and run the system by executing:
nscale revision deploy nscaledemo latest development
nscale will start the demo container. You can check that all is well by running:
nscale system check nscaledemo development
And check that the web container is running using:
docker ps
You should be able to open a browser and point it to the boot2docker ip address (mac os X) or localhost (linux) port 8000. This should display the string 'hello world'. You can get the boot2docker ip address with the following command:
boot2docker ip
So, you can run:
open http://`boot2docker ip`:8000
If you are interested in learning more about nscale try the nscale tutorials
Back To - Home [logo]: ../_imgs/logo.png [Linux Setup Guide]: Linux-Setup-Guide [Getting Started From Scratch]: Getting-Started-From-Scratch [Getting Started Migrating]: Getting-Started-Migrating