Announcing a new CookieCutter for deploying Tutor to Kubernetes at scale

Hello all! I’m excited to announce a new project – cookiecutter-openedx-devops – on which i’ve been working since around june of last year. This is a CookieCutter template that generates a repository with a complete set of Terraform scripts to build a production-ready AWS back end, and Github Actions CI workflows that will build and deploy an Open edX Tutor image into an AWS Elastic Kubernetes Cluster.

The Tutor build can use your custom theme and Open edX plugin, any number of Xblocks, and it deploys to https.

The AWS backend includes: a VPC, Route53 domain management, IAM users, Elastic Container Registry (ECR), Elastic Kubernetes Cluster (EKS), S3 + Cloudfront (for file storage at scale), RDS (MySQL), DocumentDB (MongoDB), and ElastiCache (Redis). It also creates a small EC2 bastion server that facilitates connectivity to MySQL and MongoDB. Instructions for connecting to MySQL Workbench are included in the README.

The code generated by this CookieCutter is currently supporting the production environments of several large-scale Open edX installations.

You can message me here, or at for more information.


I haven’t tried the project out, yet, but let me just say it has one of the best READMEs I’ve seen in a while. (It even gives you an AWS price estimate!) Plus, if it does half of what it says on the tin, it ought to be extremely useful to the community. Congrats, and thanks, @lpm0073!

Great work Lawrence, as always :slight_smile:

@lpm0073 HI! first of all, thanks for the effort you put into creating this great tool. This is going to be very to the community. Last week I was testing the cookiecutter and I got an installation up and running! I would like to add some comments about my experience with the tool:

  • I built the platform using edx-platform lilac.3 version (Tutor 12.2.0)
  • The infrastructure creation went pretty well! I just had to make sure to have an ssh key created in EC2 with the same name provided in the cookiecutter configuration, and a Route53 hosted zone with domain {environment_subdomain}.{global_root_domain}.
  • The building pipeline worked smoothly. I had to create a repo called “openedx” in AWS ECR.
  • I had problems in the deployment pipeline because of DocumentDB. When trying to initialize the Forum indices, the Forum pod threw an error like the following:
rake aborted!
Mongo::Error::OperationFailure: Field 'noCursorTimeout' is currently not supported (303)
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/operation/result.rb:258:in `validate!'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/operation/find/op_msg.rb:48:in `execute'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/operation/find.rb:43:in `execute'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/collection/view/iterable.rb:82:in `send_initial_query'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/collection/view/iterable.rb:42:in `block in each'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/retryable.rb:44:in `read_with_retry'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongo-2.5.3/lib/mongo/collection/view/iterable.rb:40:in `each'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/query_cache.rb:227:in `each'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/contextual/mongo.rb:133:in `each'
/openedx/cs_comments_service/vendor/bundle/ruby/2.5.0/gems/mongoid-7.0.5/lib/mongoid/contextual.rb:20:in `each'

Researching in the AWS docs I found out the ‘cursor.noCursorTimeout()’ method is not supported. I had to comment this line in order to use the Mongo installation inside the K8S cluster. Did you experience something similar?

  • I created a PR on the cookiecutter repo to solve an issue related to Tutor S3 plugin. Please take a look at it.

In conclusion, I want to reiterate the great value this tool has to offer to the community. I hope new people get into it and start contributing.


that’s great! thanks for the feedback jhony. I’ll edit the repo README to ensure that all four of your prerequisite comments are included. Regarding mongo: yes, i did run into to that but had forgotten about it.

your PR: accepted. :slight_smile:


For anyone watching this thread, I had a productive work session last week with guys at AWS who know about a.) Fargate and b.) Application Load Balancer ingress for EKS. my work is ongoing on these two items, but i’m making progress.

1 Like