Hello everyone, this is a project I’ve been working for my Master’s Thesis for the last few months (since December roughly). It’s an SDK for the cloud that also has deployment capabilites. The project can be seen here Nomad at GitHub
Nomad
Create cloud portable Elixir and Phoenix apps. Write once, use everywhere!
What is the Nomad Project?
Nomad is an Open-Source API for Elixir that enables developer to use the most popular cloud providers interchangeabily at will without having to change any of their code. Nomad provides generic API’s for cloud services (mainly Virtual Machines, Storage, SQL and JSON datastores). These API’s offer the most useful features and functionalities that are common across the same kind of service between cloud providers. They are meant to be simple and user friendly. This enables applications to be portable and allows the migration of applications from one provider to the next.
Moreso Nomad offers Mix Tasks for automatic management of cloud resources for your application. Need a SQL database in the Cloud for your application? Create it and automatically configure your app to use the one you just created. Want to host your Phoenix app in the Cloud? Launch a Virtual Machine through Nomad Mix Tasks and let it automatically deploy a production release of your app in said VM.
This project is my subject for my Master’s Thesis but once it’s delivered it will be a pure Open Source application.
Disclaimer: Nomad is under heavy development and is prone to changes
What are the use cases for Nomad?
The main goal of the Nomad project is to defeat Cloud Vendor Lock-in in the Elixir ecosystem. With the rise in popularity of cloud services Elixir users should not be restricted to one provider and should be able to make the most out of Cloud Computing. Some of the identified use cases are the following (but there are many more):
- You’re using S3 storage for a Phoenix application but a few months later Google has better pricing? Just let Nomad automatically copy your whole S3 bucket to a Google Storage bucket and relaunch the app with Google configurations.
- Recently got a new userbase in a remote region? Launch a new Virtual Machine with your application in the closest available region.
- Need a powerful SQL database but you’re not really knowledgeable in Cloud related affairs? Just use Nomad’s user friendly API and it will get done in a jiffy!
How is this achieved?
Nomad takes a lot of inspiration from Ecto and uses adapters in a similar fashion. First and foremost the needed API functions are identified based on what the cloud providers’ APIs have to offer and on what are the most recurring use cases and used functionalities. From this a general Elixir Behaviour is defined. These Behaviours must be implemented by each provider’s adapter.
Each adapter will implement the APIs for each cloud service (Virtual Machines, SQL, Storage and Datastore). Upon starting up an application a simple config in the desired environment config is needed - mainly cloud account credentials and a key to identify the chosen provider.
Finally through macros and metaprogramming, the adapters logic will be generated for the Nomad main modules (VirtualMachines, SQL, Storage and Datastore modules).
Roadmap
SDK
- [x] Storage API
- [x] SQL API
- [ ] Virtual Machines API
- [ ] Datastore API
- [ ] Friendly Mode and Full Control Mode (return parsed response vs. complete HTTP response)
Mix Tasks/Deployment Tool
- [x] Database Listing
- [x] Database Creation
- [x] Database Deletion
- [x] Database Reboot
- [ ] Automatic Deployment
- [ ] Virtual Machine Creation
- [ ] Virtual Machine Reboot
- [ ] Virtual Machine Deletion
- [ ] Storage Creation
- [ ] Storage Deletion