gpustack-runner 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. gpustack_runner-0.1.0/.codespelldict +14 -0
  2. gpustack_runner-0.1.0/.codespellrc +15 -0
  3. gpustack_runner-0.1.0/.gitattributes +16 -0
  4. gpustack_runner-0.1.0/.gitignore +57 -0
  5. gpustack_runner-0.1.0/.pre-commit-config.yaml +39 -0
  6. gpustack_runner-0.1.0/.python-version +1 -0
  7. gpustack_runner-0.1.0/LICENSE +190 -0
  8. gpustack_runner-0.1.0/Makefile +117 -0
  9. gpustack_runner-0.1.0/PKG-INFO +142 -0
  10. gpustack_runner-0.1.0/README.md +126 -0
  11. gpustack_runner-0.1.0/docs/index.md +3 -0
  12. gpustack_runner-0.1.0/docs/modules/gpustack_runner.md +1 -0
  13. gpustack_runner-0.1.0/gpustack_runner/__init__.py +23 -0
  14. gpustack_runner-0.1.0/gpustack_runner/_version.py +36 -0
  15. gpustack_runner-0.1.0/gpustack_runner/_version.pyi +6 -0
  16. gpustack_runner-0.1.0/gpustack_runner/_version_appendix.py +1 -0
  17. gpustack_runner-0.1.0/gpustack_runner/runner.py +667 -0
  18. gpustack_runner-0.1.0/gpustack_runner/runner.py.json +596 -0
  19. gpustack_runner-0.1.0/hatch.toml +65 -0
  20. gpustack_runner-0.1.0/mkdocs.yml +48 -0
  21. gpustack_runner-0.1.0/pack/cann/Dockerfile +847 -0
  22. gpustack_runner-0.1.0/pack/cann/mindie-atb-models_2.1.rc1_linux-amd64_py3.11_torch2.1.0-abi0.tar.gz +3 -0
  23. gpustack_runner-0.1.0/pack/cann/mindie-atb-models_2.1.rc1_linux-arm64_py3.11_torch2.1.0-abi0.tar.gz +3 -0
  24. gpustack_runner-0.1.0/pack/corex/Dockerfile +393 -0
  25. gpustack_runner-0.1.0/pack/cuda/Dockerfile +666 -0
  26. gpustack_runner-0.1.0/pack/dtk/Dockerfile +397 -0
  27. gpustack_runner-0.1.0/pack/expand_matrix.sh +333 -0
  28. gpustack_runner-0.1.0/pack/matrix.yaml +102 -0
  29. gpustack_runner-0.1.0/pack/merge_runner.sh +78 -0
  30. gpustack_runner-0.1.0/pack/prune_runner.sh +56 -0
  31. gpustack_runner-0.1.0/pack/rocm/Dockerfile +873 -0
  32. gpustack_runner-0.1.0/pyproject.toml +38 -0
  33. gpustack_runner-0.1.0/pytest.ini +6 -0
  34. gpustack_runner-0.1.0/ruff.toml +101 -0
  35. gpustack_runner-0.1.0/tests/gpustack_runner/fixtures/__init__.py +23 -0
  36. gpustack_runner-0.1.0/tests/gpustack_runner/fixtures/test_list_backend_runners.json +114 -0
  37. gpustack_runner-0.1.0/tests/gpustack_runner/fixtures/test_list_runners_by_backend.json +636 -0
  38. gpustack_runner-0.1.0/tests/gpustack_runner/fixtures/test_list_service_runners.json +142 -0
  39. gpustack_runner-0.1.0/tests/gpustack_runner/test_runner.py +43 -0
  40. gpustack_runner-0.1.0/tools/activate +80 -0
  41. gpustack_runner-0.1.0/tools/chat.sh +342 -0
  42. gpustack_runner-0.1.0/tools/chat_tool_current_date_time.sh +17 -0
  43. gpustack_runner-0.1.0/tools/chat_tool_get_temperature.sh +23 -0
  44. gpustack_runner-0.1.0/tools/chat_tool_get_weather.sh +23 -0
  45. gpustack_runner-0.1.0/tools/chat_tool_square_of_number.sh +23 -0
  46. gpustack_runner-0.1.0/tools/chat_tool_square_root_of_number.sh +23 -0
  47. gpustack_runner-0.1.0/tools/chat_tool_where_am_i.sh +22 -0
  48. gpustack_runner-0.1.0/tools/run_runner.sh +201 -0
  49. gpustack_runner-0.1.0/tools/run_runner_cluster.sh +266 -0
  50. gpustack_runner-0.1.0/uv.lock +872 -0
  51. gpustack_runner-0.1.0/uv.toml +10 -0
@@ -0,0 +1,14 @@
1
+ alterting->altering
2
+ annotationg->annotating
3
+ assemlbe->assemble
4
+ capabiltiies->capabilities
5
+ custommizing->customizing
6
+ eaxecutes->executes
7
+ maximumn->maximum
8
+ mountns->mounts
9
+ name_missmatch->name_mismatch
10
+ notaibly->notably
11
+ pessimitically->pessimistically
12
+ recoreded->recorded
13
+ specicifed->specified
14
+ unsuppored->unsupported
@@ -0,0 +1,15 @@
1
+ # https://github.com/codespell-project/codespell#using-a-config-file
2
+ [codespell]
3
+
4
+ # Comma-separated list of files to skip.
5
+ skip = "*.json,*.jsonl,*.patch,*.txt"
6
+
7
+ # Comma separated list of words to be ignored. Words must be lowercased.
8
+ ignore-words-list = "ans, als, hel, boostrap, childs, te, vas, hsa, ment"
9
+
10
+ # Custom dictionary file that contains spelling corrections.
11
+ # Run with option '--dictionary=-' to include also default dictionary.
12
+ dictionary = .codespelldict
13
+
14
+ # Check file names as well.
15
+ check-filenames = true
@@ -0,0 +1,16 @@
1
+ * text=auto eol=lf
2
+
3
+ *.tar filter=lfs diff=lfs merge=lfs -text
4
+ *.gz filter=lfs diff=lfs merge=lfs -text
5
+ *.zip filter=lfs diff=lfs merge=lfs -text
6
+ *.7z filter=lfs diff=lfs merge=lfs -text
7
+ *.rar filter=lfs diff=lfs merge=lfs -text
8
+ *.exe filter=lfs diff=lfs merge=lfs -text
9
+ *.dll filter=lfs diff=lfs merge=lfs -text
10
+ *.so filter=lfs diff=lfs merge=lfs -text
11
+
12
+ *.png filter=lfs diff=lfs merge=lfs -text
13
+ *.jpg filter=lfs diff=lfs merge=lfs -text
14
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
15
+ *.gif filter=lfs diff=lfs merge=lfs -text
16
+ *.webp filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,57 @@
1
+ # IDE or OS
2
+ .idea/
3
+ .vscode/
4
+ .DS_Store
5
+ *.swp
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Python-generated files
11
+ _version.py
12
+ _version_appendix.py
13
+ __pycache__/
14
+ __pypackages__/
15
+ *.py[oc]
16
+ *$py.class
17
+ build/
18
+ downloads/
19
+ dist/
20
+ eggs/
21
+ .eggs/
22
+ parts/
23
+ sdist/
24
+ wheels/
25
+ pip-wheel-metadata/
26
+ share/python-wheels/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+ MANIFEST
31
+ site
32
+
33
+ # Virtual environments
34
+ env/
35
+ venv/
36
+ .env/
37
+ .venv/
38
+ ENV/
39
+ VENV/
40
+ env.bak/
41
+ venv.bak/
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .coverage
51
+ .coverage.*
52
+ .cache
53
+ nosetests.xml
54
+ coverage.xml
55
+ *.cover
56
+ *.py,cover
57
+ .hypothesis/
@@ -0,0 +1,39 @@
1
+ default_stages: [pre-commit]
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: destroyed-symlinks
8
+ - id: trailing-whitespace
9
+ - id: end-of-file-fixer
10
+ - id: check-symlinks
11
+ - id: check-yaml
12
+ args: [--allow-multiple-documents]
13
+ - id: check-toml
14
+ - id: check-ast
15
+ - id: check-added-large-files
16
+ - id: check-merge-conflict
17
+ - id: check-shebang-scripts-are-executable
18
+ - id: detect-private-key
19
+ - id: debug-statements
20
+ # - id: no-commit-to-branch
21
+ - repo: https://github.com/astral-sh/ruff-pre-commit
22
+ rev: v0.12.10
23
+ hooks:
24
+ - id: ruff-check
25
+ types_or: [python, pyi]
26
+ args: [--fix]
27
+ - id: ruff-format
28
+ types_or: [python, pyi]
29
+ - repo: https://github.com/codespell-project/codespell
30
+ rev: v2.4.1
31
+ hooks:
32
+ - id: codespell
33
+ - repo: https://github.com/commitizen-tools/commitizen
34
+ rev: v4.8.3
35
+ hooks:
36
+ - id: commitizen
37
+ stages: [commit-msg]
38
+ - id: commitizen-branch
39
+ stages: [pre-push]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright (c) 2024 The GPUStack authors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,117 @@
1
+ .SILENT:
2
+ .DEFAULT_GOAL := ci
3
+ .PHONY: docs
4
+
5
+ SHELL := /bin/bash
6
+
7
+ SRCDIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
8
+
9
+ GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
10
+ prepare:
11
+ echo "git_commit = \"$(GIT_COMMIT)\"" > $(SRCDIR)/gpustack_runner/_version_appendix.py
12
+
13
+ deps: prepare
14
+ @echo "+++ $@ +++"
15
+ uv sync --all-packages
16
+ uv lock
17
+ uv tree
18
+ @echo "--- $@ ---"
19
+
20
+ INSTALL_HOOKS ?= true
21
+ install: deps
22
+ @echo "+++ $@ +++"
23
+ if [[ "$(INSTALL_HOOKS)" == "true" ]]; then \
24
+ uv run pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push; \
25
+ else \
26
+ echo "Skipping pre-commit hook installation."; \
27
+ fi
28
+ @echo "--- $@ ---"
29
+
30
+ clean:
31
+ @echo "+++ $@ +++"
32
+ uv run pyclean -v $(SRCDIR)
33
+ rm -rf dist
34
+ @echo "--- $@ ---"
35
+
36
+ LINT_DIRTY ?= false
37
+ lint:
38
+ @echo "+++ $@ +++"
39
+ uv run pre-commit run --all-files --show-diff-on-failure
40
+ if [[ "$(LINT_DIRTY)" == "true" ]]; then \
41
+ if [[ -n $$(git status --porcelain) ]]; then \
42
+ echo "Code tree is dirty."; \
43
+ git diff --exit-code; \
44
+ fi; \
45
+ fi
46
+ @echo "--- $@ ---"
47
+
48
+ test:
49
+ @echo "+++ $@ +++"
50
+ uv run pytest
51
+ @echo "--- $@ ---"
52
+
53
+ build: prepare
54
+ @echo "+++ $@ +++"
55
+ rm -rf dist
56
+ uv build
57
+ @echo "--- $@ ---"
58
+
59
+ docs:
60
+ @echo "+++ $@ +++"
61
+ rm -rf site
62
+ uv run mkdocs build
63
+ @echo "--- $@ ---"
64
+
65
+ docs-online: docs
66
+ @echo "+++ $@ +++"
67
+ uv run mkdocs serve -o -w $(SRCDIR)/gpustack_runner
68
+ @echo "--- $@ ---"
69
+
70
+
71
+ PACKAGE_NAMESPACE ?= gpustack
72
+ PACKAGE_REPOSITORY ?= runner
73
+ PACKAGE_TAG ?= cuda12.4-vllm0.10.0
74
+ package:
75
+ @echo "+++ $@ +++"
76
+ if [[ -z $$(command -v docker) ]]; then \
77
+ echo "Docker is not installed. Please install Docker to use this target."; \
78
+ exit 1; \
79
+ fi
80
+ if [[ -z $$(docker buildx inspect --builder "gpustack") ]]; then \
81
+ docker run --rm --privileged tonistiigi/binfmt:qemu-v9.2.2-52 --uninstall qemu-*; \
82
+ docker run --rm --privileged tonistiigi/binfmt:qemu-v9.2.2 --install all; \
83
+ docker buildx create \
84
+ --name "gpustack" \
85
+ --driver "docker-container" \
86
+ --buildkitd-flags "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" \
87
+ --driver-opt "network=host,default-load=true,env.BUILDKIT_STEP_LOG_MAX_SIZE=-1,env.BUILDKIT_STEP_LOG_MAX_SPEED=-1" \
88
+ --bootstrap; \
89
+ fi
90
+ INPUT_NAMESPACE=$(PACKAGE_NAMESPACE) \
91
+ INPUT_REPOSITORY=$(PACKAGE_REPOSITORY) \
92
+ INPUT_TAG=$(PACKAGE_TAG) \
93
+ source $(SRCDIR)/pack/expand_matrix.sh
94
+ for BUILD_JOB in $$(echo "$${BUILD_JOBS}" | jq -cr '.[]'); do \
95
+ JOB_BACKEND=$$(echo "$${BUILD_JOB}" | jq -r '.backend'); \
96
+ JOB_PLATFORM=$$(echo "$${BUILD_JOB}" | jq -r '.platform'); \
97
+ JOB_TARGET=$$(echo "$${BUILD_JOB}" | jq -r '.service'); \
98
+ JOB_TAG=$(PACKAGE_NAMESPACE)/$(PACKAGE_REPOSITORY):$$(echo "$${BUILD_JOB}" | jq -r '.platform_tag'); \
99
+ JOB_ARGS=($$(echo "$${BUILD_JOB}" | jq -r '.args | map("--build-arg " + .) | join(" ")')); \
100
+ echo "### building '$${JOB_TAG}' for target '$${JOB_TARGET}' on platform '$${JOB_PLATFORM}' using backend '$${JOB_BACKEND}'"; \
101
+ set -x; \
102
+ docker buildx build \
103
+ --pull \
104
+ --allow network.host \
105
+ --allow security.insecure \
106
+ --builder "gpustack" \
107
+ --platform "$${JOB_PLATFORM}" \
108
+ --target "$${JOB_TARGET}" \
109
+ --tag "$${JOB_TAG}" \
110
+ --file "$(SRCDIR)/pack/$${JOB_BACKEND}/Dockerfile" \
111
+ $${JOB_ARGS[@]} \
112
+ $(SRCDIR)/pack/$${JOB_BACKEND}; \
113
+ set +x; \
114
+ done
115
+ @echo "--- $@ ---"
116
+
117
+ ci: deps install lint test clean build
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: gpustack-runner
3
+ Version: 0.1.0
4
+ Summary: GPUStack Runner is library for registering runnable accelerated backends and services in GPUStack.
5
+ Project-URL: Homepage, https://github.com/gpustack/runner
6
+ Project-URL: Bug Tracker, https://github.com/gpustack/gpustack/issues
7
+ License-File: LICENSE
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Python: >=3.10
14
+ Requires-Dist: dataclasses-json>=0.6.7
15
+ Description-Content-Type: text/markdown
16
+
17
+ # GPUStack Runner
18
+
19
+ This repository serves as the Docker image pack center for GPUStack Runner.
20
+ It provides a collection of Dockerfiles to build images for various inference services across different accelerated
21
+ backends.
22
+
23
+ ## Agenda
24
+
25
+ - [Directory Structure](#directory-structure)
26
+ - [Dockerfile Convention](#dockerfile-convention)
27
+ - [Docker Image Naming Convention](#docker-image-naming-convention)
28
+
29
+ ## Directory Structure
30
+
31
+ The pack skeleton is organized by backend:
32
+
33
+ ```text
34
+ pack
35
+ ├── {BACKEND 1}
36
+ │ └── Dockerfile
37
+ ├── {BACKEND 2}
38
+ │ └── Dockerfile
39
+ ├── {BACKEND 3}
40
+ │ └── Dockerfile
41
+ ├── ...
42
+ │ └── Dockerfile
43
+ └── {BACKEND N}
44
+ └── Dockerfile
45
+
46
+ ```
47
+
48
+ ## Dockerfile Convention
49
+
50
+ Each Dockerfile follows these conventions:
51
+
52
+ - Begin with comments describing the package logic in steps and usage of build arguments (`ARG`s).
53
+ - Use `ARG` for all required and optional build arguments. If a required argument is unused, mark it as `(PLACEHOLDER)`.
54
+ - Use heredoc syntax for `RUN` commands to improve readability.
55
+
56
+ ### Example Dockerfile Structure
57
+
58
+ ```dockerfile
59
+
60
+ # Describe package logic and ARG usage.
61
+ #
62
+ ARG PYTHON_VERSION=... # REQUIRED
63
+ ARG CMAKE_MAX_JOBS=... # REQUIRED
64
+ ARG {OTHERS} # OPTIONAL
65
+ ARG {BACKEND}_VERSION=... # REQUIRED
66
+ ARG {BACKEND}_ARCHS=... # REQUIRED
67
+ ARG {BACKEND}_{OTHERS}=... # OPTIONAL
68
+ ARG {SERVICE}_BASE_IMAGE=... # REQUIRED
69
+ ARG {SERVICE}_VERSION=... # REQUIRED
70
+ ARG {SERVICE}_{OTHERS}=... # OPTIONAL
71
+ ARG {SERVICE}_{FRAMEWORK}_VERSION=... # REQUIRED
72
+ ARG {SERVICE}_{FRAMEWORK}_{OTHERS}=... # OPTIONAL
73
+
74
+ # Stage Bake Runtime
75
+ FROM {BACKEND DEVEL IMAGE} AS runtime
76
+ SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
77
+ ARG TARGETPLATFORM
78
+ ARG TARGETOS
79
+ ARG TARGETARCH
80
+ ARG ...
81
+ RUN <<EOF
82
+ # TODO: install runtime dependencies
83
+ EOF
84
+
85
+ # Stage Install Service
86
+ FROM {BACKEND}_BASE_IMAGE AS {service}
87
+ SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
88
+ ARG TARGETPLATFORM
89
+ ARG TARGETOS
90
+ ARG TARGETARCH
91
+ ARG ...
92
+ RUN <<EOF
93
+ # TODO: install service and dependencies
94
+ EOF
95
+
96
+ WORKDIR /
97
+ ENTRYPOINT [ "tini", "--" ]
98
+
99
+ ```
100
+
101
+ ## Docker Image Naming Convention
102
+
103
+ The Docker image naming convention is as follows:
104
+
105
+ - Multi-architecture image names: `{NAMESPACE}/{REPOSITORY}:{TAG}`.
106
+ - Single-architecture image tags:
107
+ `{BACKEND}{BACKEND_VERSION%.*}[-{BACKEND_VARIANT}]-{SERVICE}{SERVICE_VERSION}-{OS}-{ARCH}`.
108
+ - Multi-architecture image tags: `{BACKEND}{BACKEND_VERSION%.*}[-{BACKEND_VARIANT}]-{SERVICE}{SERVICE_VERSION}[-dev]`.
109
+ - All names adn tags must be lowercase.
110
+
111
+ ### Example
112
+
113
+ - NAMESPACE: `gpustack`
114
+ - REPOSITORY: `runner`
115
+
116
+ | Accelerated Backend | OS/ARCH | Inference Service | Single-Arch Image Name | Multi-Arch Image Name |
117
+ |---------------------|-------------|-------------------|-------------------------------------------------------|-------------------------------------------|
118
+ | Ascend CANN 910b | linux/amd64 | vLLM | `gpustack/runner:cann8.1-910b-vllm0.9.2-linux-amd64` | `gpustack/runner:cann8.1-910b-vllm0.9.2` |
119
+ | Ascend CANN 910b | linux/arm64 | vLLM | `gpustack/runner:cann8.1-910b-vllm0.9.2-linux-arm64` | `gpustack/runner:cann8.1-910b-vllm0.9.2` |
120
+ | NVIDIA CUDA 12.8 | linux/amd64 | vLLM | `gpustack/runner:cuda12.8-910b-vllm0.9.2-linux-amd64` | `gpustack/runner:cuda12.8-910b-vllm0.9.2` |
121
+ | NVIDIA CUDA 12.8 | linux/arm64 | vLLM | `gpustack/runner:cuda12.8-910b-vllm0.9.2-linux-arm64` | `gpustack/runner:cuda12.8-910b-vllm0.9.2` |
122
+
123
+ ### Build and Release Workflow
124
+
125
+ 1. Build single architecture images for OS/ARCH, e.g. `gpustack/runner:cann8.1-910b-vllm0.9.2-linux-amd64`.
126
+ 2. Combine single-architecture images into a multiple architectures image, e.g.
127
+ `gpustack/runner:cann8.1-910b-vllm0.9.2-dev`.
128
+ 3. After testing, rename the multi-architecture image to the final tag, e.g. `gpustack/runner:cann8.1-910b-vllm0.9.2`.
129
+
130
+ ## License
131
+
132
+ Copyright (c) 2025 The GPUStack authors
133
+
134
+ Licensed under the Apache License, Version 2.0 (the "License");
135
+ you may not use this file except in compliance with the License.
136
+ You may obtain a copy of the License at [LICENSE](./LICENSE) file for details.
137
+
138
+ Unless required by applicable law or agreed to in writing, software
139
+ distributed under the License is distributed on an "AS IS" BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141
+ See the License for the specific language governing permissions and
142
+ limitations under the License.