I always wanted to know about how services like Codenvy and Heroku internally worked. The only way to understand that was to build a similar project.
The main component of this project is Docker.
Docker
Docker is a software that performs OS-level virtualisation and is developed for Linux. More information about it can be found here.
About My-Cloud-IDE:
My-Cloud-IDE is a proof-of-concept for a Software as a Service (SaaS). It can be used to perform software development on cloud without worrying about resolving software dependencies, software installations etc. The user gets a fully functional IDE in his/her browser after registration. Each user has his/her own isolated software environment because My-Cloud-IDE uses Docker to perform OS-level virtualisation in the backend.
Technical Details
I divided the project into two modules. One module was for 'management' purpose. This includes user interfaces, user management and preparing some files that are to be loaded into the docker container when the time comes. More features like analytics can be added later on.
Another module was for controlling the Docker. This module takes care of instructing the Docker to start/stop containers, mount volumes into the container and 'port binding' between host and the container.
The 'management' module was written in PHP and for storing user information, I used a simple JSON file and didn't wanted to use a heavy RDBMS. The reason for using PHP was because I integrated an open source web IDE called Codiad (which was written in PHP) in this project. Another reason was because I have worked on PHP projects a lot and I am very comfortable with it. I made a lot of modifications to the source code of Codiad to make it meet my requirements.
The 'docker-controller' module was written in Java. The reason behind the choice of the language was that there is a very easy-to-use docker client library (here) which is written in Java.
How did PHP and Java communicate with each other?
I wanted the PHP module to act as a server to the users for signups and logins, and the Java module to act as a server to the PHP module to do all the Docker operations.
The PHP module was running on a standard port 80 (with Apache web server). I wanted to create another small web server on a different port for Java module so that PHP and Java can communicate with each other.
I started a small server (using this Java library) on port 8080. Now, to send and receive HTTP requests from PHP to the Java server (running on port 8080), I used php-curl module. In this way, when the user of My-Cloud-IDE performs a login or a signup, PHP module (management module) will instruct the Java module (docker controller) to create a new Docker container.
To know more, check out the Github repo here!
This is just a proof of concept.
Screenshots: (Click on the images to view them in full screen)
The main component of this project is Docker.
Docker
Docker is a software that performs OS-level virtualisation and is developed for Linux. More information about it can be found here.
About My-Cloud-IDE:
My-Cloud-IDE is a proof-of-concept for a Software as a Service (SaaS). It can be used to perform software development on cloud without worrying about resolving software dependencies, software installations etc. The user gets a fully functional IDE in his/her browser after registration. Each user has his/her own isolated software environment because My-Cloud-IDE uses Docker to perform OS-level virtualisation in the backend.
Technical Details
I divided the project into two modules. One module was for 'management' purpose. This includes user interfaces, user management and preparing some files that are to be loaded into the docker container when the time comes. More features like analytics can be added later on.
Another module was for controlling the Docker. This module takes care of instructing the Docker to start/stop containers, mount volumes into the container and 'port binding' between host and the container.
The 'management' module was written in PHP and for storing user information, I used a simple JSON file and didn't wanted to use a heavy RDBMS. The reason for using PHP was because I integrated an open source web IDE called Codiad (which was written in PHP) in this project. Another reason was because I have worked on PHP projects a lot and I am very comfortable with it. I made a lot of modifications to the source code of Codiad to make it meet my requirements.
The 'docker-controller' module was written in Java. The reason behind the choice of the language was that there is a very easy-to-use docker client library (here) which is written in Java.
How did PHP and Java communicate with each other?
I wanted the PHP module to act as a server to the users for signups and logins, and the Java module to act as a server to the PHP module to do all the Docker operations.
The PHP module was running on a standard port 80 (with Apache web server). I wanted to create another small web server on a different port for Java module so that PHP and Java can communicate with each other.
I started a small server (using this Java library) on port 8080. Now, to send and receive HTTP requests from PHP to the Java server (running on port 8080), I used php-curl module. In this way, when the user of My-Cloud-IDE performs a login or a signup, PHP module (management module) will instruct the Java module (docker controller) to create a new Docker container.
To know more, check out the Github repo here!
This is just a proof of concept.
Screenshots: (Click on the images to view them in full screen)
Comments
Post a Comment