Containers for HPC
How to package local code in a container and run it in the cloud
Intro to Docker
Download sample code
git clone https://github.com/sanjeev-one/Intro-to-Supercomputing-24---Duke-IEEE.git```dockerfile
# Use the official Python image with version 3.8
FROM python:3.8-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . .
# Install any dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Run ml_app.py when the container launches
CMD ["python", "ml_app.py"]
```Build and Run the Docker Container
Run the Container Locally:
Push to Docker Hub and Deploy on a VM - skip if doing workshop
On the VM, Pull and Run the Image:
HPC Specific Variants
Apptainer
Running container on TAMU Faster
Interact with container
Shell
Executing commands
Running a container
Last updated