Skip to content

Add reusable_ prefix for reusable workflows. #2660

Add reusable_ prefix for reusable workflows.

Add reusable_ prefix for reusable workflows. #2660

Workflow file for this run

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
name: Build Tests
on:
workflow_dispatch:
inputs:
tpu-type:
description: 'TPU Type'
required: true
default: 'v4-8'
type: choice
options:
- v4-8
push:
branches: ["main","develop"]
pull_request: # By default this runs for types assigned, opened and synchronize.
jobs:
set-variables:
runs-on: [ubuntu-22.04]
concurrency:
group: set-variables-${{ github.event.number}}
cancel-in-progress: true
outputs:
cluster-name: ${{ steps.set-cluster-name.outputs.cluster-name }}
group-name: ${{ steps.set-group-name.outputs.group-name }}
zone: ${{ steps.set-zone.outputs.zone }}
tpu-type: ${{ steps.set-tpu-type.outputs.tpu-type }}
location: ${{steps.set-location.outputs.location}}
run-id: ${{steps.set-run-id.outputs.run-id}}
steps:
- name: set run-id
id: set-run-id
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
RUN_ID="dispatch"
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
RUN_ID="main"
elif [ "${{ github.ref }}" == "refs/heads/develop" ]; then
RUN_ID="develop"
else
RUN_ID="${{ github.event.number }}"
fi
echo run-id=$RUN_ID >> $GITHUB_OUTPUT
- name: set cluster-name
id: set-cluster-name
run: |
echo cluster-name=build-xpk-2-nodepools-${{steps.set-run-id.outputs.run-id}} >> $GITHUB_OUTPUT
- name: set group-name
id: set-group-name
run: |
echo group-name=xpk-${{steps.set-run-id.outputs.run-id}} >> $GITHUB_OUTPUT
- name: set zone
id: set-zone
run: |
echo zone=us-central2-b >> $GITHUB_OUTPUT
- name: set tpu-type
id: set-tpu-type
run: |
echo tpu-type=v4-8 >> $GITHUB_OUTPUT
- name: set location
id: set-location
run: |
echo location=us-central2 >> $GITHUB_OUTPUT
install-dependencies:
needs: [set-variables]
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
install_components: 'beta, gke-gcloud-auth-plugin'
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check if cache exists
id: check-cache
uses: actions/cache@v3
with:
path: |
usr/local/bin/
~/.cache/pip
${{env.pythonLocation}}
key: xpk-deps-${{ matrix.python-version }}-${{needs.set-variables.outputs.run-id}}
lookup-only: true
- name: install dependencies
if : steps.check-cache.outputs.cache-hit != 'true'
run: make install-lint && make install-dev
- name: Cache dependencies
if : steps.check-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
/usr/local/bin/kubectl-kueue
/usr/local/bin/kubectl-kjob
~/.cache/pip
${{env.pythonLocation}}
key: xpk-deps-${{ matrix.python-version }}-${{needs.set-variables.outputs.run-id}}
linter:
needs: [install-dependencies, set-variables]
concurrency: # We support one build or nightly test to run at a time currently.
group: linter-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
uses: ./.github/workflows/reusable_lint_and_format.yml
with:
run-id: '${{needs.set-variables.outputs.run-id}}'
run-unit-tests:
uses: ./.github/workflows/reusable_unit_tests.yaml
with:
run-id: ${{needs.set-variables.outputs.run-id}}
concurrency: # We support one build or nightly test to run at a time currently.
group: unit-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
needs: [linter, set-variables]
run-integration-tests:
uses: ./.github/workflows/reusable_integration_tests.yaml
with:
run-id: '${{needs.set-variables.outputs.run-id}}'
concurrency: # We support one build or nightly test to run at a time currently.
group: integration-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
secrets: inherit
needs: [run-unit-tests, set-variables]
cluster-private:
needs: [run-integration-tests, set-variables]
uses: ./.github/workflows/reusable_cluster_private.yaml
concurrency: # We support one build or nightly test to run at a time currently.
group: cluster-private-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
with:
run-id: '${{needs.set-variables.outputs.run-id}}'
cluster-name: '${{needs.set-variables.outputs.cluster-name}}'
tpu-type: '${{needs.set-variables.outputs.tpu-type || inputs.tpu-type}}'
zone: '${{needs.set-variables.outputs.zone}}'
location: '${{needs.set-variables.outputs.location}}'
secrets: inherit
cluster-create:
needs: [run-integration-tests, set-variables]
concurrency: # We support one build or nightly test to run at a time currently.
group: cluster-create-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
uses: ./.github/workflows/reusable_cluster_create.yaml
with:
cluster-name: '${{needs.set-variables.outputs.cluster-name}}'
tpu-type: '${{needs.set-variables.outputs.tpu-type || inputs.tpu-type}}'
zone: '${{needs.set-variables.outputs.zone}}'
location: '${{needs.set-variables.outputs.location}}'
run-id: '${{needs.set-variables.outputs.run-id}}'
secrets: inherit
workloads-tests:
needs: [cluster-create, set-variables]
uses: ./.github/workflows/workload_test.yaml

Check failure on line 169 in .github/workflows/build_tests.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build_tests.yaml

Invalid workflow file

error parsing called workflow ".github/workflows/build_tests.yaml" -> "./.github/workflows/workload_test.yaml" : failed to fetch workflow: workflow was not found.
concurrency: # We support one build or nightly test to run at a time currently.
group: workload-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
with:
cluster-name: ${{needs.set-variables.outputs.cluster-name}}
tpu-type: ${{needs.set-variables.outputs.tpu-type}}
zone: ${{needs.set-variables.outputs.zone}}
run-id: '${{needs.set-variables.outputs.run-id}}'
secrets: inherit
batch-tests:
needs: [cluster-create, set-variables]
uses: ./.github/workflows/reusable_batch_tests.yaml
concurrency: # We support one build or nightly test to run at a time currently.
group: batch-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
with:
cluster-name: ${{needs.set-variables.outputs.cluster-name}}
zone: ${{needs.set-variables.outputs.zone}}
run-id: ${{needs.set-variables.outputs.run-id}}
secrets: inherit
filestore-tests:
needs: [cluster-create, set-variables, batch-tests, workloads-tests]
uses: ./.github/workflows/reusable_filestore_tests.yaml
concurrency: # We support one build or nightly test to run at a time currently.
group: filestore-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
with:
cluster-name: ${{needs.set-variables.outputs.cluster-name}}
tpu-type: ${{needs.set-variables.outputs.tpu-type}}
zone: ${{needs.set-variables.outputs.zone}}
location: ${{needs.set-variables.outputs.location}}
run-id: ${{needs.set-variables.outputs.run-id}}
secrets: inherit
fuse-tests:
needs: [filestore-tests, set-variables]
uses: ./.github/workflows/reusable_fuse_tests.yaml
concurrency: # We support one build or nightly test to run at a time currently.
group: fuse-tests-${{needs.set-variables.outputs.run-id}}
cancel-in-progress: true
with:
cluster-name: ${{needs.set-variables.outputs.cluster-name}}
tpu-type: ${{needs.set-variables.outputs.tpu-type}}
zone: ${{needs.set-variables.outputs.zone}}
location: ${{needs.set-variables.outputs.location}}
run-id: ${{needs.set-variables.outputs.run-id}}
secrets: inherit
cluster-delete:
if: always()
needs: [set-variables, fuse-tests]
uses: ./.github/workflows/reusable_cluster_delete.yaml
with:
cluster-name: ${{needs.set-variables.outputs.cluster-name}}
run-id: ${{needs.set-variables.outputs.run-id}}
zone: ${{needs.set-variables.outputs.zone}}
secrets: inherit