Azure Cloud Lab Environment is aims to facilitate educators using Azure in their teaching. Using Azure, educators can create the tailor-made lab environment for every student, and it is very important during the pandemic as students cannot back to school and they do not have a good PC at home. On the other hand, students need to work on some complicate deployment projects to learn Azure across the semester. Two main problems – the First is the project cost to continue running the project for a few months, and the second there is no check point for students. In case, a student done something wrong in middle of semester, then he must redo everything or just give up the project. As a result, it limits the scale of student lab project exercise.
My working group (students) of the department of Information Technology - Hong Kong Institute of Vocational Education (IVE) Lee Wai... has built up the Azure Cloud Lab Environment, and widely adopted in the teaching of IT114115 Higher Diploma in Cloud and Data Centre Administration.
The focus of Azure Cloud Lab Environment:
The main function of the system is to create and destroy Infrastructure according to class schedule.
It runs every 5 minutes and check the Google Calendar for upcoming class. When event starts it sends message to start-event queue and when event ends it sends message to end-event queue. The event message includes the name of the lab, GitHubRepo, Branch, and Repeated Times. Repeated Times is calculated by CompletedEvent table historical record. It keeps OnGoingEvent table up-to-date.
It sends error details to administrator email and saves the error details to ErrorLog table.
It provides an online registration form for students to submit their Azure Subscription services principal. It prevents the duplication of submission by saving the name of lab and subscription ID in Subscription table, make a call to student subscription to ensure the services principal in Contributor role, and save the student email and services principal data in LabCredential table. Student need to
az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/<Your Subscription ID>"
They handle the message of start-event queue and end-event queue respectively. They are very similar, and the only difference is the container starting command – deploy.sh and undeploy.sh. they convert the event message into lab object for common parameters such as lab, GitHubRepo, Branch, and Repeated Times. They query the LabCredential table and get the list of students with services principal data. Each student subscription is handled by one Terraform Container, and pass services principal and other data through environment variables. 1 container group holds 10 containers. They record the creating and deleting activities in Deployment table.
TerraformContainer
It installs Azure CLI, Python 3.9, Terraform, and Curl and it can access the following variables
All containers mounts to containershare file share. Each container has it own folder. The deployment files keeps in the folder before the infrastructure deletion. Since deployment tools such as Terraform need to keep files (state file) for un-deployment.
deploy.sh
undeply.sh
It stores the TerraformContainer and it prevents hitting the rate limit of DockerHub.
It provides the https endpoint for the TerraformContainer to callback after deployment and undeployment. It updates the Deployment table and email information to students.
The following example is the default output of Terraform without.
If there is a VM, it can return IP address, username, and password to students.
All student subscriptions clean up to save cost.
If LifeCycleHookUrl is not empty, it will send post request with Terraform output json to LifeCycleHookUrl for 4 lift cycle events – CREATING, CREATED, DELETING, and DELETED.
The use case of LifeCycleHookUrl will be demonstrated in Azure Hybrid Cloud Lab Environment project.
Create a repeating event according to the class schedule.
There are 2 ways to create a continuous changing Azure Infrastructure.
lab.Branch = lab.Branch.Replace("###RepeatedTimes###", lab.RepeatedTimes.ToString());
TerraformContainer checkout the difference branch every lab class.Azure Cloud Lab Environment
https://github.com/wongcyrus/AzureCloudLabEnvironment
Example AzureCloudLabInfrastructure Repo
https://github.com/wongcyrus/AzureCloudLabInfrastructure
This project can centralize manage all student subscriptions with IasC way. It helps educators creating lesson specific Azure Resources for each student. This kind of customization is nearly impossible implementing in traditional physical lab environment. For learn Azure, the best way is to let students implement a large-scale project through out a whole semester or academy year. Automatic infrastructure evolution can let students continue working on the same project infrastructure during the lab class with checkpoint at minimal cost. For other IT course, teachers can create a specialized VM for each course with the latest software every class. Also, on top of this project, we have another project Azure Hybrid Cloud Lab Environment to manage student remote access physical lab computer at home.
Project collaborators include, Andy Lum, Jerry Lam, Fong Ho Luen, Jenny Nga, and Wina Yu from the IT114115 Higher Diploma in Cloud and Data Centre Administration.
Cyrus Wong is the senior lecturer of Department of Information Technology (IT) of the Hong Kong Institute of Vocational Education (Lee Wa... and he focuses on teaching public Cloud technologies. He is one of the Microsoft Learn for Educators Ambassador.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.