Skip to content

Commit

Permalink
reenable docker image tests (#288)
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Zhang <[email protected]>
  • Loading branch information
Zhangxunmt authored Apr 20, 2022
1 parent 0bae134 commit d20d7cb
Showing 1 changed file with 32 additions and 33 deletions.
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

0 comments on commit d20d7cb

Please sign in to comment.