diff --git a/.github/workflows/CI-workflow.yml b/.github/workflows/CI-workflow.yml index befe214627..e584b4c7a6 100644 --- a/.github/workflows/CI-workflow.yml +++ b/.github/workflows/CI-workflow.yml @@ -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: |