parameters: - name: arch type: string values: - x64 - aarch64 - name: package_version type: string - name: version_file type: string - name: cmake_build_type type: string values: - Debug - Release - RelWithDebInfo - MinSizeRel stages: - stage: Linux_plugin_webgpu_${{ parameters.arch }}_Build dependsOn: [] pool: ${{ if eq(parameters.arch, 'aarch64') }}: name: onnxruntime-linux-ARM64-CPU-2019 os: linux hostArchitecture: Arm64 ${{ else }}: name: onnxruntime-Ubuntu2404-AMD-CPU os: linux variables: ${{ if eq(parameters.arch, 'aarch64') }}: DockerBaseImage: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_aarch64_almalinux8_gcc14:20251017.1 DockerRepository: onnxruntimewebgpupluginaarch64 ${{ else }}: DockerBaseImage: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cpu_x64_almalinux8_gcc14:20251017.1 DockerRepository: onnxruntimewebgpuplugin jobs: - job: Linux_plugin_webgpu_${{ parameters.arch }}_Build timeoutInMinutes: 240 workspace: clean: all templateContext: outputs: - output: pipelineArtifact targetPath: $(Build.ArtifactStagingDirectory) artifactName: webgpu_plugin_linux_${{ parameters.arch }} variables: - template: ../templates/common-variables.yml steps: - template: ../templates/jobs/checkout-and-git-redirect.yml - template: ../templates/set-nightly-build-option-variable-step.yml - template: ../templates/set-plugin-ep-build-variables-step.yml parameters: package_version: ${{ parameters.package_version }} version_file: ${{ parameters.version_file }} - template: ../templates/setup-feeds-and-python-steps.yml parameters: architecture: ${{ parameters.arch }} - template: ../templates/get-docker-image-steps.yml parameters: Dockerfile: tools/ci_build/github/linux/docker/inference/shared/python/webgpu/Dockerfile Context: tools/ci_build/github/linux/docker/inference/shared/python/webgpu DockerBuildArgs: "--build-arg BASEIMAGE=$(DockerBaseImage) --build-arg BUILD_UID=$( id -u )" Repository: $(DockerRepository) - script: $(Build.SourcesDirectory)/tools/ci_build/github/linux/build_webgpu_plugin_package.sh -i $(DockerRepository) -c ${{ parameters.cmake_build_type }} workingDirectory: $(Build.SourcesDirectory) displayName: 'Build WebGPU Plugin' env: EXTRA_CMAKE_DEFINES: $(PluginEpVersionDefine) - script: | set -e -x mkdir -p $(Build.ArtifactStagingDirectory)/bin plugin_path="$(Build.BinariesDirectory)/${{ parameters.cmake_build_type }}/libonnxruntime_providers_webgpu.so" if [ ! -f "$plugin_path" ]; then echo "Error: Expected plugin binary not found at '$plugin_path'. Failing build to avoid publishing an invalid package." exit 1 fi cp "$plugin_path" "$(Build.ArtifactStagingDirectory)/bin/" displayName: 'Copy plugin binaries' - script: | set -e -x mkdir -p "$(Build.ArtifactStagingDirectory)/version" touch "$(Build.ArtifactStagingDirectory)/version/$(PluginPackageVersion)" displayName: 'Create version marker file' # Python package build job - job: Linux_plugin_webgpu_${{ parameters.arch }}_Build_Python_Package dependsOn: Linux_plugin_webgpu_${{ parameters.arch }}_Build timeoutInMinutes: 60 workspace: clean: all templateContext: outputs: - output: pipelineArtifact targetPath: $(Build.ArtifactStagingDirectory)/python artifactName: webgpu_plugin_python_linux_${{ parameters.arch }} variables: - template: ../templates/common-variables.yml steps: - template: ../templates/jobs/checkout-and-git-redirect.yml - template: ../templates/set-nightly-build-option-variable-step.yml - template: ../templates/set-plugin-ep-build-variables-step.yml parameters: package_version: ${{ parameters.package_version }} version_file: ${{ parameters.version_file }} - template: ../templates/setup-feeds-and-python-steps.yml parameters: architecture: ${{ parameters.arch }} - template: ../templates/get-docker-image-steps.yml parameters: Dockerfile: tools/ci_build/github/linux/docker/inference/shared/python/webgpu/Dockerfile Context: tools/ci_build/github/linux/docker/inference/shared/python/webgpu DockerBuildArgs: "--build-arg BASEIMAGE=$(DockerBaseImage) --build-arg BUILD_UID=$( id -u )" Repository: $(DockerRepository) - task: DownloadPipelineArtifact@2 displayName: 'Download plugin build artifacts' inputs: artifactName: webgpu_plugin_linux_${{ parameters.arch }} targetPath: '$(Build.BinariesDirectory)/plugin_artifacts' - script: | set -e -x $(Build.SourcesDirectory)/tools/ci_build/github/linux/build_webgpu_plugin_python_package.sh \ -i $(DockerRepository) \ -v "$(PluginPythonPackageVersion)" displayName: 'Build Python wheel'