Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplifying deployment to GCP using Ansible #256

Closed
ksraj123 opened this issue Apr 9, 2020 · 8 comments
Closed

Simplifying deployment to GCP using Ansible #256

ksraj123 opened this issue Apr 9, 2020 · 8 comments

Comments

@ksraj123
Copy link
Contributor

ksraj123 commented Apr 9, 2020

I think deployment of sugarizer-server onto the Google Cloud Platform makes sense for many schools or other organisations trying to setup sugarizer deployment themselves as they provide free credit initially.

But the process for deployment is lengthy and may seem complex or intimidating to non-developers.

The UI of Google Cloud Platform is not very user friendly for non-developers in my opinion but the current deployment process requires to user to create and configure vm instances and firewalls themselves by navigating though the UI and then ssh into the vm to execute a script.

I think deployment will be much simpler if an ansible package is realised which would create a vm instance, firewall and execute required scripts with a single command.
The user will provide essential information like project id and authentication details and will be able to modify other variables like machine type, os etc if needed.

I am working on this, will open a PR soon.

Please share suggestions.

@llaske
Copy link
Owner

llaske commented Apr 11, 2020

Hmmm. Ansible is a good idea. It's on our TODO list for GSoC 2020 project Sugarizer School Portal.
But may be we could imagine first a generic Ansible package to deploy Sugarizer Server, then a specific package to deploy it on GCP.

@NikhilM98
Copy link
Collaborator

I think Ansible package in the Sugarizer School Portal project is to bring the K8s Infrastructure up. It is not for installing Sugarizer Server using Ansible. Even in the Sugarizer School Portal a Helm chart will be created to install Sugarizer-Server. Currently, Sugarizer-Server can be very easily installed using Docker so I think there is no need for Ansible. One drawback is that we have to depend on ansible for simple setup.

@ksraj123
Copy link
Contributor Author

@llaske I agree with @NikhilM98 , for simple docker deployment on localhost an ansible package will be as good as a simple script.

However, I think at least for deployment to GCP specifically, an ansible package would make sense for reasons mentioned before.

#257 - proposes an ansible package for deployment to GCP
#259 - package for simple deployment to localhost

I am also working upon the sugarizer school portal ansible package which creates a cluster onto Google Kubernetes Engine and installs the helm chart for sugarizer-server. Its a work in progress, would love to have your feedback on the current build.

@llaske
Copy link
Owner

llaske commented Apr 12, 2020

@ksraj123 @NikhilM98 the idea is not to replace the current way to deploy Sugarizer Server with docker.

But ansible could be useful in two ways:

  • Today ansible is use by IIAB project to deploy Sugarizer Server (see here) and they are not interested to deploy Sugarizer using docker because IIAB should run on tiny computers with limited storage and docker use a lot of storage (images, ...).
  • Two years ago we launched Sugarizer School Server a ready to go RaspberryPI package to create easily a Sugarizer Server with a WiFi hotspot/DNS included. Unfortunately the project is deprecated today due to incompatibilities in underlying software. It will be great if we could use an ansible package instead of an image generation tool to build the package.

@NikhilM98
Copy link
Collaborator

Here is the link to the Sugarizer Installation script in IIAB Repository (The above link was not working).

I opened PR #68 last year to install Sugarizer-Server using Shell script. The PR was WIP (features were incomplete), but it was turned down and closed at that time because docker was the preferred way to install Sugarizer-Server.

  • IIAB's Sugarizer Server installation script depends on the IIAB architecture: where they use Ansible to manage large number of packages, use a single MongoDB service for multiple packages, configure apache2/nginx to work with Sugarizer-Server, etc. If we create an Ansible package to install Sugarizer-Server, IIAB won't be able to use the same package.
  • The Sugarizer-School-Box is written in Shell. I think it will be best to write a Shell script to install Sugarizer-Server in RaspberryPI.
    Reasons:
    • There already exists Sugarizer-School-Box which contains well-written and tested Shell script to set up Sugarizer-Server and other components in Raspberry PI.
    • We need to modify Sugarizer-School-Box and remove the docker dependency and replace it with the classical way to setup the Sugarizer-Server.
    • We can achieve the same functionality using Shell Script with Sugarizer Server and won't need to install Ansible as a dependency. Also, to attract contributors, it's recommended to use more popular language.

Even if we use Ansible, as @ksraj123 mentioned, it will be as good as a simple script.

@llaske what do you think will be a more efficient way of installation?

@llaske
Copy link
Owner

llaske commented Apr 14, 2020

@NikhilM98 it make sense. Look like using Ansible is not a so good idea. Thanks for this explanation.

BTW I don't think it's a good idea to remove Docker dependency in Sugarizer-School-Box. We had lot of issues with node.js/MongoDB install in the past, it's better to have a packaged version of these software to be sure it will work.

IMHO the main issue in Sugarizer-School-Box is that it's linked to the rpi23-gen-image script and existing scripts are called by it.
What we have to do is to remove this dependency and build a calling script to allow easily to install Sugarizer Server on a fresh RaspberryPi (already running Raspbian).

@ksraj123
Copy link
Contributor Author

ksraj123 commented May 4, 2020

Solved in #257

@ksraj123 ksraj123 closed this as completed May 4, 2020
@llaske llaske reopened this May 5, 2020
@llaske
Copy link
Owner

llaske commented May 5, 2020

Thanks @ksraj123. I'm closing issue only when a new version is release.

@llaske llaske added this to the 1.3.0 milestone Oct 7, 2020
@llaske llaske closed this as completed Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants