Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions ci/scripts/github/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ set -e
GITHUB_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

source ${GITHUB_SCRIPT_DIR}/common.sh
WHEELS_DIR=${WORKSPACE_TMP}/wheels/aiqtoolkit
WHEELS_BASE_DIR="${WORKSPACE_TMP}/wheels"
WHEELS_DIR="${WHEELS_BASE_DIR}/aiqtoolkit"

create_env extra:all

Expand All @@ -32,11 +33,6 @@ function get_git_tag() {
GIT_TAG=$(get_git_tag)
rapids-logger "Git Version: ${GIT_TAG}"

function build_wheel() {
rapids-logger "Building Wheel for $1"
uv build --wheel --no-progress --out-dir "${WHEELS_DIR}/$2" --directory $1
}

build_wheel . "aiqtoolkit/${GIT_TAG}"


Expand All @@ -52,8 +48,8 @@ for AIQ_PACKAGE in "${AIQ_PACKAGES[@]}"; do
build_package_wheel ${AIQ_PACKAGE}
done

WHEELS_DIR=${WORKSPACE_TMP}/wheels/agentiq
if [[ "${BUILD_AIQ_COMPAT}" == "true" ]]; then
WHEELS_DIR="${WHEELS_BASE_DIR}/agentiq"
for AIQ_COMPAT_PACKAGE in "${AIQ_COMPAT_PACKAGES[@]}"; do
build_package_wheel ${AIQ_COMPAT_PACKAGE}
done
Expand Down
63 changes: 35 additions & 28 deletions ci/scripts/gitlab/artifactory_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ fi
# Define variables
AIQ_ARCH="any"
AIQ_OS="any"
AIQ_COMPONENT_NAME="aiqtoolkit"

AIQ_COMPONENTS=("aiqtoolkit" "agentiq")

WHEELS_BASE_DIR="${CI_PROJECT_DIR}/.tmp/wheels"
WHEELS_DIR="${WHEELS_BASE_DIR}/${AIQ_COMPONENT_NAME}"

# Define the subdirectories to be exclude
EXCLUDE_SUBDIRS=("examples")

Expand Down Expand Up @@ -70,8 +71,8 @@ if [[ "${UPLOAD_TO_ARTIFACTORY}" != "true" && "${LIST_ARTIFACTORY_CONTENTS}" !=
fi

# Ensure wheels exist before uploading (including subdirectories)
if [[ ! -d "$WHEELS_DIR" || -z "$(find "$WHEELS_DIR" -type f -name "*.whl" 2>/dev/null)" ]]; then
echo "No wheels found in $WHEELS_DIR or its subdirectories. Exiting."
if [[ ! -d "$WHEELS_BASE_DIR" || -z "$(find "$WHEELS_BASE_DIR" -type f -name "*.whl" 2>/dev/null)" ]]; then
echo "No wheels found in $WHEELS_BASE_DIR or its subdirectories. Exiting."
exit 1
fi

Expand All @@ -86,33 +87,39 @@ install_jfrog_cli

# Upload wheels if enabled
if [[ "${UPLOAD_TO_ARTIFACTORY}" == "true" ]]; then
for SUBDIR in $(find "${WHEELS_DIR}" -mindepth 1 -maxdepth 1 -type d); do
SUBDIR_NAME=$(basename "${SUBDIR}")

# Skip directories listed in EXCLUDE_SUBDIRS
if [[ " ${EXCLUDE_SUBDIRS[@]} " =~ " ${SUBDIR_NAME} " ]]; then
echo "Skipping excluded directory: ${SUBDIR_NAME}"
continue
fi

echo "Uploading wheels from ${SUBDIR} to Artifactory..."

# Find all .whl files in the current subdirectory (no depth limit)
find "${SUBDIR}" -type f -name "*.whl" | while read -r WHEEL_FILE; do
# Extract relative path to preserve directory structure
RELATIVE_PATH="${WHEEL_FILE#${WHEELS_BASE_DIR}/}"
ARTIFACTORY_PATH="${AIQ_ARTIFACTORY_NAME}/${RELATIVE_PATH}"

echo "Uploading ${WHEEL_FILE} to ${ARTIFACTORY_PATH}..."

CI=true jf rt u --fail-no-op --url="${AIQ_ARTIFACTORY_URL}" \
--user="${URM_USER}" --password="${URM_API_KEY}" \
--flat=false "${WHEEL_FILE}" "${ARTIFACTORY_PATH}" \
--target-props "arch=${AIQ_ARCH};os=${AIQ_OS};branch=${GIT_TAG};component_name=${AIQ_COMPONENT_NAME};version=${GIT_TAG};release_approver=${RELEASE_APPROVER};release_status=${RELEASE_STATUS}"
for AIQ_COMPONENT_NAME in ${AIQ_COMPONENTS[@]}; do
WHEELS_DIR="${WHEELS_BASE_DIR}/${AIQ_COMPONENT_NAME}"
rapids-logger "AIQ Component : ${AIQ_COMPONENT_NAME} Dir : ${WHEELS_DIR}"

for SUBDIR in $(find "${WHEELS_DIR}" -mindepth 1 -maxdepth 1 -type d); do
SUBDIR_NAME=$(basename "${SUBDIR}")

# Skip directories listed in EXCLUDE_SUBDIRS
if [[ " ${EXCLUDE_SUBDIRS[@]} " =~ " ${SUBDIR_NAME} " ]]; then
echo "Skipping excluded directory: ${SUBDIR_NAME}"
continue
fi

echo "Uploading wheels from ${SUBDIR} to Artifactory..."

# Find all .whl files in the current subdirectory (no depth limit)
find "${SUBDIR}" -type f -name "*.whl" | while read -r WHEEL_FILE; do
# Extract relative path to preserve directory structure
RELATIVE_PATH="${WHEEL_FILE#${WHEELS_BASE_DIR}/}"
ARTIFACTORY_PATH="${AIQ_ARTIFACTORY_NAME}/${RELATIVE_PATH}"

echo "Uploading ${WHEEL_FILE} to ${ARTIFACTORY_PATH}..."

CI=true jf rt u --fail-no-op --url="${AIQ_ARTIFACTORY_URL}" \
--user="${URM_USER}" --password="${URM_API_KEY}" \
--flat=false "${WHEEL_FILE}" "${ARTIFACTORY_PATH}" \
--target-props "arch=${AIQ_ARCH};os=${AIQ_OS};branch=${GIT_TAG};component_name=${AIQ_COMPONENT_NAME};version=${GIT_TAG};release_approver=${RELEASE_APPROVER};release_status=${RELEASE_STATUS}"
done
done
done
rapids-logger "All wheels uploaded to Artifactory."
else
echo "UPLOAD_TO_ARTIFACTORY is set to 'false'. Skipping upload."
rapids-logger "UPLOAD_TO_ARTIFACTORY is set to 'false'. Skipping upload."
fi

# List Artifactory contents (disabled by default as the output is very verbose)
Expand Down
7 changes: 4 additions & 3 deletions ci/scripts/gitlab/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if [[ "${CI_CRON_NIGHTLY}" == "1" ]]; then
export SETUPTOOLS_SCM_PRETEND_VERSION="${GIT_TAG}"
fi


WHEELS_DIR=${CI_PROJECT_DIR}/.tmp/wheels/aiqtoolkit
WHEELS_BASE_DIR="${CI_PROJECT_DIR}/.tmp/wheels"
WHEELS_DIR="${WHEELS_BASE_DIR}/aiqtoolkit"

create_env extra:all

Expand All @@ -47,6 +47,7 @@ for AIQ_PACKAGE in "${AIQ_PACKAGES[@]}"; do
done

if [[ "${BUILD_AIQ_COMPAT}" == "true" ]]; then
WHEELS_DIR="${WHEELS_BASE_DIR}/agentiq"
for AIQ_COMPAT_PACKAGE in "${AIQ_COMPAT_PACKAGES[@]}"; do
build_package_wheel ${AIQ_COMPAT_PACKAGE}
done
Expand All @@ -65,5 +66,5 @@ if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" || "${CI_COMMIT_BRANCH}" =
--non-interactive \
--repository-url "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi" \
"${WHEEL_FILE}"
done < <(find "${WHEELS_DIR}" -type f -name "*.whl")
done < <(find "${WHEELS_BASE_DIR}" -type f -name "*.whl")
fi