Written by

We released the Services fea­tures: you’re now able to run arbi­trary head­less pro­grams on your account in sand­boxed con­tain­ers, with­out extra-per­mis­sions needs!

always­da­ta is an advanced Cloud Platform allow­ing its users to host as many web­sites and Web Apps as they want. The plat­form embeds a large range of fea­tures, from lan­guages (PHP, Python, Node, Go, etc) to DevOps-ori­ent­ed func­tion­al­i­ties (SSH access, Scheduled tasks, etc). They all come with­out restric­tions but per­mis­sions: you can­not run a pro­gram with root priv­i­leges as we han­dle the over­all plat­form sys­tem and sta­bil­i­ty1).

Letting you run­ning your own cus­tom pro­grams in a head­less mode, like dae­mo­nized process­es, was an impor­tant need for many of our users. Here they are!

At Her Majesty’s Service

So we intro­duced Services for every­one, from Cloud to Catalyst users. They are cus­tom pro­grams run­ning in a non-inter­ac­tive mode, with­out any user’s action. Because the Platform already embeds any­thing you may need as depen­den­cies for those pro­grams (inter­preters, libraries, etc), you won’t be restricted.

The most inter­est­ing part of ser­vices is the mon­i­tor­ing abil­i­ty: because they’re designed to be run as a back­ground process, the sys­tem observes the exe­cu­tion and restart it as soon as it dies, ensur­ing your process is always up and ready with­out any action from your side. Unlike the Sites process­es, killed and restart­ed on-demand by our front-end proxy, the Services are avail­able with­out inter­rup­tion and mon­i­tored to stay up.

Declaring a Service

Our doc­u­men­ta­tion was updat­ed to add the Services sec­tion and help you declare them in your admin­is­tra­tion panel.

As in Scheduled Tasks, you do have to declare the com­mand to run. This is the only manda­to­ry para­me­ter need­ed for a new Service to be ready. The com­mand may or may not be already avail­able on the plat­form. You’re free to add your own pro­grams2) in your account user space.

By default, your Service runs in an iso­lat­ed process3) and is not avail­able from out­side unless you explic­it­ly expose it4). You may want to reach them exter­nal­ly for some use-cas­es. To do so, attach your run­ning Service process to the :: IPv6 address and pick a port avail­able in the range 8300-8499. Thanks to our con­tainer­iza­tion archi­tec­ture, the full range is acces­si­ble and reserved to your user, even for the Cloud Platform. Be care­ful: your process is pub­licly avail­able this way, and you do have to enable authen­ti­ca­tion when needed.

Advanced: Custom Monitoring

In some cas­es, you may need to observe your Service exe­cu­tion to trig­ger its restart­ing process based on spe­cif­ic cri­te­ria rather than a sim­ple process status.

You’re allowed to spec­i­fy a cus­tom Monitoring Command. The Services’ super­vi­sion process will use it to deter­mine if the asso­ci­at­ed process needs to be restart­ed or not.

You’ve Got the Power!

Run Your Own Queue Messaging Schedulers

Using queue sched­ulers (and their asso­ci­at­ed bro­kers) in your pro­grams is one of the top-10 use-case asked by our users. For Catalyst users, the fea­ture is built-in as they run in a com­plete­ly iso­lat­ed envi­ron­ment, and the fea­ture is avail­able for a while now.

It’s more com­pli­cat­ed for our Cloud users. Because they share hard­ware resources, we could­n’t sim­ply run a process con­tin­u­ous­ly for secu­ri­ty rea­sons. Now, thanks to Services, every user can run its own instance as a Service and access it on a ded­i­cat­ed port belong­ing to the run­ning user only! Smart and simple.

Because our Cloud plat­form is par­tic­u­lar­ly loved by Pythonistas, you’ll be pleased to learn that run­ning a Celery process (asso­ci­at­ed to a RabbitMQ, already avail­able, or a Redis in its own instance) became as sim­ple as declar­ing a Site ! And because Celery is a wide­ly used queue sched­uler, you’re not only lim­it­ed to Python. Feel free to run it With your most pop­u­lar Node.js, Ruby, or even PHP apps!

Upgrade Your Perfs

Web apps may be a huge con­sum­ing process when you need to com­pute large respons­es to some requests, like in API or per­son­al cloud solutions.

Software design­ers often rely on caching solu­tions to speed up those apps. Some strate­gies were already avail­able, like Memory Caching using APCu. For more advanced strate­gies you may want to rely on bina­ry cache stor­ages sys­tems. Memcached is one of them, and a large­ly adopt­ed solu­tion, avail­able for every web language.

To run your own Memcached instance, sim­ply run it as a Service by attach­ing it to an avail­able port in the range 8300-8499. Your pri­vate Memcached instance will be avail­able for your web process­es at service-[account].alwaysdata.net:[port]!

Connect with your team

Need to self-host a solu­tion to stay in touch with your team or loved ones? Mattermost is a free, open-source alter­na­tive to tools like Slack or Discord. As a mes­sag­ing sys­tem, a Mattermost serv­er needs to be con­tin­u­ous­ly accessible.

With Services, you can now eas­i­ly host a Mattermost instance that will be mon­i­tored by the plat­form, ensur­ing its avail­abil­i­ty 24/7!

Observability for Your Apps

Observability is a key for per­for­mance and issues improve­ments in terms of soft­ware engi­neer­ing. Web apps are no excep­tion. The most renowned solu­tion avail­able to mea­sure, detect, and pre­vent inter­rup­tion of ser­vices is Datadog which suits very-well to the Web ecosystem.

Running the Datadog’s agent on your cloud account may require advanced priv­i­leges you don’t have. Now you free to run it sim­ply by fol­low­ing the Datadog Basic Agent Usage doc­u­men­ta­tion with­out extra need. Run the agent start process as a Service, and start to col­lect met­rics on your apps!

The exam­ples above are just a lit­tle part of the infi­nite pos­si­bil­i­ties unleashed by the Services fea­tures! You can expect to run an IRC Bouncer like ZNC, Messaging bots like Telegram BotFather, or a Virtual X Server like xvfb to inter­act with when using solu­tions depend­ing on graph­ics ren­der­ing like QGIS Server.


So let’s grab a free account on the plat­form and start to run your own pri­vate Services right now!

We’re also curi­ous about what you’ll want to run in head­less mode. Let us know in the comments!

Notes

Notes
1 Have a look at SaaS, PaaS, IaaS, what are the dif­fer­ences for more details on that topic.
2 x86_64 com­pat­i­ble
3 Like any oth­er process run by your user
4 For Catalyst users only