Skip to content

Commit 30afafa

Browse files
Merge branch 'main' into ksimpson/cuda_core_linker_155
2 parents fc11337 + 0c426b0 commit 30afafa

File tree

32 files changed

+243
-292
lines changed

32 files changed

+243
-292
lines changed

.github/actions/build/action.yml.j2 renamed to .github/actions/build/action.yml

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,14 @@ inputs:
2222
upload-enabled:
2323
required: true
2424
type: boolean
25+
python-version:
26+
required: true
27+
type: string
2528

2629
runs:
2730
using: composite
2831
steps:
2932

30-
<% for package_id, package_info in packages.items() %>
31-
- name: Download <<package_info.repo>> (artifacts)
32-
uses: ./.github/actions/download-artifacts
33-
with:
34-
artifact-repo: "<<package_info.repo>>"
35-
artifact-name: "<<package_info.artifact_name | replace_placeholder('repo', package_info.repo) | replace_placeholder('git_tag', package_info.git_tag) >>"
36-
target-device: "${{ inputs.target-device }}"
37-
git_sha: "<<package_info.git_tag>>"
38-
host-platform: ${{ inputs.host-platform }}
39-
dest-dir: ${{ env.ARTIFACTS_DIR }}
40-
dependencies-workflow: <<package_info.artifact_workflow>>
41-
<% endfor %>
42-
43-
<% if packages %>
44-
45-
- name: Display structure of downloaded artifacts
46-
shell: bash --noprofile --norc -xeuo pipefail {0}
47-
run: |
48-
pwd
49-
ls -lahR ${{ env.ARTIFACTS_DIR }}
50-
<% endif %>
51-
5233
- if: ${{ inputs.use-container }}
5334
name: Build (in container)
5435
shell: bash --noprofile --norc -xeuo pipefail {0}
@@ -60,14 +41,16 @@ runs:
6041
-e AWS_ACCESS_KEY_ID \
6142
-e AWS_SECRET_ACCESS_KEY \
6243
-e GITHUB_TOKEN \
63-
-e ARTIFACTS_DIR="$ARTIFACTS_DIR" \
44+
-e BINDINGS_ARTIFACTS_DIR="$BINDINGS_ARTIFACTS_DIR" \
45+
-e CORE_ARTIFACTS_DIR="$CORE_ARTIFACTS_DIR" \
6446
-e UPLOAD_ENABLED="$UPLOAD_ENABLED" \
6547
-e USE_CUDA="$USE_CUDA" \
6648
-e REPO_DIR="$REPO_DIR" \
6749
-e LEGATE_CORE_BUILD_MODE="$LEGATE_CORE_BUILD_MODE" \
6850
-e PYTHON_VERSION="$PYTHON_VERSION" \
6951
-v "${{ env.REPO_DIR }}:${{ env.REPO_DIR }}" \
70-
-v "${{ env.ARTIFACTS_DIR }}:${{ env.ARTIFACTS_DIR }}" \
52+
-v "${{ env.BINDINGS_ARTIFACTS_DIR }}:${{ env.BINDINGS_ARTIFACTS_DIR }}" \
53+
-v "${{ env.CORE_ARTIFACTS_DIR }}:${{ env.CORE_ARTIFACTS_DIR }}" \
7154
--rm "${{ inputs.docker-image }}" \
7255
/bin/bash -c "${{ env.REPO_DIR }}/continuous_integration/scripts/entrypoint ${{ env.REPO_DIR }}/continuous_integration/scripts/build ${{ inputs.build-type}} ${{ inputs.target-device }}"
7356
@@ -77,14 +60,26 @@ runs:
7760
run: |
7861
"${{ env.REPO_DIR }}/continuous_integration/scripts/entrypoint" "${{ env.REPO_DIR }}/continuous_integration/scripts/build" "${{ inputs.build-type}}" "${{ inputs.target-device }}"
7962
80-
- name: Display structure of the artifacts folder (post build)
63+
- name: Display structure of the bindings artifacts folder (post build)
64+
shell: bash --noprofile --norc -xeuo pipefail {0}
65+
run: |
66+
sudo chown -R $(whoami) ${{ env.BINDINGS_ARTIFACTS_DIR }}
67+
ls -lahR ${{ env.BINDINGS_ARTIFACTS_DIR }}
68+
69+
- name: Upload bindings build artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: ${{ env.BINDINGS_ARTIFACT_NAME }}
73+
path: ${{ env.BINDINGS_ARTIFACTS_DIR }}
74+
75+
- name: Display structure of the core artifacts folder (post build)
8176
shell: bash --noprofile --norc -xeuo pipefail {0}
8277
run: |
83-
sudo chown -R $(whoami) ${{ env.ARTIFACTS_DIR }}
84-
ls -lahR ${{ env.ARTIFACTS_DIR }}
78+
sudo chown -R $(whoami) ${{ env.CORE_ARTIFACTS_DIR }}
79+
ls -lahR ${{ env.CORE_ARTIFACTS_DIR }}
8580
86-
- name: Upload build artifacts
81+
- name: Upload core build artifacts
8782
uses: actions/upload-artifact@v4
8883
with:
89-
name: ${{ env.ARTIFACT_NAME }}
90-
path: ${{ env.ARTIFACTS_DIR }}
84+
name: ${{ env.CORE_ARTIFACT_NAME }}
85+
path: ${{ env.CORE_ARTIFACTS_DIR }}

.github/actions/download-artifacts/action.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
required: true
2121
type: boolean
2222
python-version:
23-
required: false
23+
required: true
2424
type: string
2525

2626
runs:
@@ -57,12 +57,16 @@ runs:
5757
PKG_DIR="${BUILD_MODE}/${TARGET_PLATFORM}"
5858
fi
5959
60-
echo "ARTIFACT_NAME=${{ inputs.host-platform }}-${{ inputs.build-type }}-${{ inputs.client-repo }}-python${{ inputs.python-version }}-${{ inputs.target-device }}${BUILD_MODE_STR}${WITH_TESTS_STR}-${{ github.sha }}" >> $GITHUB_ENV
61-
echo "ARTIFACTS_DIR=$(realpath "$(pwd)/dist")" >> $GITHUB_ENV
60+
PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.')
61+
62+
echo "BINDINGS_ARTIFACT_NAME=${{ inputs.host-platform }}-${{ inputs.build-type }}-cuda_bindings-python${PYTHON_VERSION_FORMATTED}-${{ inputs.target-device }}${BUILD_MODE_STR}${WITH_TESTS_STR}-${{ github.sha }}" >> $GITHUB_ENV
63+
echo "BINDINGS_ARTIFACTS_DIR=$(realpath "$(pwd)/cuda_bindings/dist")" >> $GITHUB_ENV
64+
echo "CORE_ARTIFACT_NAME=${{ inputs.host-platform }}-${{ inputs.build-type }}-cuda_core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.target-device }}${BUILD_MODE_STR}${WITH_TESTS_STR}-${{ github.sha }}" >> $GITHUB_ENV
65+
echo "CORE_ARTIFACTS_DIR=$(realpath "$(pwd)/cuda_core/dist")" >> $GITHUB_ENV
6266
echo "USE_CUDA=${{ (inputs.target-device == 'cpu' && 'OFF') || 'ON' }}" >> $GITHUB_ENV
6367
echo "UPLOAD_ENABLED=${{ (inputs.upload-enabled == 'true' && 'ON') || 'OFF' }}" >> $GITHUB_ENV
6468
echo "LEGATE_CORE_BUILD_MODE=${BUILD_MODE}" >> $GITHUB_ENV
6569
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
6670
echo "TARGET_PLATFORM=${TARGET_PLATFORM}" >> $GITHUB_ENV
6771
echo "PKG_DIR=${PKG_DIR}" >> $GITHUB_ENV
68-
echo "PYTHON_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV
72+
echo "PYTHON_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV

.github/workflows/ci-gh.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- release
2525
upload-enabled:
2626
- false
27+
python-version:
28+
#TODO cover the whole python and cuda matrix
29+
- 3.12
2730
uses:
2831
./.github/workflows/gh-build-and-test.yml
2932
with:
@@ -32,4 +35,5 @@ jobs:
3235
build-mode: ${{ matrix.build-mode }}
3336
build-type: ci
3437
upload-enabled: ${{ matrix.upload-enabled }}
38+
python-version: ${{ matrix.python-version }}
3539
secrets: inherit

.github/workflows/gh-build-and-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
upload-enabled:
1717
type: boolean
1818
required: true
19+
python-version:
20+
type: string
21+
required: true
1922
jobs:
2023
build:
2124
if: ${{ github.repository_owner == 'nvidia' }}
@@ -31,4 +34,5 @@ jobs:
3134
dependencies-file: ""
3235
build-mode: ${{ inputs.build-mode }}
3336
upload-enabled: ${{ inputs.upload-enabled }}
37+
python-version: ${{ inputs.python-version }}
3438
secrets: inherit

.github/workflows/gh-build.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ on:
3333
required: true
3434
type: boolean
3535
python-version:
36-
required: false
36+
required: true
3737
type: string
3838

3939
jobs:
@@ -63,27 +63,6 @@ jobs:
6363
upload-enabled: ${{ inputs.upload-enabled }}
6464
python-version: ${{ inputs.python-version }}
6565

66-
- name: Render templates
67-
shell: bash --noprofile --norc -xeuo pipefail {0}
68-
run: |
69-
pip -q install jinja2
70-
71-
DEPENDENCIES_FILE=""
72-
73-
if [ -z "${{ inputs.dependencies-file }}" ]; then
74-
DEPENDENCIES_FILE="${REPO_DIR}/continuous_integration/no_dependencies.json"
75-
else
76-
DEPENDENCIES_FILE="${REPO_DIR}/${{ inputs.dependencies-file }}"
77-
fi
78-
79-
${REPO_DIR}/continuous_integration/scripts/render-template.py .github/actions/build/action.yml.j2 "${DEPENDENCIES_FILE}" .github/actions/build/action.yml
80-
81-
- name: Dump templates
82-
shell: bash --noprofile --norc -xeuo pipefail {0}
83-
run: |
84-
echo ${REPO_DIR}/.github/actions/build/action.yml
85-
cat ${REPO_DIR}/.github/actions/build/action.yml
86-
8766
- name: Call build action
8867
uses: ./.github/actions/build
8968
with:

continuous_integration/no_dependencies.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

continuous_integration/scripts/build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
build_ci() {
44
set -xeou pipefail
55

6-
cd "${REPO_DIR}"
7-
86
export CUDA_HOME="${CONDA_PREFIX}/targets/x86_64-linux"
97
export PARALLEL_LEVEL=$(nproc --ignore 1)
108

9+
cd "${REPO_DIR}/cuda_bindings"
10+
python setup.py bdist_wheel
11+
12+
cd "${REPO_DIR}/cuda_core"
1113
python setup.py bdist_wheel
1214
}
1315

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
# Function to generate environment.yml
4+
generate_environment_yml() {
5+
local python_version=$1
6+
local cuda_version=$2
7+
local output_path=$3
8+
9+
cat <<EOF > "${output_path}/environment.yml"
10+
name: cuda_python
11+
channels:
12+
- defaults
13+
- conda-forge
14+
dependencies:
15+
- python=${python_version}
16+
- cython
17+
- pytest
18+
- numpy
19+
- setuptools
20+
- wheel
21+
- pip
22+
- cuda-version=${cuda_version}
23+
- cuda-cudart-static
24+
- cuda-driver-dev
25+
- cuda-cudart-dev
26+
- cuda-profiler-api
27+
- cuda-nvrtc-dev
28+
- cuda-nvcc
29+
- pip:
30+
- pytest-benchmark
31+
- pyclibrary
32+
- versioneer==0.29
33+
- tomli; python_version < "3.11"
34+
- pywin32; sys_platform == 'win32'
35+
EOF
36+
}

continuous_integration/scripts/make-conda-env

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,16 @@
33
set -x
44

55
make_ci_env() {
6-
mamba env create -n "${CONDA_ENV}" -f "${REPO_DIR}/continuous_integration/environment.yml"
7-
}
8-
9-
make_test_env() {
10-
. conda-utils
11-
12-
mamba env create -n "${CONDA_ENV}" -f "${REPO_DIR}/continuous_integration/environment.yml"
13-
14-
activate_conda_env
15-
16-
pip install "${ARTIFACTS_DIR}"/*.whl
17-
6+
#TODO wire cuda version as a top level matrix argument
7+
generate_environment_yml "${PYTHON_VERSION}" 12.6 .
8+
mamba env create -n "${CONDA_ENV}" -f ./environment.yml
189
}
1910

2011
make_conda_env() {
2112
set -xeuo pipefail
2213

2314
. setup-utils;
15+
. generate-environment
2416
set_base_defs;
2517

2618
case "$1" in

continuous_integration/scripts/render-template.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)