Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
kserve/python/lgb.Dockerfile at master · kserve/kserve · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
kserve
kserve
Repository navigation
Code
Issues
77
(77)
Pull requests
154
(154)
Discussions
Actions
Projects
Security and quality
1
(1)
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
kserve
/
python
/
lgb.Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
73 lines (56 loc) · 2.16 KB
master
Breadcrumbs
kserve
/
python
/
lgb.Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
73 lines (56 loc) · 2.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ARG
PYTHON_VERSION=3.11
ARG
BASE_IMAGE=python:${PYTHON_VERSION}-slim-bookworm
ARG
VENV_PATH=/prod_venv
FROM
${BASE_IMAGE} AS builder
#
Install system dependencies
RUN
apt-get update && apt-get install -y --no-install-recommends python3-dev curl build-essential && apt-get clean && \
rm -rf /var/lib/apt/lists/*
#
Install uv and ensure it's in PATH
RUN
curl -LsSf https://astral.sh/uv/install.sh | sh && \
ln -s /root/.local/bin/uv /usr/local/bin/uv
#
Activate virtual env
ARG
VENV_PATH
ENV
VIRTUAL_ENV=${VENV_PATH}
RUN
uv venv $VIRTUAL_ENV
ENV
PATH=
"$VIRTUAL_ENV/bin:$PATH"
#
Copy storage metadata for editable dependency resolution
COPY
storage/pyproject.toml storage/uv.lock storage/
#
Install dependencies for kserve using uv
COPY
kserve/pyproject.toml kserve/uv.lock kserve/
RUN
cd kserve && uv sync --active --no-cache
COPY
kserve kserve
RUN
cd kserve && uv sync --active --no-cache
#
Install kserve-storage
COPY
storage storage
RUN
cd storage && uv pip install . --no-cache
#
Install dependencies for lgbserver using uv
COPY
lgbserver/pyproject.toml lgbserver/uv.lock lgbserver/
RUN
cd lgbserver && uv sync --active --no-cache
COPY
lgbserver lgbserver
RUN
cd lgbserver && uv sync --active --no-cache
#
Generate third-party licenses
COPY
pyproject.toml pyproject.toml
COPY
third_party/pip-licenses.py pip-licenses.py
#
TODO: Remove this when upgrading to python 3.11+
RUN
pip install --no-cache-dir tomli
RUN
mkdir -p third_party/library && python3 pip-licenses.py
#
---------- Production image ----------
FROM
${BASE_IMAGE} AS prod
RUN
apt-get update && apt-get install -y --no-install-recommends \
libgomp1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#
Activate virtual env
ARG
VENV_PATH
ENV
VIRTUAL_ENV=${VENV_PATH}
ENV
PATH=
"${VIRTUAL_ENV}/bin:$PATH"
#
Create non-root user
RUN
useradd kserve -m -u 1000 -d /home/kserve
COPY
--from=builder --chown=kserve:kserve third_party third_party
COPY
--from=builder --chown=kserve:kserve $VIRTUAL_ENV $VIRTUAL_ENV
COPY
--from=builder kserve kserve
COPY
--from=builder storage storage
COPY
--from=builder lgbserver lgbserver
USER
1000
ENV
PYTHONPATH=/lgbserver
ENTRYPOINT
[
"python"
,
"-m"
,
"lgbserver"
]
You can’t perform that action at this time.