openstackisrael2016



openstackisrael2016

0 0


openstackisrael2016

Slides for an Open edX / OpenStack tutorial presented at OpenStack Israel 2016

On Github fghaas / openstackisrael2016

OpenStack for Open edX:

Inside and Out

florian.haas@hastexo.com

@xahteiwi | @hastexo

Question: what's the universal biggest challenge that enterprises face when it comes to technology adoption?
Is it cost, the necessity to keep expense down and margins high?
Or scalability: the ability to quickly adapt to massive growth in demand, or in customer base, for your products and services?
Or speed, the requirement to ramp up, innovate, and go to market quickly?

In fact, it's none of these. Because while reduced cost, improved scalability and quick time-to-market are key expected benefits of modern technology, like cloud, like distributed storage, like software defined networking... ... the universal #1 challenge that enterprises are facing ...
... is one of skill. More precisely, hiring people that know, understand and can maintain these increasingly complex distributed systems. So, if these skills are rare and in high demand, why don't we build them?
... in a manner that's cost-effective, scalable, efficient and fast?
... that works for distributed teams?
Conventional, instructor-driven face-to-face training is frequently no option, it's neither very cost-effective, nor very scalable, nor very fast in building up a team's skill set.
And most self-paced training relies on attendees watching an instructor on video.
And self-studying documentation. And that's how you're supposed to understand and be able to manage increasingly complex distributed systems. Without ever actually touching one that you can also break with impunity.
It's almost like putting astronauts in a lecture hall with study books and a few tabletop exercises, ...
and then strapping them to a rocket and hurling them into space without them ever setting foot in a realistic simulator.
That's a broken model. And we're here to fix it.
We need learning environments that actually help you learn what you want and need to learn.
That come with immersive, realistic lab environments.
That allow you to interact directly with your peers, in your learning environment just as you would in your professional group.
... and do all that leveraging the momentum and speed of open-source platforms that innovate rapidly and openly.
the Open edX learning management platform is one which is already sweeping universities and academic institutions for its superior management capabilities and flexibility, and that offers these same qualities, also for professional education.
OpenStack is a cloud management and orchestration platform reshaping the way organizations manage and run their data centers.
And using these two platforms, we can provide a learning experience that is directly and smoothly integrated with life-sized, complex environments. This frees organizations from having to either maintain a costly parallel training infrastructure, or to settle for unrealistic scaled-down versions of complex environments.
Imagine being able to give each and every person on your virtualization team a massively scaleable container infrastructure, using potentially hundreds of Docker containers. Source: Docker Media Kit from //www.docker.com/legal/marks_and_logos/
Or every new hire on your storage team a whole distributed Ceph cluster to play with in training.
Or every one of your Big Data developers a full Hadoop cluster. Source: //upload.wikimedia.org/wikipedia/commons/0/0e/Hadoop_logo.svg
Cost-effective, scalable, fast...
... and open.
With Open edX and OpenStack coming together for better professional learning.

Why?

Why did we chose the tools we did?

Why Open edX?

  • Openness and community
  • Technology
  • Extensibility
We wanted to build our product around an open platform, so we shopped around for open source LMSs. Open source is not everything, however. Coming from a background of open source consulting, we know that having the code out there is not enough. For an open source project to be useful, it has to be alive. In other words, it requires leadership that embraces a community of both developers and users. Open edX certainly qualifies as a living project, but how hard is it to grok, as developers and sysadmins? Surprisingly, not very hard at all! The choice of Python for deployment (via Ansible YAML) and development (of the core LMS/CMS, at least, via Django) was a huge plus, in particular for OpenStack contributors such as ourselves. Even before initial investigation, we were pretty sure that no LMS would do what we wanted out of the box. (And that's not a bad thing, since we went in with the desire to contribute something new!) So we needed an LMS that was easily expandable. Another plus for Open edX! And last but not least... how awesome would it be to work with the latest, greatest, and coolest open source LMS out there?

Why OpenStack?

  • Openness and community
  • Technology
  • Extensibility
Can you see the pattern, here? OpenStack is: - Also open, one of our requirements, and also very much alive, with a very vibrant community around of the biggest, most successful open source cloud technologies that currently exist - Also built on easy-to-read, easy-to-understand Python (and YAML, via Heat templates) - Also, and by definition, extensible and "automatable" from the bottom to the top (as any cloud platform should!) - Also the cool kid on the block, as far as cloud platforms go It didn't take long for us, OpenStack consultants and trainers, to recognize that Open edX was the perfect complement to our consulting and training expertise. As you'll see, the union proved itself to be (well, almost) perfect for our needs, the proof of which is that we were able to come up with a product MVP in under six months.

Deploying

Open edX

on

OpenStack

Our first job was to find a way to deploy edX on OpenStack. First, on a single node, and then, on a highly-available, scalable manner to a cluster of VMs.
This is how we designed our OpenStack cluster: - A small deploy node is instantiated, for the single purpose of orchestrating Ansible playbook runs onto all other nodes. edx/configuration will be checked out there, and pre-requisites installed. - Exactly three backend nodes are created. This is the minimal possible number of Galera nodes, and more than enough for Mongo replication. The mariadb and mongodb edx/configuration roles will be assigned to them. - An arbitrary number of app servers are launched, where a copy of everything from RabbitMQ, the CMS, and the LMS, to the forum and workers will run. - An OpenStack load balancer (as provided by LBaaS) directs requests from end users to the app servers. It is far from perfect, but we believe it is good enough for medium deployments.

Writing the

Heat template

  • 1 security group
  • 1 private network with a router
  • 2 cloud-configs (deploy and backend/app)
  • 1 deploy node with a public IP
  • 1 load balancer with a public IP
  • 3 backend servers
  • X app servers in a pool
  • Parameters: Key, public network, VM sizes, and number of app servers
  • Outputs: Public IPs
After figuring out how to use the Ansible roles in edx/configuration, we forged ahead with writing the Heat template that would create the actual nodes in the cluster. What you see in the slide is the shopping list of so-called "resources" that the Heat template creates, as well as a list of parameters one can pass into the template at stack creation time. The idea is that this template can be used in any public or private OpenStack cloud that supports Heat and LBaaS, with no modifications!

Leveraging

OpenStack

from

Open edX

Alright, we have a highly-available, scalable Open edX cluster to play with. How about using it to teach OpenStack itself, or any other technology that requires learners to access complex distributed environments?

A

cluster

to

play with

Here's what we think is missing from the world of technology training: affordable self-paced courses that give the trainee an easy way to practice the theory of cluster deployment and maintenance.

$$$!

Part of the problem is that giving each and every trainee their own cluster, even if it's just composed of VMs, would be very expensive.

Heat

to the rescue!

  • A Heat stack for each student...
  • ... suspended when not in use.
The solution we came up with is to fire a Heat stack for every student, but then suspend it if it's not in use. When the trainee comes back, of course, the stack is resumed automatically.

Enter

XBlocks!

https://github.com/hastexo/hastexo-xblock

As noted before, one of the reasons we chose Open edX was because it was extensible. And XBlocks were the extension API that seemed most suited to implement our solution: it offered enough flexibility to implement the needed features, and also an easy way to keep them customizable at the hands of course authors. In other words, with an XBlock we can let the course author define the Heat stack for a particular run, then fire it up for every trainee as needed.

OpenStack auth

<vertical url_name="lab_introduction">
  <hastexo
    url_name="lab_introduction"
    stack_template_path="hot_lab.yaml"
    stack_user_name="training"
    os_auth_url="https://ops.elastx.net:5000/v2.0"
    os_tenant_name="example.com"
    os_username="demo@example.com"
    os_password="foobarfoobarfoofoo" />
</vertical>
This is how a course author invokes the hastexo XBlock, using OLX. Here you can see the standard OpenStack authentication variables, and also the asset file name of the Heat template that should be uploaded to the data store. The user name that will be used to connect to the stack via SSH should also be defined here, and match what the Heat template creates.

Heat template outputs

outputs:
  public_ip:
    description: Floating IP address of deploy in public network
    value: { get_attr: [ deploy_floating_ip, floating_ip_address ] }
  private_key:
    description: Training private key
    value: { get_attr: [ training_key, private_key ] }

Connecting the

browser

to the

lab environment

The last piece of the puzzle was finding a way to connect the course content, as displayed on a student's browser, to the lab environment that would be created just for them. The solution we found was GateOne, a open source, Python and Javascript terminal emulator and SSH client. When run on the same app server as the LMS hosting the XBlock, it allowed us to create an SSH connection securely and automatically to the student's cluster.

Open edX

+ OpenStack

= Awesome!

Use the

Source

We have followed the precedent set by most other currently available XBlocks and released ours under the AGPL. The OpenStack deployment bits are of course under the AGPL as well, as is the rest of the edx-configuration repo.

https://www.hastexo.com/openedx

This is our Open edX landing page, from which you can continue to - resources related to our OpenStack community involvement, - news releases, - a 3-minute video explaining why we got into this (essentially, what I said at the top of the talk in 3 minutes, with pretty graphics and audio narration).

academy@hastexo.com

"edX", "Open edX", the edX logo, and the "Powered by Open edX" logo are trademarks or registered trademarks of edX, Inc. "OpenStack" and the OpenStack logo are trademarks or registered trademarks of the OpenStack Foundation. "Docker" and the Docker logo are trademarks or registered trademarks of Docker, Inc. "Ceph" and the Ceph logo are trademarks or registered trademarks of Red Hat, Inc. "Hadoop" and the Hadoop logo are trademarks or registered trademarks of the Apache Software Foundation. hastexo is not affiliated, endorsed by, or sponsored by the respective trademark owners. Graphics by Natalka Design. This presentation © 2015 hastexo Professional Services GmbH. All rights reserved.
Let me know you're here!