mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
enhance: [skip e2e]abstract bump builder version into a composite action (#29573)
fix: #29608 Signed-off-by: Sammy Huang <sammy.huang@zilliz.com>
This commit is contained in:
parent
77ca374d6f
commit
acbbabf043
55
.github/actions/bump-builder-version/action.yaml
vendored
Normal file
55
.github/actions/bump-builder-version/action.yaml
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
name: 'Bump Builder Version'
|
||||||
|
description: 'bump builder version in the .env file'
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Tag name'
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
description: 'the type of builder image, cpu or gpu'
|
||||||
|
required: true
|
||||||
|
default: 'cpu'
|
||||||
|
token:
|
||||||
|
description: 'github token to create pull request'
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Bump Builder Version when cpu type
|
||||||
|
if: ${{ inputs.type == 'cpu' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#^DATE_VERSION=.*#DATE_VERSION=${{ inputs.tag }}#g" .env
|
||||||
|
sed -i "s#^LATEST_DATE_VERSION=.*#LATEST_DATE_VERSION=${{ inputs.tag }}#g" .env
|
||||||
|
- name: Bump Builder Version when gpu type
|
||||||
|
if: ${{ inputs.type == 'gpu' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#^GPU_DATE_VERSION=.*#GPU_DATE_VERSION=${{ inputs.tag }}#g" .env
|
||||||
|
sed -i "s#^LATEST_GPU_DATE_VERSION=.*#LATEST_GPU_DATE_VERSION=${{ inputs.tag }}#g" .env
|
||||||
|
- name: git config
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add .env
|
||||||
|
git commit -m "Update Builder image changes"
|
||||||
|
- name: Create Pull Request
|
||||||
|
id: cpr
|
||||||
|
uses: peter-evans/create-pull-request@v3
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
token: ${{ inputs.token }}
|
||||||
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||||
|
signoff: false
|
||||||
|
branch: update_${{ inputs.type }}_builder_${{ github.sha }}
|
||||||
|
delete-branch: true
|
||||||
|
title: '[automated] Update ${{ inputs.type }} Builder image changes'
|
||||||
|
body: |
|
||||||
|
Update ${{ inputs.type }} Builder image changes
|
||||||
|
See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }}
|
||||||
|
Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com
|
||||||
|
- name: Check outputs
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||||
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||||
34
.github/workflows/publish-builder.yaml
vendored
34
.github/workflows/publish-builder.yaml
vendored
@ -74,36 +74,10 @@ jobs:
|
|||||||
-p ${{ secrets.DOCKERHUB_TOKEN }}
|
-p ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t milvusdb/milvus-env:${OS_NAME}-${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} -f build/docker/builder/cpu/${OS_NAME}/Dockerfile .
|
docker buildx build --platform linux/amd64,linux/arm64 --push -t milvusdb/milvus-env:${OS_NAME}-${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }} -f build/docker/builder/cpu/${OS_NAME}/Dockerfile .
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t milvusdb/milvus-env:${OS_NAME}-latest -f build/docker/builder/cpu/${OS_NAME}/Dockerfile .
|
docker buildx build --platform linux/amd64,linux/arm64 --push -t milvusdb/milvus-env:${OS_NAME}-latest -f build/docker/builder/cpu/${OS_NAME}/Dockerfile .
|
||||||
- name: Update Builder Image Changes
|
- name: Bump Builder Version
|
||||||
|
uses: ./.github/actions/bump-builder-version
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
||||||
continue-on-error: true
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sed -i "s#^DATE_VERSION=.*#DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env
|
|
||||||
sed -i "s#^LATEST_DATE_VERSION=.*#LATEST_DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env
|
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git add .env
|
|
||||||
git commit -m "Update Builder image changes"
|
|
||||||
- name: Create Pull Request
|
|
||||||
id: cpr
|
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
|
||||||
continue-on-error: true
|
|
||||||
uses: peter-evans/create-pull-request@v3
|
|
||||||
with:
|
with:
|
||||||
|
tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}"
|
||||||
|
type: cpu
|
||||||
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
||||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
||||||
signoff: false
|
|
||||||
branch: update_builder_${{ github.sha }}
|
|
||||||
delete-branch: true
|
|
||||||
title: '[automated] Update Builder image changes'
|
|
||||||
body: |
|
|
||||||
Update Builder image changes
|
|
||||||
See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }}
|
|
||||||
Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com
|
|
||||||
- name: Check outputs
|
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
|
||||||
run: |
|
|
||||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
||||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
||||||
|
|
||||||
|
|||||||
34
.github/workflows/publish-gpu-builder.yaml
vendored
34
.github/workflows/publish-gpu-builder.yaml
vendored
@ -73,36 +73,10 @@ jobs:
|
|||||||
# Building the second image
|
# Building the second image
|
||||||
docker build -t milvusdb/milvus-env:gpu-${OS_NAME}-latest -f build/docker/builder/gpu/${OS_NAME}/Dockerfile .
|
docker build -t milvusdb/milvus-env:gpu-${OS_NAME}-latest -f build/docker/builder/gpu/${OS_NAME}/Dockerfile .
|
||||||
docker push milvusdb/milvus-env:gpu-${OS_NAME}-latest
|
docker push milvusdb/milvus-env:gpu-${OS_NAME}-latest
|
||||||
|
- name: Bump Builder Version
|
||||||
- name: Update Builder Image Changes
|
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
||||||
continue-on-error: true
|
uses: ./.github/actions/bump-builder-version
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sed -i "s#^GPU_DATE_VERSION=.*#GPU_DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env
|
|
||||||
sed -i "s#^LATEST_GPU_DATE_VERSION=.*#LATEST_GPU_DATE_VERSION=${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}#g" .env
|
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git add .env
|
|
||||||
git commit -m "Update Builder gpu image changes"
|
|
||||||
- name: Create Pull Request
|
|
||||||
id: cpr
|
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
|
||||||
continue-on-error: true
|
|
||||||
uses: peter-evans/create-pull-request@v3
|
|
||||||
with:
|
with:
|
||||||
|
tag: "${{ steps.extracter.outputs.version }}-${{ steps.extracter.outputs.sha_short }}"
|
||||||
|
type: gpu
|
||||||
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
token: ${{ secrets.ALL_CONTRIBUTORS_TOKEN }}
|
||||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
||||||
signoff: false
|
|
||||||
branch: update_gpu_builder_${{ github.sha }}
|
|
||||||
delete-branch: true
|
|
||||||
title: '[automated] Update Builder gpu image changes'
|
|
||||||
body: |
|
|
||||||
Update Builder gpu image changes
|
|
||||||
See changes: https://github.com/milvus-io/milvus/commit/${{ github.sha }}
|
|
||||||
Signed-off-by: ${{ github.actor }} ${{ github.actor }}@users.noreply.github.com
|
|
||||||
- name: Check outputs
|
|
||||||
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' && matrix.os == 'ubuntu20.04'
|
|
||||||
run: |
|
|
||||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
||||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user