Skip to content

Commit

Permalink
configure regex manager
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe committed Feb 15, 2024
1 parent 857dcda commit c3d66aa
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
LINUX_VER: ${{ inputs.LINUX_VER }}
PYTHON_VER: ${{ inputs.PYTHON_VER }}
ARCH: ${{ matrix.ARCH }}
DOCKERFILE: ${{ inputs.IMAGE_REPO }}.Dockerfile
- name: Build image
uses: docker/build-push-action@v5
with:
Expand Down
6 changes: 4 additions & 2 deletions ci-conda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ARG TARGETPLATFORM
ARG CUDA_VER
ARG LINUX_VER
ARG PYTHON_VER
ARG CODECOV
ARG YQ

ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -124,7 +126,7 @@ EOF
RUN <<EOF
case "${TARGETPLATFORM}" in
"linux/amd64")
CODECOV_VERSION=v0.3.2
CODECOV_VERSION=v${CODECOV}
curl https://uploader.codecov.io/verification.gpg --max-time 10 --retry 5 \
| gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os --max-time 10 --retry 5 https://uploader.codecov.io/${CODECOV_VERSION}/linux/codecov
Expand Down Expand Up @@ -155,7 +157,7 @@ RUN /opt/conda/bin/git config --system --add safe.directory '*'
RUN pip install dunamai "rapids-dependency-file-generator==1.*" \
&& pip cache purge

COPY --from=mikefarah/yq:4.40.7 /usr/bin/yq /usr/local/bin/yq
COPY --from=mikefarah/yq:${YQ} /usr/bin/yq /usr/local/bin/yq
COPY --from=amazon/aws-cli /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=amazon/aws-cli /usr/local/bin/ /usr/local/bin/

Expand Down
4 changes: 2 additions & 2 deletions ci-wheel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ ENV SCCACHE_S3_USE_SSL=true
ENV SCCACHE_S3_NO_CREDENTIALS=false

# Install ucx
ARG UCX_VERSION=1.14.1
ARG UCX=v1.14.1
RUN <<EOF
mkdir -p /ucx-src
cd /ucx-src
git clone https://github.com/openucx/ucx -b v${UCX_VERSION} ucx-git-repo
git clone https://github.com/openucx/ucx -b ${UCX} ucx-git-repo
cd ucx-git-repo
./autogen.sh
./contrib/configure-release \
Expand Down
6 changes: 6 additions & 0 deletions ci/compute-build-args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ ARGS=(
"MANYLINUX_VER=${MANYLINUX_VER}"
)

DYNAMIC_BUILD_ARGS=$(./fix-renovate-args.sh ${DOCKERFILE})
IFS=' ' read -r -a dynamic_args_array <<< "$DYNAMIC_BUILD_ARGS"
for arg in "${dynamic_args_array[@]}"; do
ARGS+=("$arg")
done

cat <<EOF > "${GITHUB_OUTPUT:-/dev/stdout}"
ARGS<<EOT
$(printf "%s\n" "${ARGS[@]}")
Expand Down
44 changes: 44 additions & 0 deletions ci/fix-renovate-args.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Error: Path to Dockerfile is required as the first argument."
exit 1
fi
DOCKERFILE_PATH="$1"

CUDA_VER="${CUDA_VER:-11.2.0}"
LINUX_VER="${LINUX_VER:-ubuntu20.04}"
PYTHON_VER="${PYTHON_VER:-3.8}"
ARCH="${ARCH:-x86_64}"
MANYLINUX_VER="${MANYLINUX_VER:-2014}"

YAML_FILE="renovate.yaml"

DYNAMIC_BUILD_ARGS=""

if [ -f "$YAML_FILE" ]; then
while IFS= read -r line; do
key=$(echo "$line" | cut -f1 -d':')
value=$(echo "$line" | cut -f2 -d':')
if [ -n "$GITHUB_ACTIONS" ]; then
# Format the output for array appending (in ci/compute-build-args.sh)
DYNAMIC_BUILD_ARGS+="$key=$value "
else
# Locally, format as Docker build arguments
DYNAMIC_BUILD_ARGS+="--build-arg $key=$value "
fi
done < <(yq e '. | to_entries | .[] | .key + ":" + (.value | sub("^v"; ""))' "$YAML_FILE")
fi

if [ -n "$GITHUB_ACTIONS" ]; then
echo "$DYNAMIC_BUILD_ARGS"
else
eval "docker build -f \"$DOCKERFILE_PATH\" . \
--build-arg CUDA_VER=\"$CUDA_VER\" \
--build-arg LINUX_VER=\"$LINUX_VER\" \
--build-arg PYTHON_VER=\"$PYTHON_VER\" \
--build-arg CPU_ARCH=\"$ARCH\" \
--build-arg REAL_ARCH=\"$(arch)\" \
--build-arg MANYLINUX_VER=\"$MANYLINUX_VER\" \
$DYNAMIC_BUILD_ARGS"
fi
11 changes: 11 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"regexManagers": [
{
"fileMatch": "renovate.yaml",
"matchStrings": [
"# renovate: datasource=(?<datasource>[^ ]+) depName=(?<depName>[^\\n]+)(?: versioning=(?<versioning>[^\\n]+))?\\n(?<depNameCapture>[^:]+): (?<currentValue>[^\\n]+)"
],
"depNameTemplate": "{{depName}}",
"datasourceTemplate": "{{datasource}}",
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
}
]
}
10 changes: 10 additions & 0 deletions renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# renovate: datasource=github-releases depName=mozilla/sccache
SCCACHE: v0.7.6
# renovate: datasource=github-releases depName=cli/cli
GH_CLI: v2.32.2
# renovate: datasource=github-releases depName=codecov/uploader
CODECOV: v0.3.2
# renovate: datasource=docker depName=mikefarah/yq
YQ: 4.40.7
# renovate: datasource=github-releases depName=openucx/ucx
UCX: v1.14.1

0 comments on commit c3d66aa

Please sign in to comment.