From 51fbe878f786c395bfb0f394a37e53f5494cd0de Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Wed, 15 Mar 2023 15:46:42 +0100 Subject: [PATCH 01/10] updated docker build & push to dockerhub --- .../build-push-client-docker-image.yaml | 156 ++++++++++++++---- .../build-push-logsearchapi-docker-image.yaml | 100 ----------- .../build-push-minio-docker-image.yaml | 100 ----------- 3 files changed, 121 insertions(+), 235 deletions(-) delete mode 100644 .github/workflows/build-push-logsearchapi-docker-image.yaml delete mode 100644 .github/workflows/build-push-minio-docker-image.yaml diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index f6b8c687c..7a25cf78f 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -12,16 +12,18 @@ on: pull_request: workflow_dispatch: inputs: - staging_tag: + tag: description: 'type yes for building staging tag' default: 'no' required: true env: MINIO_CLIENT_REGISTRY: ${{ secrets.MINIO_CLIENT_REGISTRY }} + MINIO_LOGSEARCHAPI_REGISTRY: ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }} + MINIO_SERVER_REGISTRY: ${{ secrets.MINIO_SERVER_REGISTRY }} jobs: - dockerize_minio: + dockerize_client: runs-on: [self-hosted, arc-runner] outputs: @@ -40,14 +42,6 @@ jobs: else echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV fi - - # - name: Get the version - # id: get_version - # run: | - # BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g') - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # echo ::set-output name=BRANCH::${BRANCH} - # echo ::set-output name=VERSION::${BRANCH}-${SHORT_SHA} - name: Login to Docker Hub uses: docker/login-action@v2 @@ -66,37 +60,129 @@ jobs: docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA - - name: Push latest - if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' run: | - docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:staging docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:staging - # - name: Build minio Docker Image - # run: | - # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - # docker build -t $MINIO_REGISTRY:$TAG . - # env: - # TAG: ${{ steps.get_version.outputs.VERSION }} - - # - name: Push minio Docker Image - # run: | - # if [[ "$PUSH_STAGING" == "yes" ]] && [[ "$BRANCH" == "staging" ]]; then - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging-${SHORT_SHA} - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging-${SHORT_SHA} - # elif [[ "$BRANCH" != "staging" ]]; then - # docker push $MINIO_REGISTRY:$TAG - # fi - # env: - # PUSH_STAGING: ${{ github.event.inputs.staging_tag }} - # TAG: ${{ steps.get_version.outputs.VERSION }} - # BRANCH: ${{ steps.get_version.outputs.BRANCH }} + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest - name: Clean Up The Workspace. if: ${{ always() }} run: | rm -rf ./* + + dockerize_logsearchapi: + runs-on: [self-hosted, arc-runner] + + outputs: + output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} + + steps: + - uses: actions/checkout@v1 + + - name: Set Docker Image Tags. + id: get_info + run: | + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build & Push Docker Image. + id: docker_build + run: | + cd logsearchapi + docker build -t $MINIO_LOGSEARCHAPI_REGISTRY:latest . + echo $TAG-$SHORT_SHA + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA + docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA + + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + run: | + docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging + docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging + + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest + + - name: Clean Up The Workspace. + if: ${{ always() }} + run: | + rm -rf ./* + + dockerize_minio: + runs-on: [self-hosted, arc-runner] + + outputs: + output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} + + steps: + - uses: actions/checkout@v1 + + - name: Set Docker Image Tags. + id: get_info + run: | + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build & Push Docker Image. + id: docker_build + run: | + docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false + docker build -t $MINIO_SERVER_REGISTRY:latest . + echo $TAG-$SHORT_SHA + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA + docker push $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA + + - name: Push latest + if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' + run: | + docker push $MINIO_SERVER_REGISTRY:latest + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging + docker push $MINIO_SERVER_REGISTRY:staging + + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + run: | + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging + docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:staging + + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:latest + + - name: Clean Up The Workspace. + if: ${{ always() }} + run: | + rm -rf ./* diff --git a/.github/workflows/build-push-logsearchapi-docker-image.yaml b/.github/workflows/build-push-logsearchapi-docker-image.yaml deleted file mode 100644 index 42018e496..000000000 --- a/.github/workflows/build-push-logsearchapi-docker-image.yaml +++ /dev/null @@ -1,100 +0,0 @@ -name: build-&-publish-minio-logsearchapi-docker-image - -# concurrency: -# group: "publish-${{ github.ref }}" -# cancel-in-progress: true - -on: - push: - branches: [ master,staging ] - tags: [ "v*.*.*" ] - pull_request: - workflow_dispatch: - inputs: - staging_tag: - description: 'type yes for building staging tag' - default: 'no' - required: true - -env: - MINIO_LOGSEARCHAPI_REGISTRY: ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }} - -jobs: - dockerize_minio: - runs-on: [self-hosted, arc-runner] - - outputs: - output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} - - steps: - - uses: actions/checkout@v1 - - - name: Set Docker Image Tags. - id: get_info - run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - # - name: Get the version - # id: get_version - # run: | - # BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g') - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # echo ::set-output name=BRANCH::${BRANCH} - # echo ::set-output name=VERSION::${BRANCH}-${SHORT_SHA} - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build & Push Docker Image. - id: docker_build - run: | - cd logsearchapi - docker build -t $MINIO_LOGSEARCHAPI_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - - - name: Push latest - if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' - run: | - docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest - docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging - docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging - - # - name: Build minio Docker Image - # run: | - # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - # docker build -t $MINIO_REGISTRY:$TAG . - # env: - # TAG: ${{ steps.get_version.outputs.VERSION }} - - # - name: Push minio Docker Image - # run: | - # if [[ "$PUSH_STAGING" == "yes" ]] && [[ "$BRANCH" == "staging" ]]; then - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging-${SHORT_SHA} - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging-${SHORT_SHA} - # elif [[ "$BRANCH" != "staging" ]]; then - # docker push $MINIO_REGISTRY:$TAG - # fi - # env: - # PUSH_STAGING: ${{ github.event.inputs.staging_tag }} - # TAG: ${{ steps.get_version.outputs.VERSION }} - # BRANCH: ${{ steps.get_version.outputs.BRANCH }} - - - name: Clean Up The Workspace. - if: ${{ always() }} - run: | - rm -rf ./* diff --git a/.github/workflows/build-push-minio-docker-image.yaml b/.github/workflows/build-push-minio-docker-image.yaml deleted file mode 100644 index 456e8fe86..000000000 --- a/.github/workflows/build-push-minio-docker-image.yaml +++ /dev/null @@ -1,100 +0,0 @@ -name: build-&-publish-minio-docker-image - -# concurrency: -# group: "publish-${{ github.ref }}" -# cancel-in-progress: true - -on: - push: - branches: [ master,staging ] - tags: [ "v*.*.*" ] - pull_request: - workflow_dispatch: - inputs: - staging_tag: - description: 'type yes for building staging tag' - default: 'no' - required: true - -env: - MINIO_SERVER_REGISTRY: ${{ secrets.MINIO_SERVER_REGISTRY }} - -jobs: - dockerize_minio: - runs-on: [self-hosted, arc-runner] - - outputs: - output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} - - steps: - - uses: actions/checkout@v1 - - - name: Set Docker Image Tags. - id: get_info - run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - # - name: Get the version - # id: get_version - # run: | - # BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g') - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # echo ::set-output name=BRANCH::${BRANCH} - # echo ::set-output name=VERSION::${BRANCH}-${SHORT_SHA} - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build & Push Docker Image. - id: docker_build - run: | - docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - docker build -t $MINIO_SERVER_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA - docker push $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA - - - name: Push latest - if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' - run: | - docker push $MINIO_SERVER_REGISTRY:latest - docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging - docker push $MINIO_SERVER_REGISTRY:staging - - # - name: Build minio Docker Image - # run: | - # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - # docker build -t $MINIO_REGISTRY:$TAG . - # env: - # TAG: ${{ steps.get_version.outputs.VERSION }} - - # - name: Push minio Docker Image - # run: | - # if [[ "$PUSH_STAGING" == "yes" ]] && [[ "$BRANCH" == "staging" ]]; then - # SHORT_SHA=$(echo $GITHUB_SHA | head -c 8) - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging-${SHORT_SHA} - # docker tag $MINIO_REGISTRY:$TAG $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging - # docker push $MINIO_REGISTRY:staging-${SHORT_SHA} - # elif [[ "$BRANCH" != "staging" ]]; then - # docker push $MINIO_REGISTRY:$TAG - # fi - # env: - # PUSH_STAGING: ${{ github.event.inputs.staging_tag }} - # TAG: ${{ steps.get_version.outputs.VERSION }} - # BRANCH: ${{ steps.get_version.outputs.BRANCH }} - - - name: Clean Up The Workspace. - if: ${{ always() }} - run: | - rm -rf ./* From ec9a1e3bbaf5b0c94189826b2d2698ad251f8ddb Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Wed, 15 Mar 2023 17:31:07 +0100 Subject: [PATCH 02/10] added manual system tests --- .../build-push-client-docker-image.yaml | 409 +++++++++++------- .github/workflows/system_tests.yml | 78 ++++ 2 files changed, 324 insertions(+), 163 deletions(-) create mode 100644 .github/workflows/system_tests.yml diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 7a25cf78f..67470e7e1 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -23,166 +23,249 @@ env: MINIO_SERVER_REGISTRY: ${{ secrets.MINIO_SERVER_REGISTRY }} jobs: - dockerize_client: - runs-on: [self-hosted, arc-runner] - - outputs: - output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} - - steps: - - uses: actions/checkout@v1 - - - name: Set Docker Image Tags. - id: get_info - run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build & Push Docker Image. - id: docker_build - run: | - # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - cd client-api - docker build -t $MINIO_CLIENT_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA - docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA - - - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' - run: | - docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:staging - docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:staging - - - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' - run: | - docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest - - - name: Clean Up The Workspace. - if: ${{ always() }} - run: | - rm -rf ./* - - dockerize_logsearchapi: - runs-on: [self-hosted, arc-runner] - - outputs: - output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} - - steps: - - uses: actions/checkout@v1 - - - name: Set Docker Image Tags. - id: get_info - run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build & Push Docker Image. - id: docker_build - run: | - cd logsearchapi - docker build -t $MINIO_LOGSEARCHAPI_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - - - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' - run: | - docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging - docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging - - - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' - run: | - docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest - - - name: Clean Up The Workspace. - if: ${{ always() }} - run: | - rm -rf ./* - - dockerize_minio: - runs-on: [self-hosted, arc-runner] - - outputs: - output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} - - steps: - - uses: actions/checkout@v1 - - - name: Set Docker Image Tags. - id: get_info - run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build & Push Docker Image. - id: docker_build - run: | - docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false - docker build -t $MINIO_SERVER_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA - docker push $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA - - - name: Push latest - if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' - run: | - docker push $MINIO_SERVER_REGISTRY:latest - docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging - docker push $MINIO_SERVER_REGISTRY:staging - - - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' - run: | - docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging - docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:staging - - - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' - run: | - docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:latest - - - name: Clean Up The Workspace. - if: ${{ always() }} - run: | - rm -rf ./* + dockerize_client: + runs-on: [self-hosted, arc-runner] + + outputs: + output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} + + steps: + - uses: actions/checkout@v1 + + - name: Set Docker Image Tags. + id: get_info + run: | + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build & Push Docker Image. + id: docker_build + run: | + # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false + cd client-api + docker build -t $MINIO_CLIENT_REGISTRY:latest . + echo $TAG-$SHORT_SHA + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA + docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA + + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + run: | + docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:staging + docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:staging + + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest + + - name: Clean Up The Workspace. + if: ${{ always() }} + run: | + rm -rf ./* + + dockerize_logsearchapi: + runs-on: [self-hosted, arc-runner] + + outputs: + output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} + + steps: + - uses: actions/checkout@v1 + + - name: Set Docker Image Tags. + id: get_info + run: | + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build & Push Docker Image. + id: docker_build + run: | + cd logsearchapi + docker build -t $MINIO_LOGSEARCHAPI_REGISTRY:latest . + echo $TAG-$SHORT_SHA + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA + docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA + + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + run: | + docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging + docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging + + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest + + - name: Clean Up The Workspace. + if: ${{ always() }} + run: | + rm -rf ./* + + dockerize_minio: + runs-on: [self-hosted, arc-runner] + + outputs: + output1: ${{ steps.docker_build.outputs.COMMIT_TAG }} + + steps: + - uses: actions/checkout@v1 + + - name: Set Docker Image Tags. + id: get_info + run: | + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build & Push Docker Image. + id: docker_build + run: | + docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false + docker build -t $MINIO_SERVER_REGISTRY:latest . + echo $TAG-$SHORT_SHA + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA + docker push $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA + + - name: Push latest + if: ${{ github.event.inputs.branch }} == 'master' || ${{ github.event.inputs.branch }} == 'staging' + run: | + docker push $MINIO_SERVER_REGISTRY:latest + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging + docker push $MINIO_SERVER_REGISTRY:staging + + - name: Push staging tag + if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + run: | + docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging + docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:staging + + - name: Push latest tag + if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + run: | + docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:latest + + - name: Clean Up The Workspace. + if: ${{ always() }} + run: | + rm -rf ./* + + system-tests: + if: github.event_name != 'workflow_dispatch' + needs: [dockerize_client, dockerize_logsearchapi, dockerize_minio] + runs-on: [ tests-suite ] + steps: + - name: "Get current PR" + uses: jwalton/gh-find-current-pr@v1 + id: findPr + with: + github-token: ${{ github.token }} + + - name: "Set PR status as pending" + uses: 0chain/actions/set-pr-status@master + if: steps.findPr.outputs.number + with: + pr_number: ${{ steps.findPr.outputs.pr }} + description: "System tests running with default config..." + state: "pending" + repository: ${{ github.repository }} + status_name: "0Chain System Tests" + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + github_token: ${{ github.token }} + + - name: "Setup" + run: | + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV + echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV + echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV + + - name: "Deploy 0Chain" + uses: 0chain/actions/deploy-0chain@master + with: + kube_config: ${{ secrets[format('DEV{0}KC', env.RUNNER_NUMBER)] }} + teardown_condition: "TESTS_PASSED" + miner_image: staging + sharder_image: staging + blobber_image: staging + validator_image: staging + zbox_image: staging + zdns_image: staging + zbox_cli_branch: staging + zwallet_cli_branch: staging + custom_go_sdk_version: staging + SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} + TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} + zs3_client: ${{ env.TAG }}-${{ env.SHORT_SHA }} + zs3_logsearchapi: ${{ env.TAG }}-${{ env.SHORT_SHA }} + zs3_minio: ${{ env.TAG }}-${{ env.SHORT_SHA }} + + - name: "Run System tests" + uses: 0chain/actions/run-system-tests@master + with: + system_tests_branch: master + network: ${{ env.NETWORK_URL }} + zbox_cli_branch: staging + zwallet_cli_branch: staging + svc_account_secret: ${{ github.token }} + deploy_report_page: false + archive_results: true + run_flaky_tests: false + retry_failures: true + TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} + DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} + + - name: "Set PR status as ${{ job.status }}" + if: ${{ (success() || failure()) && steps.findPr.outputs.number }} + uses: 0chain/actions/set-pr-status@master + with: + pr_number: ${{ steps.findPr.outputs.pr }} + description: "System tests with default config ${{ job.status }}" + state: ${{ job.status }} + repository: ${{ github.repository }} + status_name: "0Chain System Tests" + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + github_token: ${{ github.token }} diff --git a/.github/workflows/system_tests.yml b/.github/workflows/system_tests.yml new file mode 100644 index 000000000..05f9b7470 --- /dev/null +++ b/.github/workflows/system_tests.yml @@ -0,0 +1,78 @@ +name: "0Chain System Tests" + +on: + workflow_dispatch: + inputs: + system_tests_branch: + description: 'system_tests branch containing the tests you wish to run' + default: 'master' + required: true + zbox_cli_branch: + description: '0Box CLI branch which the tests will use' + default: 'staging' + required: true + zwallet_cli_branch: + description: '0Wallet CLI branch which the tests will use' + default: 'staging' + required: true + blobber_branch: + description: 'blobber branch to deploy' + default: 'staging' + required: true + validator_branch: + description: 'validator branch to deploy' + default: 'staging' + required: true + authorizer_branch: + description: 'authorizer branch to deploy' + default: 'staging' + required: true + zbox_branch: + description: '0box branch to deploy' + default: 'staging' + required: true + zs3server_branch: + description: 'zs3server branch to deploy' + default: 'staging' + required: true + test_file_filter: + description: 'Comma separated list of test files to run (eg. zwalletcli_register_wallet_test.go, zwalletcli_send_and_balance_test.go). If supplied, the PR will NOT be notified of the test result' + default: '' + required: false + skip_tests: + description: '(LAST RESORT ONLY) Skip system tests. This will allow a PR to merge without requiring a green test run. *By using you certify that the code being merged is not causing system tests to fail*' + default: 'FALSE' + required: true +jobs: + system-tests: + uses: 0chain/actions/.github/workflows/manual_system_tests.yml@master + with: + system_tests_branch: ${{ github.event.inputs.system_tests_branch }} + miner_branch: ${{ github.ref_name }} + sharder_branch: ${{ github.ref_name }} + zbox_cli_branch: ${{ github.event.inputs.zbox_cli_branch }} + zwallet_cli_branch: ${{ github.event.inputs.zwallet_cli_branch }} + blobber_branch: ${{ github.event.inputs.blobber_branch }} + validator_branch: ${{ github.event.inputs.validator_branch }} + zbox_branch: ${{ github.event.inputs.zbox_branch }} + zs3server_branch: ${{ github.event.inputs.zs3server_branch }} + authorizer_branch: ${{ github.event.inputs.authorizer_branch }} + explorer_branch: master + test_file_filter: ${{ github.event.inputs.test_file_filter }} + zsearch_branch: staging + zdns_branch: staging + skip_tests: ${{ github.event.inputs.skip_tests }} + secrets: + SVC_ACCOUNT_SECRET: ${{ secrets.SVC_ACCOUNT_SECRET }} + DEV1KC: ${{ secrets.DEV1KC }} + DEV2KC: ${{ secrets.DEV2KC }} + DEV3KC: ${{ secrets.DEV3KC }} + DEV4KC: ${{ secrets.DEV4KC }} + DEV5KC: ${{ secrets.DEV5KC }} + DEV6KC: ${{ secrets.DEV6KC }} + DEV7KC: ${{ secrets.DEV7KC }} + DEV8KC: ${{ secrets.DEV8KC }} + DEV9KC: ${{ secrets.DEV9KC }} + SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} + TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} + DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} \ No newline at end of file From 4b3bb68833896a6d27c267270434c2303caa20cc Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Wed, 15 Mar 2023 19:05:19 +0100 Subject: [PATCH 03/10] fix docker image taag in zs3 deployment --- .../build-push-client-docker-image.yaml | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 67470e7e1..15ac1e0a4 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -192,6 +192,33 @@ jobs: needs: [dockerize_client, dockerize_logsearchapi, dockerize_minio] runs-on: [ tests-suite ] steps: + - uses: actions/checkout@v1 + + - name: "Setup" + run: | + # if [[ "${{github.ref}}" == refs/pull/* ]]; then + # tag=${GITHUB_REF/\/merge/} + # echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + # else + # echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + # fi + + + echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + + # echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + # echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV + echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV + echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV + - name: "Get current PR" uses: jwalton/gh-find-current-pr@v1 id: findPr @@ -210,19 +237,6 @@ jobs: target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} github_token: ${{ github.token }} - - name: "Setup" - run: | - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV - echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV - echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV - echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV - - name: "Deploy 0Chain" uses: 0chain/actions/deploy-0chain@master with: From 44b9ae83121b05c5a6c86a787a87339bd8ca95d6 Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Thu, 16 Mar 2023 06:14:38 +0100 Subject: [PATCH 04/10] updated gitactions for system test --- .../build-push-client-docker-image.yaml | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 15ac1e0a4..96af1e60e 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -35,13 +35,14 @@ jobs: - name: Set Docker Image Tags. id: get_info run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV if [[ "${{github.ref}}" == refs/pull/* ]]; then tag=${GITHUB_REF/\/merge/} echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV else echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV fi + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v2 @@ -55,8 +56,9 @@ jobs: # docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false cd client-api docker build -t $MINIO_CLIENT_REGISTRY:latest . - echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) + + # echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA @@ -88,13 +90,14 @@ jobs: - name: Set Docker Image Tags. id: get_info run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV if [[ "${{github.ref}}" == refs/pull/* ]]; then tag=${GITHUB_REF/\/merge/} echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV else echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV fi + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v2 @@ -108,7 +111,7 @@ jobs: cd logsearchapi docker build -t $MINIO_LOGSEARCHAPI_REGISTRY:latest . echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA @@ -140,13 +143,14 @@ jobs: - name: Set Docker Image Tags. id: get_info run: | - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV if [[ "${{github.ref}}" == refs/pull/* ]]; then tag=${GITHUB_REF/\/merge/} echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV else echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV fi + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + echo "SHA=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}')" >> $GITHUB_ENV - name: Login to Docker Hub uses: docker/login-action@v2 @@ -160,7 +164,7 @@ jobs: docker run --rm -v $PWD:/minio --workdir=/minio golang:1.19 go build -buildvcs=false docker build -t $MINIO_SERVER_REGISTRY:latest . echo $TAG-$SHORT_SHA - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT + SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA docker push $MINIO_SERVER_REGISTRY:$TAG-$SHORT_SHA @@ -192,33 +196,6 @@ jobs: needs: [dockerize_client, dockerize_logsearchapi, dockerize_minio] runs-on: [ tests-suite ] steps: - - uses: actions/checkout@v1 - - - name: "Setup" - run: | - # if [[ "${{github.ref}}" == refs/pull/* ]]; then - # tag=${GITHUB_REF/\/merge/} - # echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - # else - # echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - # fi - - - echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV - if [[ "${{github.ref}}" == refs/pull/* ]]; then - tag=${GITHUB_REF/\/merge/} - echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV - else - echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV - fi - - echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT - - # echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV - # echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV - echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV - echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV - - name: "Get current PR" uses: jwalton/gh-find-current-pr@v1 id: findPr @@ -237,6 +214,21 @@ jobs: target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} github_token: ${{ github.token }} + - name: "Setup" + run: | + if [[ "${{github.ref}}" == refs/pull/* ]]; then + tag=${GITHUB_REF/\/merge/} + echo "TAG=$(echo pr-${tag:10})" >> $GITHUB_ENV + else + echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV + fi + + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV + + echo "NETWORK_URL=$(echo dev-${RUNNER_NAME:(-1)}.devnet-0chain.net)" >> $GITHUB_ENV + echo "RUNNER_NUMBER=${RUNNER_NAME:(-1)}" >> $GITHUB_ENV + - name: "Deploy 0Chain" uses: 0chain/actions/deploy-0chain@master with: From 614700a788a4f06eb8611fa8b9ae545ede9f6152 Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Thu, 16 Mar 2023 06:35:09 +0100 Subject: [PATCH 05/10] updated gitactions for system test --- .../workflows/build-push-client-docker-image.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 96af1e60e..70f874afe 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -58,18 +58,17 @@ jobs: docker build -t $MINIO_CLIENT_REGISTRY:latest . SHORT_SHA=$(echo ${{ env.SHA }} | head -c 8) - # echo "COMMIT_TAG=$TAG-$SHORT_SHA" >>$GITHUB_OUTPUT docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' run: | docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:staging docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' run: | docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest @@ -116,13 +115,13 @@ jobs: docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' run: | docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' run: | docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest @@ -176,13 +175,13 @@ jobs: docker push $MINIO_SERVER_REGISTRY:staging - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'staging' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' run: | docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'master' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' run: | docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:latest @@ -222,7 +221,7 @@ jobs: else echo "TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\//-/g')" >> $GITHUB_ENV fi - + echo "BRANCH=$([ -z '${{ github.event.pull_request.head.sha }}' ] && echo ${GITHUB_REF#refs/*/} || echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV echo "SHORT_SHA=$(([ -z '${{ github.event.pull_request.head.sha }}' ] && echo $GITHUB_SHA || echo '${{ github.event.pull_request.head.sha }}') | head -c 8)" >> $GITHUB_ENV From efad6543e4003135fecccedefe9f06f4fb74a9ad Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Thu, 16 Mar 2023 06:41:08 +0100 Subject: [PATCH 06/10] updated gitactions for system test --- .../build-push-client-docker-image.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 70f874afe..87a5f374d 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -1,9 +1,9 @@ name: build-&-publish-minio-client-docker-image -# concurrency: -# group: "publish-${{ github.ref }}" -# cancel-in-progress: true +concurrency: + group: "publish-${{ github.ref }}" + cancel-in-progress: true on: push: @@ -62,13 +62,13 @@ jobs: docker push $MINIO_CLIENT_REGISTRY:$TAG-$SHORT_SHA - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/staging' }} run: | docker tag $MINIO_CLIENT_REGISTRY:latest $MINIO_CLIENT_REGISTRY:staging docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/master' }} run: | docker push ${{ secrets.MINIO_CLIENT_REGISTRY }}:latest @@ -115,13 +115,13 @@ jobs: docker push $MINIO_LOGSEARCHAPI_REGISTRY:$TAG-$SHORT_SHA - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/staging' }} run: | docker tag $MINIO_LOGSEARCHAPI_REGISTRY:latest $MINIO_LOGSEARCHAPI_REGISTRY:staging docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/master' }} run: | docker push ${{ secrets.MINIO_LOGSEARCHAPI_REGISTRY }}:latest @@ -175,13 +175,13 @@ jobs: docker push $MINIO_SERVER_REGISTRY:staging - name: Push staging tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/staging' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/staging' }} run: | docker tag $MINIO_SERVER_REGISTRY:latest $MINIO_SERVER_REGISTRY:staging docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:staging - name: Push latest tag - if: ${{ github.event.inputs.tag }} == 'yes' || github.ref == 'refs/heads/master' + if: ${{ github.event.inputs.tag == 'yes' || github.ref == 'refs/heads/master' }} run: | docker push ${{ secrets.MINIO_SERVER_REGISTRY }}:latest From 1e3ed15fd5280e7da9e33f7c07f41bcaced44f76 Mon Sep 17 00:00:00 2001 From: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Date: Sat, 18 Mar 2023 00:28:59 +0530 Subject: [PATCH 07/10] Update build-push-client-docker-image.yaml --- .github/workflows/build-push-client-docker-image.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 87a5f374d..559072282 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -241,7 +241,6 @@ jobs: zdns_image: staging zbox_cli_branch: staging zwallet_cli_branch: staging - custom_go_sdk_version: staging SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} zs3_client: ${{ env.TAG }}-${{ env.SHORT_SHA }} From 6f50de864022d6af3f466fc97c760bfc96e8f81e Mon Sep 17 00:00:00 2001 From: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Date: Mon, 20 Mar 2023 00:57:58 +0530 Subject: [PATCH 08/10] add params --- .github/workflows/build-push-client-docker-image.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 559072282..6bddbf2f9 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -238,7 +238,10 @@ jobs: blobber_image: staging validator_image: staging zbox_image: staging + zblock_image: staging zdns_image: staging + explorer_image: latest + zsearch_image: staging zbox_cli_branch: staging zwallet_cli_branch: staging SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} From bcd21af85bfc2d9633a1dfb905e17bc8294af323 Mon Sep 17 00:00:00 2001 From: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Date: Mon, 20 Mar 2023 01:23:33 +0530 Subject: [PATCH 09/10] disable CLI tests as changes in zs3server can't break them --- .github/workflows/build-push-client-docker-image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push-client-docker-image.yaml b/.github/workflows/build-push-client-docker-image.yaml index 6bddbf2f9..ae2e408ad 100644 --- a/.github/workflows/build-push-client-docker-image.yaml +++ b/.github/workflows/build-push-client-docker-image.yaml @@ -262,6 +262,7 @@ jobs: archive_results: true run_flaky_tests: false retry_failures: true + run_cli_system_tests: false TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} From b2bc7a4005c50e7a08e790b085c05846107bd3a1 Mon Sep 17 00:00:00 2001 From: Kishan Dhakan <42718091+Kishan-Dhakan@users.noreply.github.com> Date: Mon, 20 Mar 2023 01:24:18 +0530 Subject: [PATCH 10/10] disable cli tests as changes in zs3server can't break them --- .github/workflows/system_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/system_tests.yml b/.github/workflows/system_tests.yml index 05f9b7470..09c6fe5c9 100644 --- a/.github/workflows/system_tests.yml +++ b/.github/workflows/system_tests.yml @@ -60,6 +60,7 @@ jobs: explorer_branch: master test_file_filter: ${{ github.event.inputs.test_file_filter }} zsearch_branch: staging + run_cli_system_tests: false zdns_branch: staging skip_tests: ${{ github.event.inputs.skip_tests }} secrets: @@ -75,4 +76,4 @@ jobs: DEV9KC: ${{ secrets.DEV9KC }} SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} TENDERLY_FORK_ID: ${{ secrets.TENDERLY_FORK_ID }} - DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} \ No newline at end of file + DEVOPS_CHANNEL_WEBHOOK_URL: ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}