mirror of
https://github.com/modelscope/modelscope.git
synced 2026-07-09 20:09:17 +02:00
61 lines
2.1 KiB
YAML
61 lines
2.1 KiB
YAML
name: Build Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
workflow_name:
|
|
description: 'The specific name of this build'
|
|
required: true
|
|
default: 'build'
|
|
modelscope_branch:
|
|
description: 'ModelScope branch to build from(release/x.xx)'
|
|
required: true
|
|
image_type:
|
|
description: 'The image type to build(base/old/stable/latest)'
|
|
required: true
|
|
modelscope_version:
|
|
description: 'ModelScope version to use(x.xx.x)'
|
|
required: true
|
|
swift_branch:
|
|
description: 'SWIFT branch to use(release/x.xx)'
|
|
required: true
|
|
ci_image:
|
|
description: 'Set as the CI image'
|
|
default: '0'
|
|
required: false
|
|
other_params:
|
|
description: 'Other params in --xxx xxx'
|
|
required: false
|
|
python_version:
|
|
description: 'Python version to use, default is 3.12.13'
|
|
required: false
|
|
default: '3.12.13'
|
|
|
|
run-name: Docker-${{ inputs.modelscope_branch }}-${{ inputs.image_type }}-${{ inputs.workflow_name }}-${{ inputs.python_version }}-by-@${{ github.actor }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [modelscope-self-hosted-us]
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
|
|
|
|
steps:
|
|
- name: ResetFileMode
|
|
shell: bash
|
|
run: |
|
|
# reset filemode to allow action runner to delete files
|
|
# generated by root in docker
|
|
set -e
|
|
source ~/.bashrc
|
|
sudo chown -R $USER:$USER $ACTION_RUNNER_DIR
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{ github.event.inputs.modelscope_branch }}
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
set -e
|
|
source ~/.bashrc
|
|
python docker/build_image.py --image_type ${{ github.event.inputs.image_type }} --python_version ${{ github.event.inputs.python_version }} --modelscope_branch ${{ github.event.inputs.modelscope_branch }} --modelscope_version ${{ github.event.inputs.modelscope_version }} --swift_branch ${{ github.event.inputs.swift_branch }} --ci_image ${{ github.event.inputs.ci_image }} ${{ github.event.inputs.other_params }}
|