-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApptainer.def
More file actions
42 lines (32 loc) · 950 Bytes
/
Apptainer.def
File metadata and controls
42 lines (32 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Bootstrap: docker
From: python:3.11-slim
%labels
Author Your Name
Version 0.1.0
Description ML Project Template Container
%files
pyproject.toml /opt/project/pyproject.toml
uv.lock /opt/project/uv.lock
%post
# Install system dependencies
apt-get update && apt-get install -y \
build-essential \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="/root/.local/bin:$PATH"
# Set working directory
cd /opt/project
# Install Python dependencies using uv
uv sync --frozen
%environment
export PATH="/root/.local/bin:$PATH"
export PYTHONPATH="/opt/project/src:$PYTHONPATH"
%runscript
exec "$@"
%help
This is a containerized environment for the ML project template.
To build: apptainer build image.sif Apptainer.def
To run: apptainer exec image.sif python -m your_module