Autograder Image Builder#2324
Conversation
#2322) Filter out non-ready container images in autograder settings and add dockerfile_contents column
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis pull request introduces container image management for autograders and EC2-based autograding configuration. New models, controllers, views, and database migrations enable instructors and administrators to build, manage, and track Docker container images via TangoClient integration. Autograder configuration is expanded to optionally support AWS EC2 credentials and instance types, with encrypted storage for sensitive credentials. Changes
Sequence Diagram(s)sequenceDiagram
participant Instructor as Instructor/<br/>Browser
participant Controller as ContainerImages<br/>Controller
participant Model as ContainerImage<br/>Model
participant Tango as TangoClient
participant DB as Database
Instructor->>Controller: Upload Dockerfile (new/create)
activate Controller
Controller->>Tango: build_image(dockerfile_content)
activate Tango
Tango-->>Controller: { status, build_id }
deactivate Tango
Controller->>Model: Create with status=draft, build_id
activate Model
Model->>DB: Insert container_image
deactivate Model
Controller-->>Instructor: Redirect to image log
deactivate Controller
rect rgba(200, 200, 255, 0.5)
Note over Instructor,Tango: Build In Progress (polling)
end
Instructor->>Controller: Refresh status / Refresh All
activate Controller
Controller->>Tango: build_status(build_id)
activate Tango
Tango-->>Controller: { status, image_uri, logs }
deactivate Tango
Controller->>Model: Update with status, image_uri, build_logs
activate Model
Model->>DB: Update container_image
deactivate Model
Controller-->>Instructor: Display updated status & logs
deactivate Controller
rect rgba(200, 255, 200, 0.5)
Note over Instructor,DB: Build Ready - image_uri populated
end
sequenceDiagram
participant Instructor as Instructor/<br/>Browser
participant Form as Autograder<br/>Form (EC2 Tab)
participant Controller as Autograders<br/>Controller
participant Model as Autograder<br/>Model
participant Encryption as Encryption<br/>Layer
participant DB as Database
Instructor->>Form: Enter access key credentials
Instructor->>Form: Select instance type
Instructor->>Form: Submit form
Form->>Controller: POST with access_key, access_key_id, instance_type
activate Controller
alt use_access_key enabled
Controller->>Model: Create/Update autograder
activate Model
Model->>Encryption: Encrypt access_key
activate Encryption
Encryption-->>Model: access_key_ciphertext
deactivate Encryption
Model->>Encryption: Encrypt access_key_id
activate Encryption
Encryption-->>Model: access_key_id_ciphertext
deactivate Encryption
Model->>DB: Save with encrypted credentials
deactivate Model
else use_access_key disabled
Controller->>Model: Set access_key, access_key_id to nil
activate Model
Model->>DB: Save (credentials cleared)
deactivate Model
end
Controller-->>Instructor: Display success message
deactivate Controller
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This feature allows instructors to upload Dockerfiles, which will then be used to build the Docker image locally in Tango, and pushed to AWS ECR, so the autograding instances can pull the Docker image and use it to run the autograder.
at the top of the file).
Another feature we have is the public template image (base docker image). The admiin can upload images on the Manage Base Autograder Images page, and then instructors can upload Dockerfiles that pull from those images (FROM
Motivation and Context
Currently, there are no ways to create autograding images that can be used on ec2 instances from the frontend.
How Has This Been Tested?
Types of changes
Checklist:
overcommit --install && overcommit --signto use pre-commit hook for lintingOther issues / help required