0
0
MLOpsdevops~10 mins

Docker for ML workloads in MLOps - Interactive Code Practice

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

Complete the code to specify the base image for a Dockerfile used in ML workloads.

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

Complete the Dockerfile command to copy your ML model files into the container.

MLOps
COPY [1] /app/model/
Drag options to blanks, or click blank then click option'
Amodel/
Bsrc/
Cdata/
Dscripts/
Attempts:
3 left
💡 Hint
Common Mistakes
Copying the wrong directory like src/ or data/.
Forgetting to copy the model files into the container.
3fill in blank
hard

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

MLOps
RUN pip install [1] requirements.txt
Drag options to blanks, or click blank then click option'
A-r
B-e
C--upgrade
D--no-cache-dir
Attempts:
3 left
💡 Hint
Common Mistakes
Using flags that do not specify a requirements file.
Omitting the flag and causing pip to treat requirements.txt as a package name.
4fill in blank
hard

Fill both blanks to expose port 5000 and set the command to run the ML app.

MLOps
EXPOSE [1]
CMD ["python", "[2]"]
Drag options to blanks, or click blank then click option'
A5000
Bapp.py
Cmain.py
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Exposing the wrong port like 8080.
Running a wrong or non-existent Python script.
5fill in blank
hard

Fill all three blanks to create a Docker volume, mount it, and set environment variable for data path.

MLOps
VOLUME ["[1]"]
RUN mkdir -p [2]
ENV DATA_PATH=[3]
Drag options to blanks, or click blank then click option'
A/data
B/mnt/data
C/app/data
D/var/data
Attempts:
3 left
💡 Hint
Common Mistakes
Using different paths for volume and environment variable.
Not creating the directory before mounting.