Logging into SquareScale¶
To login using your GitHub account, simply click on the following link on the SquareScale homepage:
Checking SquareScale account status with Travis CI¶
Every SquareScale account is automatically synchronized with the corresponding Travis CI account if available (both free and pro accounts). To know if everything is correctly connected, click on your name on the top right and click on “me”.
Creating a project¶
To create a new SquareScale project a handful of steps, click on the following button on the homepage:
- Then choose a name for your project:
- Choose an infrastructure type (HA or development):
- Select a managed database server and its size (or no DBMS if you don’t need one):
- Add the Slack URL for this project’s notifications if you have it:
- Finally click on the “create project” button to create it with all the above parameters:
- A few minutes later, your platform is available:
To delete an existing SquareScale project…
Integrating Slack into a SquareScale project¶
It’s possible to send all notifications to a Slack channel, using a custom Slack hook. You can create a custom Slack hook at the following URL: https://<your_company>.slack.com/apps/manage/custom-integrations .
To add this URL, navigate to the Settings tab of the project and click on “update”:
Here’s a sample SquareScale notification on a Slack channel:
Setting up a service from a GitHub Repo¶
Our goal here is to add the GitHub repository available at https://github.com/sjourdan/hello to the SquareScale project named “yet-another-project”. Also, our project is simple and can be built only with the “internal” builder (a simple
The code from the repository, once built as a Docker image, will be available as a SquareScale service.
- To add a service, from the “Overview” tab of the project, click on “Add service”:
- Select “GitHub” as a source, “Internal” as the builder and enter the project’s GitHub URL:
Note: Travis CI can very well be also selected, but it needs some dedicated configuration, out of focus for this quick documentation.
- Click on “Add Service” and wait for the project’s Docker image to build and launch.
You’ll be presented with the service configuration tab immediately after, with a live dashboard of the build and deployment status:
The overview tab lists all the services running and their status:
Setting up a service from a Docker image¶
To create a service from an already existing Docker image is easy:
- From the “Overview” tab of the project, click on “Add service”:
- Select “Docker” as a source and enter it’s name:tag (Docker Hub public image only)
- You can add image from a private Docker Hub repository.
You just need to check the option and fill in your Docker Hub credentials
- Click on “Add Service” and wait for the image to download and launch.
You’ll be presented with the service configuration tab immediately after, with a live dashboard of the deployment status:
Listing running services on a project¶
To list available services, their status, and the number of instances for each of them, go to the “Overview” tab:
Accessing details about a service¶
Lots of details are available about a SquareScale service. To access them, from the “Overview” tab, click on the “settings” icon (the wheel);
Once in the service details tab, you can access the following information and configuration options:
- number of service instances
- change the default run command
- change the update command to be launched before run (like a database migration)
- service requirements like memory limits
- access/add/change dedicated environment variables
- find service restart webhook
This is useful when you want to force your service to restart.
Scaling up & down the number of instances of a service¶
If you want to scale up or down and change the number of instances of a given service (sjourdan/hello in this example), you can set it directly in the service tab:
Validate and you’re done. See the result on the “Overview” tab:
Setting a memory constraint on a service¶
It’s easy to mitigate memory leaks consequences or optimize memory usage of a service, using the memory constraint feature. Whether you’re interested in minimizing the memory usage of your service, or imposing a high memory reservation for an important service, you can use the following:
- Go to the service setting tab
- Change the memory requirement:
If the memory requirement can’t be met, you’ll be notified.
Overriding the command or arguments of a service¶
To override the default container command or its arguments (wether the
Dockerfile uses a
CMD or an
- Go to the service setting tab
- Change the default run command:
Now the sjourdan/hello service will run with the
--enable-hidden-feature=true argument until you remove it.
Force restarting a service manually¶
This feature is here to help you on the path to Continuous Deployment.
When you add a service from a GitHub repository, we listen to updates on the repository.
Your service stays up-to-date by rebuilding and restarting each time a new commit is done on your
When using a private Docker image, we have no way to know when a new version of the image:tag is available.
This is where schedule webhook is useful: it allows you to trigger a restart of the service whenever you want, typicaly after you push a new version of your image:tag on your registry.
You could for example setup a webhook on your private Docker Hub repository using the schedule webhook URL of your service.