Skip to content
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

[Backport 2.0] reenable docker image tests #292

Merged
merged 1 commit into from
Apr 20, 2022
Merged
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
65 changes: 32 additions & 33 deletions .github/workflows/CI-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,38 @@ jobs:
- name: Multi Nodes Integration Testing
run: |
./gradlew integTest -PnumNodes=3
# ToDo: Check infra team for 2.0 docker availability and re-enable
# - name: Pull and Run Docker
# run: |
# plugin=`basename $(ls plugin/build/distributions/*.zip)`
# version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-3`
# plugin_version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-4`
# qualifier=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-1`
# candidate_version=`echo $plugin|awk -F- '{print $5}'| cut -d. -f 1-1`
# docker_version=$version-$qualifier
#
# [[ -z $candidate_version ]] && candidate_version=$qualifier && qualifier=""
#
# echo plugin version plugin_version qualifier candidate_version docker_version
# echo "($plugin) ($version) ($plugin_version) ($qualifier) ($candidate_version) ($docker_version)"
#
# cd ..
# if docker pull opensearchstaging/opensearch:$docker_version
# then
# echo "FROM opensearchstaging/opensearch:$docker_version" >> Dockerfile
# echo "RUN if [ -d /usr/share/opensearch/plugins/opensearch-ml ]; then /usr/share/opensearch/bin/opensearch-plugin remove opensearch-ml; fi" >> Dockerfile
# echo "ADD ml-commons/plugin/build/distributions/$plugin /tmp/" >> Dockerfile
# echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/$plugin" >> Dockerfile
# docker build -t opensearch-ml:test .
# echo "imagePresent=true" >> $GITHUB_ENV
# else
# echo "imagePresent=false" >> $GITHUB_ENV
# fi
# - name: Run Docker Image
# if: env.imagePresent == 'true'
# run: |
# cd ..
# docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" opensearch-ml:test
# sleep 90
- name: Pull and Run Docker
run: |
plugin=`basename $(ls plugin/build/distributions/*.zip)`
version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-3`
plugin_version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-4`
qualifier=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-1`
candidate_version=`echo $plugin|awk -F- '{print $5}'| cut -d. -f 1-1`
docker_version=$version-$qualifier

[[ -z $candidate_version ]] && candidate_version=$qualifier && qualifier=""

echo plugin version plugin_version qualifier candidate_version docker_version
echo "($plugin) ($version) ($plugin_version) ($qualifier) ($candidate_version) ($docker_version)"

cd ..
if docker pull opensearchstaging/opensearch:$docker_version
then
echo "FROM opensearchstaging/opensearch:$docker_version" >> Dockerfile
echo "RUN if [ -d /usr/share/opensearch/plugins/opensearch-ml ]; then /usr/share/opensearch/bin/opensearch-plugin remove opensearch-ml; fi" >> Dockerfile
echo "ADD ml-commons/plugin/build/distributions/$plugin /tmp/" >> Dockerfile
echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/$plugin" >> Dockerfile
docker build -t opensearch-ml:test .
echo "imagePresent=true" >> $GITHUB_ENV
else
echo "imagePresent=false" >> $GITHUB_ENV
fi
- name: Run Docker Image
if: env.imagePresent == 'true'
run: |
cd ..
docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" opensearch-ml:test
sleep 90
- name: Run MLCommons Test
if: env.imagePresent == 'true'
run: |
Expand Down