-
Notifications
You must be signed in to change notification settings - Fork 20
fix: slim container image #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,32 @@ | |
|
|
||
| set -euo pipefail | ||
|
|
||
| chmod +x tools/rapids-* | ||
|
|
||
| apt update | ||
| apt install -y jq gh unzip curl gettext | ||
|
|
||
| curl -fsSL "https://raw.githubusercontent.com/rapidsai/ci-imgs/v26.06.00a/context/condarc.tmpl" | \ | ||
| envsubst | tee ~/.condarc | ||
|
|
||
| SCCACHE_VERSION="${SCCACHE_VER}" rapids-install-sccache | ||
|
|
||
| rapids-mamba-retry update --all -y -n base | ||
| conda install -y conda-build | ||
|
|
||
| # install expected Python version | ||
| PYTHON_MAJOR_VERSION=${PYTHON_VERSION%%.*} | ||
| PYTHON_MINOR_VERSION=${PYTHON_VERSION#*.} | ||
| PYTHON_UPPER_BOUND="${PYTHON_MAJOR_VERSION}.$((PYTHON_MINOR_VERSION+1)).0a0" | ||
| PYTHON_MINOR_PADDED=$(printf "%02d" "$PYTHON_MINOR_VERSION") | ||
| PYTHON_VERSION_PADDED="${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_PADDED}" | ||
| if [[ "$PYTHON_VERSION_PADDED" > "3.12" ]]; then | ||
| PYTHON_ABI_TAG="cp${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION}" | ||
| else | ||
| PYTHON_ABI_TAG="cpython" | ||
| fi | ||
| rapids-mamba-retry install -y -n base "python>=${PYTHON_VERSION},<${PYTHON_UPPER_BOUND}=*_${PYTHON_ABI_TAG}" | ||
|
Comment on lines
+26
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bash string comparison for version numbers is fragile. The Given that the matrix includes versions 3.10–3.14, this currently works, but the logic is error-prone if 3.9 or earlier is ever added. 🔧 Proposed fix using numeric comparison-PYTHON_MINOR_PADDED=$(printf "%02d" "$PYTHON_MINOR_VERSION")
-PYTHON_VERSION_PADDED="${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_PADDED}"
-if [[ "$PYTHON_VERSION_PADDED" > "3.12" ]]; then
+if [[ "$PYTHON_MAJOR_VERSION" -gt 3 ]] || { [[ "$PYTHON_MAJOR_VERSION" -eq 3 ]] && [[ "$PYTHON_MINOR_VERSION" -gt 12 ]]; }; then
PYTHON_ABI_TAG="cp${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION}"
else
PYTHON_ABI_TAG="cpython"
fi🧰 Tools🪛 Shellcheck (0.11.0)[error] 26-26: Decimals are not supported. Either use integers only, or use bc or awk to compare. (SC2072) 🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The syntax for conda install with version constraint and build string selector uses the MatchSpec format: conda install package==version=build_string for exact matches, or variations like package=version=build_string (single = before build in some contexts). For patterns, use wildcards like package=version=py3* or bracket notation package[build=py3*]. Examples: - Exact: conda install numpy==1.23.1=py39hc836922_0 - Version with build pattern: conda install numpy=1.23.1=py39* - Build selector: conda install numpy[build=py39*] - Exclude build: conda install numpy[build!=hc292b87_0] This works in conda install, conda search, and environment files. Use quotes for complex specs with spaces or operators: conda install "numpy>=1.23=py39*". Citations:
🏁 Script executed: cd ci && wc -l build_conda_python.shRepository: NVIDIA/numbast Length of output: 82 🏁 Script executed: cd ci && sed -n '25,35p' build_conda_python.shRepository: NVIDIA/numbast Length of output: 453 🏁 Script executed: rg "rapids-mamba-retry install" -A 2 -B 2Repository: NVIDIA/numbast Length of output: 356 🌐 Web query:
💡 Result: Conda MatchSpec syntax supports multiple version constraints using operators like >=, <, <=, >, ==, !=, combined with logical operators , (AND) and | (OR). Build strings can be specified exactly or with wildcards/patterns. Key syntax elements: - Positional form: name version build - Examples: - numpy==1.21.0=py39h1234567_0 (exact version and build) - foo 1.0 py27_0 → foo==1.0=py27_0 - >=1.0 , < 2.0 py34_0 → version '>=1.0,<2.0' with build py34_0 - Bracket notation for explicit constraints: - conda-forge::foo[version='>=1.0'] - numpy[version='>=1.7,<2.0', build=py3*] - Version specifiers support: - Single: >=1.0, <2.0, ==1.2.3, 1.2.* (fuzzy) - Multiple: >=1.0,<2.0 (AND), >1.8,<2|==1.7 (AND then OR) - Note: Spaces around operators are ignored or normalized; no parentheses for grouping (may cause parsing issues). - Build string: Exact like =py27_0 or patterns like py2*, specified after version with = or in brackets [build=py2*]. Canonical form: (channel(/subdir):)name(version(build))[key=value,...] Usage examples: - conda install "numpy>=1.20,<1.22 py3*" - conda search conda-forge::python[version='>=3.9',build='h*'] This is based on conda's official MatchSpec documentation (conda 26.1.1) and source code, which confirm parsing of complex version+build specs like ">=1.0 , < 2.0 py34_0" and bracket syntax for operators. Citations:
🏁 Script executed: # Search for similar patterns in the codebase
rg "python>=" --type sh -A 1 -B 1Repository: NVIDIA/numbast Length of output: 245 Fix the conda version constraint syntax to properly specify the build string. The version constraint Or use bracket notation for explicit constraints: 🤖 Prompt for AI Agents |
||
|
|
||
| source rapids-configure-sccache | ||
|
|
||
| source rapids-date-string | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: NVIDIA/numbast
Length of output: 6094
Package only the
tools/payload, not the wholegha-toolscheckout.GitHub artifacts do not preserve file permissions: single-artifact downloads extract directly to the requested
pathwith all files set to644and directories to755. With line 130 adding${GITHUB_WORKSPACE}/toolstoPATH, the current setup downloads the entire external repo into the workspace root, whererapidsai/gha-toolshas top-levelREADME.md,LICENSE,CONTRIBUTING.md, and other files that can overwrite the checked-out source tree. More critically, tools likerapids-find-anaconda-uploads.pyandrapids-retry(invoked directly inci/upload_conda.sh) lose their executable bit after the artifact round-trip, causing invocation failures.🔧 Suggested fix
fetch-gha-tools: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: repository: rapidsai/gha-tools ref: v0.0.198 path: gha-tools fetch-depth: 1 + - name: Archive RAPIDS gha-tools + run: tar -C gha-tools -czf rapids-gha-tools-tools.tgz tools - uses: actions/upload-artifact@v7 with: name: rapids-gha-tools - path: gha-tools + path: rapids-gha-tools-tools.tgz if-no-files-found: error ... - uses: actions/download-artifact@v6 with: name: rapids-gha-tools - path: ${{ github.workspace }} + path: ${{ github.workspace }}/gha-tools + - name: Extract RAPIDS gha-tools + run: | + mkdir -p "${GITHUB_WORKSPACE}/gha-tools" + tar -xzf "${GITHUB_WORKSPACE}/gha-tools/rapids-gha-tools-tools.tgz" -C "${GITHUB_WORKSPACE}/gha-tools" - name: Add RAPIDS gha-tools to PATH - run: echo "${GITHUB_WORKSPACE}/tools" | tee -a "${GITHUB_PATH}" + run: echo "${GITHUB_WORKSPACE}/gha-tools/tools" | tee -a "${GITHUB_PATH}"🤖 Prompt for AI Agents