From 156d9c41e1b638a2b262e11524b63f05c8eaf58c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 15 Nov 2024 01:32:08 +0000 Subject: [PATCH] Add tweaks Signed-off-by: Peter Zhu --- .github/workflows/get-ci-image-tag.yml | 36 ++++++++++++++------------ 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/get-ci-image-tag.yml b/.github/workflows/get-ci-image-tag.yml index 2492cfb46e..c927f5e664 100644 --- a/.github/workflows/get-ci-image-tag.yml +++ b/.github/workflows/get-ci-image-tag.yml @@ -25,9 +25,9 @@ on: ci-image-version-linux: description: The ci image version for linux build value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-version-linux }} - ci-image-mount-volumes: - description: The ci image mount volumes to set after starting the container - value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-mount-volumes }} + ci-image-start-options: + description: The ci image mount volumes to set when starting the container + value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-start-options }} ci-image-start-command: description: The ci image start commands to run after initialization value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-start-command }} @@ -36,9 +36,9 @@ jobs: Get-CI-Image-Tag: runs-on: ubuntu-latest outputs: - output-ci-image-version-linux: ${{ steps.step-ci-image-version-linux.outputs.ci-image-version-linux }} - output-ci-image-start-command: ${{ steps.step-ci-image-start-command.outputs.ci-image-start-command }} - output-ci-image-mount-volumes: ${{ steps.step-ci-image-mount-volumes.outputs.ci-image-mount-volumes }} + output-ci-image-version-linux: ${{ steps.step-ci-image-setups.outputs.ci-image-version-linux }} + output-ci-image-start-command: ${{ steps.step-ci-image-setups.outputs.ci-image-start-command }} + output-ci-image-start-options: ${{ steps.step-ci-image-setups.outputs.ci-image-start-options }} steps: - name: Install crane uses: iarekylew00t/crane-installer@v1 @@ -51,7 +51,7 @@ jobs: ref: ${{ inputs.build_ref }} path: 'opensearch-build' - name: Get ci image version from opensearch-build repository scripts - id: step-ci-image-version-linux + id: step-ci-image-setups run: | PRODUCT=${{ inputs.product }} PLATFORM=${{ inputs.platform }} @@ -63,18 +63,20 @@ jobs: PLATFORM="almalinux8" fi fi + + if [[ "$PLATFORM" = "al2" ]]; then + CI_IMAGE_CMD="cp -a /node_al2/* /node && /node/bin/node -v" + echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT + CI_IMAGE_OPTIONS="--user root -v /node:/node:rw,rshared -v /node:/__e/node20:ro,rshared" + echo "ci-image-start-options=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT + else + CI_IMAGE_CMD="echo pass" + echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT + CI_IMAGE_OPTIONS="--user root" + echo "ci-image-start-options=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT + fi crane version echo $PRODUCT $PLATFORM CI_IMAGE_VERSION=`opensearch-build/docker/ci/get-ci-images.sh -p $PLATFORM -u $PRODUCT -t $TYPE | head -1` echo $CI_IMAGE_VERSION echo "ci-image-version-linux=$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT - - name: Get ci image start command based on requirements - id: step-ci-image-start-command - run: | - CI_IMAGE_CMD="cp -a /node_al2/* /node && /node/bin/node -v" - echo "ci-image-start-command=$CI_IMAGE_CMD" >> $GITHUB_OUTPUT - - name: Get ci image mount volumes based on requirements - id: step-ci-image-mount-volumes - run: | - CI_IMAGE_MOUNTS="/node:/node:rw,rshared,/node:/__e/node20:ro,rshared" - echo "ci-image-mount-volumes=$CI_IMAGE_MOUNTS" >> $GITHUB_OUTPUT