Skip to content

Commit

Permalink
Fix copying of odh setup files from service CI (trustyai-explainabili…
Browse files Browse the repository at this point in the history
…ty#213)

* Fix copying of odh setup files from service CI

* remove git patch

* bump python version

* Bump ODS CI version + fix iamge sed typo

* Add missing branch sha
  • Loading branch information
RobGeada authored Feb 15, 2024
1 parent cbaf9bd commit da1cff5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ARG BRANCH=main
ARG ODS_CI_REPO=https://github.com/red-hat-data-services/ods-ci
# This git reference should always reference a stable commit from ods-ci that supports ODH
# This hash corresponds to a March 24th, 2023 commit
ARG ODS_CI_GITREF=a0d8e0a8cf58629f895a1660c5d766c3aa4ce82e
ARG ODS_CI_GITREF=867a617bc224726cf98fa3354293f8e50b4f5eb5
ARG OC_CLI_URL=https://mirror.openshift.com/pub/openshift-v4/amd64/clients/ocp/latest/openshift-client-linux.tar.gz

ENV HOME /root
WORKDIR /root

RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm &&\
dnf install -y jq bc git go-toolset python38 unzip chromium chromedriver && \
dnf install -y jq bc git go-toolset python3.11 python3.11-pip python3.11-devel unzip chromium chromedriver && \
dnf clean all && \
git clone https://github.com/opendatahub-io/peak $HOME/peak && \
cd $HOME/peak && \
Expand All @@ -30,7 +30,7 @@ RUN mkdir -p $HOME/src && \
git fetch origin ${ODS_CI_GITREF} && git checkout FETCH_HEAD && \
chmod -R 777 $HOME/src

# Use a specific destination file name in case the url dow download name changes
# Use a specific destination file name in case the url download name changes
ADD ${OC_CLI_URL} $HOME/peak/oc-cli.tar.gz
RUN tar -C /usr/local/bin -xvf $HOME/peak/oc-cli.tar.gz && \
chmod +x /usr/local/bin/oc
Expand All @@ -53,7 +53,7 @@ RUN mkdir -p $HOME/peak/operator-tests/trustyai-explainability/ &&\
cp -r $HOME/src/trustyai-explainability/tests/resources/ $HOME/peak/operator-tests/trustyai-explainability/resources &&\
cp $HOME/src/trustyai-explainability/tests/util $HOME/peak/operator-tests/trustyai-explainability &&\
cp -r $HOME/src/trustyai-explainability/tests/basictests $HOME/peak/operator-tests/trustyai-explainability/basictests &&\
cp -r $HOME/src/trustyai-explainability/tests/setup/odh-core.yaml $HOME/kfdef/ &&\
cp -r $HOME/src/trustyai-explainability/tests/setup/odh-*.yaml $HOME/kfdef/ &&\
cp -r $HOME/src/trustyai-explainability/tests/setup/*setup $HOME/peak/ &&\
cp -r $HOME/src/trustyai-explainability/tests/scripts/installandtest.sh $HOME/peak/

Expand Down
29 changes: 15 additions & 14 deletions tests/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ else
done
fi

popd
## Grabbing and applying the patch in the PR we are testing
pushd ~/src/${REPO_NAME}
if [ -z "$PULL_NUMBER" ]; then
echo "No pull number, assuming nightly run"
else
if [ $REPO_OWNER == "trustyai-explainability" ]; then
curl -O -L https://github.com/${REPO_OWNER}/${REPO_NAME}/pull/${PULL_NUMBER}.patch
echo "Applying followng patch:"
cat ${PULL_NUMBER}.patch > ${ARTIFACT_DIR}/github-pr-${PULL_NUMBER}.patch
git apply ${PULL_NUMBER}.patch
fi
fi
#popd
### Grabbing and applying the patch in the PR we are testing
#pushd ~/src/${REPO_NAME}
#if [ -z "$PULL_NUMBER" ]; then
# echo "No pull number, assuming nightly run"
#else
# if [ $REPO_OWNER == "trustyai-explainability" ]; then
# curl -O -L https://github.com/${REPO_OWNER}/${REPO_NAME}/pull/${PULL_NUMBER}.patch
# echo "Applying followng patch:"
# cat ${PULL_NUMBER}.patch > ${ARTIFACT_DIR}/github-pr-${PULL_NUMBER}.patch
# git apply ${PULL_NUMBER}.patch
# fi
#fi

popd
## Point manifests repo uri in the KFDEF to the manifests in the PR
Expand All @@ -51,7 +51,8 @@ if [ -z "$PULL_NUMBER" ] || [ $REPO_OWNER != "trustyai-explainability" ] || [ $R
sed -i "s#trustyaiRepoPlaceholder#https://github.com/trustyai-explainability/trustyai-service-operator/tarball/main#" ./${DSC_FILENAME}
else
echo "Setting TrustyAI devflags to use PR image"
sed -i "s#trustyaiRepoPlaceholder#https://github.com/trustyai-explainability/trustyai-serivce-operator-ci/tarball/operator-${BRANCH_SHA}#" ./${DSC_FILENAME}
BRANCH_SHA=$(curl https://api.github.com/repos/trustyai-explainability/trustyai-service-operator/pulls/${PULL_NUMBER} | jq ".head.sha" | tr -d '"')
sed -i "s#trustyaiRepoPlaceholder#https://api.github.com/repos/trustyai-explainability/trustyai-service-operator-ci/tarball/operator-${BRANCH_SHA}#" ./${DSC_FILENAME}
fi

if [ -z "${OPENSHIFT_TESTUSER_NAME}" ] || [ -z "${OPENSHIFT_TESTUSER_PASS}" ]; then
Expand Down

0 comments on commit da1cff5

Please sign in to comment.