Code Monkey home page Code Monkey logo

moodle's Introduction

Deploy and Manage a Scalable Moodle Cluster on Azure

This repository contains guides and Azure Resource Manager templates designed to help you deploy and manage a highly available and scalable Moodle cluster on Azure. In addition, the repository contains other useful information relevant to running Moodle on Azure such as a listing of Azure-relevant Moodle plugins and information on how to offer Moodle as a Managed Application on the Azure Marketplace or on an IT Service Catalog.

If you have an Azure account you can deploy Moodle via the Azure portal using the button below, or you can deploy Moodle via the CLI. Please note that while you can use an Azure free account to get started depending on which template configuration you choose you will likely be required to upgrade to a paid account.

Deployment Introduction

In the table below, we provide a number of default configurations at different scales of operation. These options minimize the configuration you would otherwise need to do manually; these options are essentially "good practice" recommendations. Once deployed, you will have full access to the Azure resources and can adjust the deployment to suit your needs. If you would prefer to have full control over all the configuration options at deployment, please refer to [the fully configurable section](#Fully Configurable) right after the Predefined deployment option section.

SSH Key Requirement

All of the deployment options require you to provide a valid SSH protocol 2 (SSH-2) RSA public-private key pairs with a minimum length of 2048 bits. Other key formats such as ED25519 and ECDSA are not supported.

If you are unfamiliar with SSH and SSH keys, read this article which will explain how to generate a key pair. You will create a ssh key pair. The public key is copied to the instances via the template. The private key is your identity that you will use to connect to different parts of the service.

Predefined deployment options

Below are a list of pre-defined/restricted deployment options based on typical deployment scenarios (i.e. dev/test, production etc.) All configurations are fixed and you just need to pass your ssh public key to the template so that you can log in to the deployed VMs.

Deployment Type Description Launch
Minimal This deployment will use NFS, Azure Database for MySQL Flexible Server (Burstable SKU 2 vCores), and smaller autoscale web frontend VM sku (1 core) that'll give faster deployment time (less than 30 minutes) and requires only 2 VM cores currently that'll fit even in a free trial Azure subscription. Deploy to Azure Minimally
Small to Mid-Size Supporting up to 1000 concurrent users. This deployment will use NFS (no high availability) and Azure Database for MySQL Flexible Server(General Purpose SKU 8 vCores), without other options like elastic search or redis cache. Deploy to Azure Minimally
Large size deployment (with high availability) Supporting more than 2000 concurrent users. This deployment will use Gluster (for high availability, requiring 2 VMs), Azure Database for MySQL Flexible Server (General Purpose SKU 16 vCores) and redis cache, without other options like elastic search. Deploy to Azure Minimally
Maximum This maximal deployment will use Gluster (for high availability, adding 2 VMs for a Gluster cluster), Azure Database for MySQL (Business Critical SKU 64 vCores), redis cache, elastic search (3 VMs), and pretty large storage sizes (both data disks and DB). Deploy to Azure Maximally

NOTE: The above deployment templates use hard coded Azure Database for MySQL Flexible Server SKUs for easier configuration and quicker deployment of Moodle workloads. If your deployment fails for any reason, please revert to the fully configurable template where possible and change the Azure Database for MySQL Flexible Server parameters accordingly.

Fully Configurable

If you would prefer to configure the deployment right at the start of the process, you use the button below. Please note that this method opens up a large number of parameters to configure and users new to this deployment process may find it overwhelming. It is also very likely you may end up with a deployment configuration that is not optimal to your needs. This method is recommended for power users.

Deploy to Azure Fully Configurable Visualize

NOTE: Before you deploy your Moodle workloads using a fully configurable template, we suggest reviewing Azure Database for MySQL Flexible Server documentation to fully understand the parameters and the options suggested in the parameters to pick the right values for your workload needs.

Stack Architecture

This template set deploys the following infrastructure core to your Moodle instance:

This template set optionally configures the following additional infrastructure:

network_diagram

The template also optionally installs plugins that allow Moodle to be integrated with select Azure services (see below for details).

Useful Moodle plugins for integrating Moodle with Azure Services

There below is a listing of useful plugins allow Moodle to be integrated with select Azure services:

At the current time this template allows the optional installation of the plugins above with a * next to them. Please note these plugins can be installed at any time post deployment via Moodle's own plugin directory. You can find a list of all Azure relevant plugins in the Moodle plugin directory here. You might also choose to follow this list via RSS.

Moodle as a Managed Application

You can learn more about how you can offer Moodle as a Managed Application on the Azure Marketplace or on an IT Service Catalog here. This is a great read if you are offering Moodle hosting services today for your customers.

Observations about the current template

The template is highly configurable. Full details of the configuration options can be found in our documentation (more specifically in our parameters documentation). The following sections describe observations about the template that you will likely want to review before deploying:

Scalability Our system is designed to be highly scalable. To achieve this we provide a Virtual Machine Scaleset for the web tier. This is already configured to scale on high load. However, scaling the VMs is not instantaneous. If you know you will have a high-load situation(e.g. exam, you should manually scale the VMs prior to the event. This can be done through the Azure portal or the CLI. The database is less easily scaled at this point, but it is possible and documented in our management documentation.

SSL The template fully supports SSL but it is not possible for the template to manage this for you. More information in our managing certs documentation.

Moodle PHP Code The Moodle PHP code is stored on the Controller VM and copied to each front end VM upon deployment and upon request (should you update the Moodle code with your own code). For more information see our management documentation.

Database Currently the best performance is achieved with Azure Database for MySQL and Azure SQL Database. With Azure Database for PostgreSQL we have hit database constraints which caused processes to load up on the frontends until they ran out of memory. It is possible some PostgreSQL tuning might help here. Above pre-configured deployment templates deploy Azure Database for MySQL Flexible Server in a VNet. For configuring Azure Database for MySQL Flexible Server outside a VNet to use firewall-based IP restriction, please use the fully configurable template.

File Storage There are two options for file storage (moodledata) - Gluster FS and NFS. The Gluster FS solution is replicated thus provides highler availability, but incurs additional cost (2 x VMs) and some performance penalties (we are exploring ways to improve this and would welcome contributions from people who know Moodle and/or Gluster). NFS is highly performant and utilizes an existing VM in the cluster (so lower cost), but it is a single point of failure. At the time of writing there is no simple way to switch from one to the other depending on expected workloads and availability requirements, again this is something we would love to see resolved.

Search. Azure supports running an Elasticsearch cluster, however it does not offer a fully-managed Elasticsearch service, so for those looking for a fully-managed Search service Azure Search is recommended.

Caching. While enabling Redis cache can improve performance for a large Moodle site we have not seen it be very effective for small-to-medium size sites. We can likely improve upon this, patches welcome ;-)

Regions. Note that not all resources types (such as databases) may be available in your region. You should check the list of Azure Products by Region to for local availability.

Common questions about this Template

  1. Is this template Moodle as IaaS or PaaS? While the current template leverages PaaS services such as Redis, Azure Database for MySQL Flexible Server, Azure Database for Postgres, MS SQL etc. the current template offers Moodle as IaaS. Given limitations to Moodle our focus is IaaS for the time being however we would love to be informed of your experience running Moodle as PaaS on Azure (i.e. using Azure Container Service or Azure App Service).

  2. The current template uses Ubuntu. Will other Operating Systems such as CentOS or Windows Server be supported in the future? Unfortunately we only have plans to support Ubuntu at this time. It is highly unlikely that this will change.

  3. What configuration do you recommend for my Moodle site? The answer is it depends. At this stage we provide some rudimenatary t-shirt sized deployment recommendations and we are still building out our load testing tools and methodologies to provide more granularity. With that being said this is an area we are investing heavily in this area and we would love your contributions (i.e. load testing scripts, tools, methodologies etc.).

If you have an immediate need for guidance for a larger sized deployment, you might want to share some details around your deployment on our issues page and we will do our best to respond. Please share as much information about your deployment as possible such as:

  • average number of concurrent users your site will see
  • maximum level of concurrent/simultaenous users your site needs to support
  • whether or not HA is needed
  • any other attributes specific to your deployment (i.e. load balancing across regions etc.)
  1. Did Microsoft build this template alone or with the help of the Moodle community? We did not build this template alone. We relied on the expertise and guidance of many capable Moodle partners around the world. The initial implementation of the template was done by Catalyst IT.

  2. How does this template relate to other Moodle offerings available on the Azure Marketplace? It is generally not a good idea to run Moodle as a single VM in a production setting. This template is highly configurable and allows for high availability and redundancy.

  3. How does this template relate to this Azure Quickstart Template for Moodle? This repo is the working repo for the quickstart template. We will be pushing changes from this template to the quickstart template on a regular cadence.

  4. I am already running Moodle on Azure. How does this work benefit me? We are looking for painpoints from you and the broader Moodle on Azure community that we can help solve. We are also looking to understand where our implementation of Moodle on Azure outperforms or underperforms other implementations such as yours that are out in the wild. If you have observations, performance benchmarks or just general feedback about your experience running Moodle on Azure that you'd like to share we're extremely interested! Load testing is a very big area of focus, so if you have scripts you wouldn't mind contributing please let us know.

  5. Has anyone run this template sucessfully in production? Yes they have. With that being said, we do not make any performance guarantees about this architecture.

  6. What type of improvements have you succeeded in making Since we first began this effort we have managed to make great gains, achieving a >2x performance boost from our original configuration by making tweaks to things like where PHP files were stored. Our work is nowhere near over.

  7. What other Azure services (i.e. Azure CDN, Azure Media Services, Azure Bot Service etc.) will you be integrating with when this effort is complete? It's not clear yet. We'll need your feedback to decide.

  8. Why is the database on a public subnet? At this stage only Azure Database for PostgreSQL do not support being moved to a vnet. As a workaround, we use a firewall-based IP restriction allow access only to the controller VM and VMSS load-balancer IPs.

  9. Is Azure Database for MySQL Flexible Server deployed in a VNet? When you leverage one of the pre-defined template options, we automatically deploy your Azure Database for MySQL Flexible Server in VNet for better isolation and greater security, optionally you can choose the fully configurable template to deploy Azure Database for MySQL Flexible Server outside VNet depending on your needs.

  10. How can I help with this effort? Please see below.

Automated Testing (Travis CI)

This repository uses Travis CI to deliver automated testing.

The following tests are carried out for every Pull Request and will also run in a Travis CI enabled forked repository:

  • JSON Linting - All JSON files are linted to ensure they do not contain any syntax errors.
  • JSON Code Style - All JSON files are tested to ensure they comply with project code style rules.

The following tests are carried out as part of the Pull Request merging prior to a contribution being accepted into the release branch:

  • Template Validation - The template is subbmitted to Azure to ensure it is correclty formatted and contains valid logic.
  • Template Build - The template is submitted to Azure and the stack described in the template is built to ensure a stack is correctly deployed.

Setting Up Travis CI for Template Build

The following describes the process required if you want to run the template validation and build steps using your own Travis and Azure accounts.

To set up the build process, you will need:

  • An Azure account or active subscription
  • A fork of this repository linked to Travis CI
  • Access to an installed instance of the Azure CLI
  • A SSH keypair

The Travis CI process uses the Azure CLI Service Principal login method to authenticate against Azure. The documentation for logging in via a Service Principal can be found here: https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest#logging-in-with-a-service-principal

Before you can log in using the Service Principal process you need to create a Service Principal. The documentation to create a Service Principal login can be found here: https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest

When a Service Principal is created using the Azure CLI a JSON response is returned containing:

  • name - This is the Service Principal username.
  • password - This is the Service Principal password.
  • tenantId - This is the Service Principal tenant unique ID.

You will need these three above values to have Travis and Azure deploy and test your template.

The next step is to take the above values returned by the Service Principal creation and use them to define environment variables in Travis CI.

The following link shows how to set up per repository environment variables in Travis CI: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings Using this documention set up the following three hidden environment variables in Travis CI for your fork of this repository.

  • SPNAME - The value of the name parameter returned by the Service Principal create proccess.
  • SPPASSWORD - The value of the password parameter returned by the Service Principal create proccess.
  • SPTENANT - The value of the tenant parameter returned by the Service Principal create proccess.
  • SPSSHKEY (default: generate new)- A public SSH key that you have the corresponding private key for. This is currently not used but is required for the build to be successful.
  • LOCATION (default: southcentralus)- Location for the test resource group.
  • RESOURCEGROUP (default: azmdl-travis-XXX)- Name to use for the resource group.
  • FULLCI_BRANCHES (default: master)- Name of branches (separated by ':') to always run FULL CI (if credentials are provided). Full CI will run a deployment test which will create and use resources from your Azure account.

NOTE: You can trigger a full CI test by adding [full ci] or [fullci] anywhere in the commit message.

NOTE: Make sure you set the environment variables to hidden otherwise they will be exposed publically at run time.

NOTE: As per the Travis CI documentation make sure you have correctly escaped the enviroment variable values when they are defined.

Once the environment variables are defined, Travis CI will run the template validate and build steps as part of the test process.

Contributing

This project welcomes contributions and suggestions. Our goal is to work on Azure specific tooling for deploying and managing the open source Moodle learning management system on Azure. We do not work on Moodle itself here, instead we work upstream as appropriate.

The short version of how to contribute to this project is "just do it". Where "it" can be defined as any valuable contribution (and to be clear, asking questions is a valuable contribution):

  • ask questions
  • provide feedback
  • write or update documentation
  • help new users
  • recommend the project to others
  • test the code and report bugs
  • fix bugs and issue pull requests
  • give us feedback on required features
  • write and update the software
  • create artwork
  • translate to different languages
  • anything you can see that needs doing

For a more detailed discussion of how to contribute see our Contribution Guide.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

Next Steps

  1. Deploy a Moodle Cluster
  2. Obtain Deployment Details about a Moodle Cluster
  3. Delete a Moodle Cluster

moodle's People

Contributors

asift91 avatar catalystauinf avatar darrinhodges avatar dlm-sadge avatar dmanavi avatar dubrie avatar enovationit avatar guyomog78 avatar hosungs avatar iennae avatar kermat avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar naioja avatar nepomuceno avatar nimojg-microsoft avatar pateixei avatar rgardler-msft avatar rishky-msft avatar roperto avatar sayali0512 avatar shishir-msft avatar sorratheorc avatar superzoelu avatar tsummey avatar umakanthos avatar ummadisudhakar avatar venu-sivanadham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle's Issues

Document release process

We need to document the process for releasing from this repo into the Azure Quickstarts repo. Here's an initial set of ideas:

We aim to release every 2nd and 4th Wednesday

Version numbering

Version numbers are x.m.i, where x = major version number, m = month number, i = iteration number (e.g. 1.1.2 is the version from the 4th Wednesday of the month). If interim releases are needed (e.g. security patch) they will be indicated with an addition digit, e.g. x.m.i.y, where y is an incremental number

Release Preparation (1st and 3rd Wednesday)

  1. validate all issues with milestone of next release. Move out issues that are going to slip.
  2. Merge dev branch into releasecandidate branch
  3. Increment version numbers in dev branch
  4. test and validate releasecandidate branch

Release Process (2nd and 4th Wednesday)

  1. Update URLs for deploy button and script locations
  2. Update version numbers
  3. cp code to azure/quickstarts fork
  4. issue pull request
  5. validate against best practice
  6. merge into quickstarts

Choose either Apache or NGinx web server

Currently the template use NGinx as the web server. However, many people prefer Apache Web Server. It would be good to have an option to deploy with either configuration.

Improve VNet support

It is currently possible use an existing vNet address space. However, the feature is not well tested, nor is it documented.

  • Test deployment into an existing VNet
  • Document deployment into an existing VNet

Document minimum (for evaluation) and optimal configurations for example workloads

Hi,

Just reporting that this template needs a min of 9 Cores.
So as it stands it will not run successfully from a Free Trial account unless you set:

  • fileServerType: nfs (instead of gluster)
  • autoScaleVmSku: Standard_DS1_v2 (instead of DS2)
    This will reduce the core requirements to under the max of 4 for a Free Trial account

This repo contains guides on how to deploy and manage a scalable Moodle cluster on Azure. You can use an Azure free account to get started.

Adjust the web frontend VMSS scaling threshold

For a certain VM sku (e.g., Standard_DS2_v2, which is the default) for the web frontend VMSS, it's observed that the frontend VM's CPU utilization didn't hit the default scaling-out threshold (80%) even with very high latency (~20s) with high concurrent connection count (~200). The best scaling-out logic might be to use the latency as the trigger, but that may not be immediately feasible. It might be good to find a better scaling-out threshold so that latency wouldn't suffer. The threshold might differ from one VM sku to another, and that'll require some very extensive performance test experiments.

Make load testing work with MS SQL

The current load testing scripts were developed before MS SQL option, and MS SQL SKUs are quite different from MySQL/PostgreSQL. So we need to update the load testing scripts to support MS SQL choice and SKUs.

Provide support for Azure Search

The current templates (optionally) deploys an Elastic Search cluster. This adds 3 VMs to the overall cost of the template. By adding Azure Search we should be able to provide better functionality with a lower maintenance overhead and lower cost.

Allow choice of NFS over Gluster

The /moodle directory is shared out to frontend VMs through the replicated Gluster cluster for high availability as well. However, we are hearing that the Gluster performance is not very good and asked about other options, like copying the static content over to the local file system. I think we should at least try to allow the choice of NFS over Gluster in the template. We might use one dedicated VM for the NFS host, but also could consider utilizing the jumpbox VM. Of course we should also consider the cron job scalability on the jumbbox as well, in that case.

Add support for SSL certs

At present the deployment uses self-signed SSL certs. In order to update those certs one has to upload them to the server after deployment. It would be better to allow the cert to be provided/created at deployment if possible.

Document contribution policy

It is important that we ensure contributors know how to contribute. To this end we should create a CONTRIBUTE.md file that describes our governance model and how newcomers can become engaged.

CI: Base URLs in azuredeploy.json and README.md should be checked

A PR from a different branch or from a different fork shouldn't update the base URLs in azuredeploy.json and README.md (the ones with https://raw.githubusercontent.com/Azure/Moodle/master). We should add a step in CI to make sure these values are not changed and reject the PR if any of those are changed.

Containerize the frontend web VM scale set

We'd like to containerize at least the frontend web VM scale set, if not the entire cluster. Kubernetes is considered a viable orchestrator, but it's uncertain how app containers may be deployed using ARM templates, so need investigation on that.

We also learned recently that Catalyst IT EU presented their Moodle containerization experiences in MoodleMoot UK/Ireland 2018 (search for "containerisation" after clicking the link), and it'd be great if we can learn and improve from their experiences.

Initially setting the milestone as v1.5.1 for planning, but it's well understood that this work might take longer, in which case the milestone will be adjusted accordingly.

Implement CI/CD process

We should have a CI/CD process that validates every PR for best practices and template deployment correctness. A CI/CD process for our repo should also handle the pre-commit checks mentioned in #7. It'll probably closely follow what Azure/azure-quickstart-templates is doing, especially with their Travis CI process. With the latest azuredeploy.parameters.json and added options (MS SQL, optional redis, optional elastic search, ...) a test deployment should be possible within reasonable amount of time (about 30 minutes).

For an example CI/CD build on the Azure/azure-quickstart-template repo, see this (a PR from myself to integrate our changes in Azure/Moodle to Azure/azure-quickstart-templates repo) and the actual Travis CI build logs (can be accessed from the PR link by clicking the "Show All Checks" link and then clicking the "Details" link for continuous-integration/travis-ci/pr item.

Remove 'skufamily; parameter from azuredeploy.json

It's late so I don't want to do this now incase I'm missing something, but it looks to me like we can remove some parameters from azuredeploy.json. @hosungsmsft please review the below:

skufamily appears only in documentation and has meaningless allowed values

$ grep -rnw '.' --include '*.json' -e 'skuFamily'
./azuredeploy.json:257:        "skuFamily": {
./azuredeploy.json:729:            "skuFamily": "[parameters('skuFamily')]",
./nested/mssql.json:50:        "documentation6": " skuFamily                   - Mssql sku family",
./nested/postgres.json:43:                "family": "[parameters('moodleCommon').skuFamily]",
./nested/postgres.json:58:        "documentation6": " skuFamily                   - Postgresql sku family",
./nested/mysql.json:43:                "family": "[parameters('moodleCommon').skuFamily]",
./nested/mysql.json:58:        "documentation6": " skuFamily                   - Mysql sku family",

The only use that looks potentially relevant is ./nested/mysql.json:43 but given that this is not a parameter in the REST API I believe it is not required - https://docs.microsoft.com/en-us/rest/api/mysql/servers/createorupdate#serverpropertiesfordefaultcreate

Provide guidance on how to deliver Moodle powered solutions to customers

In the readme can we add one of the Next Steps for Azure Managed Application be How to Submit your Moodle Managed Application to the Azure Marketplace and link to the following documentation

And also Formally submit your Application to the Azure Marketplace and link to this nomination page

The existing Managed Application documentation has a dual focus - including using it to create IT Service Catalog and offerings - and does not strongly reference the Azure Marketplace and that being a natural use case for Managed Applications.

File indexing support for Azure Search (Apache Tika setup)

Currently for file content search capability (a.k.a. file indexing support) with the Moodle Azure Search plugin, we need a separate Apache Tika instance. Our latest templates after integrating the plugin still does not create/configure for a Tika instance, so the file indexing support is not possible. We should extend the templates so that a Tika instance can be created/configured for the Moodle global search file indexing support.

Basic template for Managed Application

Azure Managed Applications enables partners to offer their Moodle based solutions to internal and external customers. The ARM templates in this repository provide the core infrastructure for such a solution, while the terms for ongoing management of the solution, along with specific customizations can be provided by the partner.

In order to help people get started with Moodle based Managed Applications on Azure we should provide an example configuration with documentation for upload to the marketplace.

Optionally installing Unoconv during initial deployment

Unoconv is a command line program that is used to convert between different office document file formats. It uses an instance of LibreOffice to do the conversion and is used by the Assignment activity to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment activities will only allow annotations when students upload a pdf document.

How widely used is this? What is the impact if we install it? Can we make it an optional install?

Improvements to Apache configuration

PR #10 added the ability to choose Apache or NGinx as the server, In the PR comments the following two ToDo items were noted:

  • Redirect direct outside Apache http connection (to port 81) to https (443)
  • Log correct IP address instead of 127.0.0.1 for Apache http (nginx http does that already)

Improve UI Definition in managed application example

The Create UI definition for Managed Apps allows more flexibility in the way the UI is displayed. For example, instead of a cryptic sku name we can create an illustrative name, see https://docs.microsoft.com/en-us/azure/managed-applications/microsoft-common-dropdown

We can also use logical functions to hide elements, see https://docs.microsoft.com/en-us/azure/managed-applications/create-uidefinition-functions#logical-functions

So we can, for example, create three groups of SKU dropdowns for postgres, mysql and mssql and only have them display when the appropriate DB is selected.

Document and facilitate t-shirt size deployments

In #29 and #32 we added the ability to configure the deployment of the elasticsearch VMs and O365 Plugins, There are also a number of other configuration options not currently exposed via the default azuredeploy.parameters.json file.

We need to document these options clearly and provide some example "t-shirt size" configurations to guide users. That is, what configuration should be used for "5000 students", "10000 students", "25000 students' etc.

Need a highly available and yet performant file share alternative

We started with Gluster, but it turns out that its performance degrades quickly with medium to high workloads. So we switched our default file share option to NFS, but it's not highly available.

We should provide a highly available and yet performant file share alternative. NFS HA (this and this) seems to be a possible option, but it feels too hairy a solution. lsyncd seems a promising alternative, just for the /moodle/html directory, while still keeping the /moodle/moodledata directory in gluster.

Refactor (break up) the big monolithic install_moodle.sh & setup_webserver.sh

Currently install_moodle.sh and setup_webserver.sh require a bunch of command line arguments for a single site, which grow more and more and won't be sustainable sooner than later. Ideally those command line parameters should be packed in a config file and passed down to the VM deployment template. It might require using cloud-init as mentioned in #33. I'm raising another issue, because this will also help supporting multiple Moodle sites with a single deployment (#78). Eventually we'd want a config file (for multiple Moodle sites) created/shared/updated on /moodle and let each VMSS VM instance configure its html directories, moodledata directories, and Apache virtual hosts as stated in the config file. The controller VM will need to create that config file based on the deployment-time custom data (for cloud-init) that should replace the install_moodle.sh cmdline parameters, and probably the script itself with something more flexible like a Python script (to facilitate processing the custom data and config file generation better).

Allow choice of not installing ElasticSearch plugin and not deploying VMs

Currently the template installs the ElasticSearch plugin and 3 VMs for that. It would be good to allow choice of not installing the plugin and deploying the 3 VMs, mainly for customers who don't want the ElasticSearch (or at least load testing scenarios where elastic search is not used/needed).

It'd be interesting how to seamlessly add the elastic search VMs and configs after the initial cluster deployment without the feature selected.

Support SSL cert auto-rotation using Azure Key Vault

#14 addresses the SSL cert issue, but it also talks about auto-rotating the deployed cert when it's near expiry or revoked. This requires a full integration of Azure MSI, which is currently available as a VM extension that's being replaced by IMDS. Therefore, we better wait for the IMDS MSI support before implementing the cert auto-rotation. Besides, currently the Key Vault needs to be configured (to allow access from VM) after the VM is deployed, so the auto-rotation must be configured after the deployment, which makes this task separate from the template improvement. Therefore, setting up a separate issue here.

Provide pre-commit checks to ensure everything is likely to work

We can provide a bunch of pre-commit checks to catch common errors and, in some cases, provide scripts to help.

  • Build a script to check the deploy, visualize, nested template and script URLs - reject commit if they don't match the git branch
    • This also needs to be run on pre-merge via the web UI, otherwise we run the risk of master not having the correct values
  • Build a script to automatically update the deploy, visualize, nested template and script URLs - reject commit if they don't match the git branch

Consider using Cloud Init

Using cloud-init to do boot time configuration of our VMs might provide a level of increased flexibility during out deployment. Should we move from customer script extension to cloud-init?

Intro blog: https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/
Overview documentation: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/using-cloud-init
Quickstart: https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-customdata

Document how to use the /moodle/html local copy feature

PR #61 introduced the /moodle/html local copy feature (primarily targeted for the gluster option), and this needs some documentation, as @rgardler suggested and copied below:


In general I think this is OK as an optional feature. I do think it needs documenting though, nothing too fancy just the outline steps in a new file at docs/moodle_file_sync.md:

  • Update files in /moodle
  • Update last modified file
  • wait 1 minute

Research of Moodle cron performance improvement

Would it be better for cron to run in parallel using auto-scaling web tier?

Moodle supports cron running in parallel (there is built in locking) for micro tasks. It is recommended that cron runs at every 5 minutes but some tasks could take hours depending on situation so shouldn't cron also scale?

It's also worth noting that providing a bigger controller VM might not help since Moodle's Cron reportedly does not use more than one CPU core.

Optionally install Trigger Plugin and Restful Services Plugin as part of deployment

The Trigger Plugin (https://github.com/catalyst/moodle-tool_trigger) and the Restful Web Services Plugin (https://github.com/catalyst/moodle-webservice_restful) should be installed optionally so that the site can be configured to use the Custom Azure Logic Apps Connector for Moodle (https://github.com/catalyst/azure-connector_moodle). Not sure if we can automate the configuration of the Custom Logic App Connector - but perhaps we just have an "Enable Azure Logic Apps with Moodle" in the web UI.

Add testing of deployed Moodle site to the CI process

In #72 we are adding a test infrastructure to this repo that will allow us to validate contributions to this repo. This solution will do some syntax and best practice checking of the contributions and it will test that a deployment of the template works from an ARM perspective. However, it does not test that the Moodle is working and available.

Once this initiual work (#72) is complete we need to extend it to allow a deeper level of testing. For example:

  1. deploy a configuration of Moodle
  2. tests the correct installation of selected features in that configuration
  3. runs the load testing against it and report
    [repeat for x different configurations]

Lets start with a focus on 1)

Our documentation is written to allow it to be used as a test script. Installing SimDem and running simdem -p . test Deploy.md in the docs folder will test the deployment of Moodle (item 1 above).

There is an example of using SimDem in Circle CI at https://github.com/Azure/acs-demos/blob/master/.circleci/config.yml

This is a good starting point, but happy to discuss further here once we start looking at this in detail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.