0
0
MLOpsdevops~10 mins

Docker for ML reproducibility in MLOps - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Dockerfile line to specify the base image for a Python ML project.

MLOps
FROM [1]
Drag options to blanks, or click blank then click option'
Anode:14
Bubuntu:latest
Calpine:3.12
Dpython:3.9-slim
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a base image without Python installed.
Using a Node.js image which is not suitable for Python ML projects.
2fill in blank
medium

Complete the command to build a Docker image named 'ml-model' from the current directory.

MLOps
docker build -t [1] .
Drag options to blanks, or click blank then click option'
Aml-model
Bmyapp
Cpython-app
Dmodel-image
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic or unrelated image name.
Omitting the dot at the end of the build command.
3fill in blank
hard

Fix the error in the Dockerfile line to install dependencies from requirements.txt.

MLOps
RUN pip [1] -r requirements.txt
Drag options to blanks, or click blank then click option'
Adownload
Bupdate
Cinstall
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip update' which is not a valid pip command.
Using 'pip upgrade' which does not install new packages.
4fill in blank
hard

Fill both blanks to run the container interactively and remove it after exit.

MLOps
docker run [1] [2] ml-model
Drag options to blanks, or click blank then click option'
A-it
B-rm
C--rm
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-rm' instead of '--rm' which is invalid.
Using '-d' which runs the container detached, not interactively.
5fill in blank
hard

Fill all three blanks to create a Docker volume, mount it to /data, and run the container using it.

MLOps
docker volume [1] ml_data

docker run -v ml_data:[2] [3] ml-model
Drag options to blanks, or click blank then click option'
Acreate
B/data
C--rm
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' instead of 'create' to make a volume.
Mounting to a wrong path inside the container.
Omitting the '--rm' flag causing leftover containers.