Share via


Deploy OkPy to Azure PaaS

Automate Grading & Personalize Feedback.

OK autogrades programming assignments, facilitates submission, composition feedback, and analytics for your class.

View a Demo of OkPy

The ok.py server collects submissions and displays analysis of student progress based on logging sent from client scripts the ok.py software was developed for CS 61A at UC Berkeley and is now used in numerous institutions around the world for autograding and assessment of Students.

Deploying Okpy on Azure

You can deploy Ok.py to Azure tenant using the deploy to Azure Script on this page.

In a production environment you may wish to customize these templates to share resources between environments and to adjust resource sizing. For example you may wish to use a single mySQL server with multiple databases, rather than one server per environment.

The provided templates deploy everything within the Resource Group outlined below. Items outside the resource group are an indication as to how Ok.py can integrate with additional Azure services:

Setup

Prior to deploying the template the terms and conditions for SendGrid must be accepted.

Using PowerShell:

 Get-AzureRmMarketplaceTerms -Publisher "sendgrid" -Product "sendgrid_azure" -Name "free" | Set-AzureRmMarketplaceTerms -Accept

If you do not have access to PowerShell this can be run in the cloud shell via the Azure Portal.

Next, you'll need to create a Service Principal following the instructions here. The Service Principal is a credential to your Azure subscription that will enable the OKpy deployment to create Azure resources on your behalf.

Finally, grant read permissions to your Azure Container Registry instance to the Service Principal. This will enable the OKpy deployment to access Docker images for okpy and autopy in your registry and deploy them to the infrastructure set up by the template:

 SP_APP_ID=<insert the app id of your okpy service principal here>
ACR_NAME=<insert name of your container registry here>
RESOURCE_GROUP=<insert the resource group of your container registry here>

az role assignment create \
  --assignee "${SP_APP_ID}" \
  --role Reader \
  --scope "$(az acr show --name "${ACR_NAME}" --resource-group "${ACR_RESOURCE_GROUP}" --query "id" --output tsv)"

Deployment

To deploy Ok.py to Azure use the deploy button below. If you are not familiar with the configuration of Azure resources please check our integration guide.

Deploy to Azure

You can also run the deployment locally:

 mkdir -p azure/paas/secrets
docker build -t ok-setup azure/paas
docker run -v $PWD/azure/paas/secrets:/app/secrets ok-setup

Note that the deployment can take upwards of 30 minutes to complete. After the deployment is done, remember to update your Active Directory application to include https://<app-name>.<location>.cloudapp.azure.com/login/authorized/ as a redirect URL.

If your interested in learning more about OKpy on Azure see https://github.com/okpy/ok/tree/master/azure