|
1 | | -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
2 | | -# SPDX-License-Identifier: Apache-2.0 |
3 | | -# |
4 | | -# Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | -# you may not use this file except in compliance with the License. |
6 | | -# You may obtain a copy of the License at |
7 | | -# |
8 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
9 | | -# |
10 | | -# Unless required by applicable law or agreed to in writing, software |
11 | | -# distributed under the License is distributed on an "AS IS" BASIS, |
12 | | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | -# See the License for the specific language governing permissions and |
14 | | -# limitations under the License. |
15 | | - |
16 | | -name: NVIDIA Test Lab Validation |
| 1 | +name: Trigger Secure Deploy |
17 | 2 |
|
18 | 3 | on: |
19 | | - push: |
20 | | - branches: |
21 | | - - main |
22 | | - - release/*.*.* |
23 | | - - "pull-request/[0-9]+" |
24 | | - # Skip docs only changes |
25 | | - paths-ignore: |
26 | | - - '**.md' |
27 | | - - '**.rst' |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + run_deploy_operator: |
| 7 | + description: 'Run deploy operator and deployment tests' |
| 8 | + required: false |
| 9 | + default: false |
| 10 | + type: boolean |
| 11 | + target_branch: |
| 12 | + description: 'Branch to run deploy tests on' |
| 13 | + required: false |
| 14 | + default: 'main' |
| 15 | + type: string |
28 | 16 |
|
29 | 17 | jobs: |
30 | | - mirror_repo: |
31 | | - name: Mirror Repository to GitLab |
32 | | - environment: GITLAB |
33 | | - runs-on: |
34 | | - group: gitlab_ci_runners |
35 | | - steps: |
36 | | - - name: Checkout repository |
37 | | - uses: actions/checkout@v4 |
38 | | - - name: Sync Mirror Repository |
39 | | - run: ./.github/workflows/mirror_repo.sh ${{ secrets.TOKEN }} ${{ secrets.MIRROR_URL }} |
40 | | - |
41 | | - trigger-ci: |
42 | | - name: Trigger CI Pipeline |
43 | | - environment: GITLAB |
44 | | - needs: mirror_repo |
45 | | - runs-on: |
46 | | - group: gitlab_ci_runners |
| 18 | + trigger-deploy-tests: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + environment: protected-deploy # manual approval before triggering |
47 | 21 | steps: |
48 | | - - name: Checkout repository |
49 | | - uses: actions/checkout@v4 |
50 | | - - name: Detect source code changes |
51 | | - id: src_changes |
52 | | - uses: dorny/paths-filter@v3 |
53 | | - with: |
54 | | - filters: .github/filters.yaml |
55 | | - - name: Check if Validation Workflow has run |
56 | | - id: check_workflow |
57 | | - uses: actions/github-script@v6 |
58 | | - with: |
59 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
60 | | - script: | |
61 | | - const eventName = context.eventName; |
62 | | - let commit_sha = context.sha; |
63 | | - const workflow_id = 'build-and-test.yml'; |
64 | | - if (eventName === 'pull_request') { |
65 | | - commit_sha = context.payload.pull_request.head.sha; |
66 | | - } |
67 | | - const runs = await github.rest.actions.listWorkflowRuns({ |
68 | | - owner: context.repo.owner, |
69 | | - repo: context.repo.repo, |
70 | | - workflow_id: workflow_id, |
71 | | - head_sha: commit_sha, |
72 | | - event: eventName |
73 | | - }); |
74 | | - const inProgressCount = runs.data.workflow_runs.filter(run => run.status === 'in_progress').length; |
75 | | - const queuedCount = runs.data.workflow_runs.filter(run => run.status === 'queued').length; |
76 | | - const skip_ci = inProgressCount > 0 || queuedCount > 0; |
77 | | - console.log(`Validation Workflow is running: ${skip_ci}`); |
78 | | - core.setOutput('skip_ci', skip_ci.toString()); |
79 | | - - name: Trigger Pipeline |
80 | | - run: | |
81 | | - #!/bin/bash -e |
82 | | - declare -A ci_variables |
83 | | -
|
84 | | - ci_variables["ENABLE_BUILD"]="true" |
85 | | - ci_variables["ENABLE_PREMERGE"]="true" |
86 | | - ci_variables["ENABLE_E2E_TEST"]="true" |
87 | | -
|
88 | | - # Override to false if validation workflow is running |
89 | | - if [[ "${{ vars.ALLOW_GITLAB_TEST_SKIP }}" == "1" && "${{ steps.check_workflow.outputs.skip_ci }}" == "true" ]]; then |
90 | | - echo "Github Workflow has run and ENABLE_PREMERGE variable value is False" |
91 | | - ci_variables["ENABLE_PREMERGE"]="false" |
92 | | - fi |
93 | | -
|
94 | | - # Build space-separated FRAMEWORKS variable |
95 | | - frameworks="" |
96 | | - if [ "${{ steps.src_changes.outputs.vllm }}" == "true" ]; then |
97 | | - frameworks+="vllm " |
98 | | - fi |
99 | | -
|
100 | | - if [ "${{ steps.src_changes.outputs.trtllm }}" == "true" ]; then |
101 | | - frameworks+="trtllm " |
102 | | - fi |
103 | | -
|
104 | | - if [ "${{ steps.src_changes.outputs.sglang }}" == "true" ]; then |
105 | | - frameworks+="sglang " |
106 | | - fi |
107 | | -
|
108 | | - # Trim trailing space and set FRAMEWORKS variable if any frameworks detected |
109 | | - frameworks=$(echo "$frameworks" | xargs) |
110 | | - if [ -n "$frameworks" ]; then |
111 | | - ci_variables["FRAMEWORKS"]="$frameworks" |
112 | | - fi |
113 | | -
|
114 | | - # Set BUILD_ARCHS to empty string to build both amd64 and arm64 |
115 | | - ci_variables["BUILD_ARCHS"]="" |
116 | | -
|
117 | | - # Set additional pipeline variables |
118 | | - ci_variables["ENABLE_PUBLISH_WHEELS"]="false" |
119 | | - ci_variables["ENABLE_JET_BENCHMARKS"]="false" |
120 | | - ci_variables["ENABLE_SECURITY_SCAN"]="false" |
121 | | - ci_variables["RELEASE_BUILD"]="false" |
122 | | -
|
123 | | - ci_args=() |
124 | | - for key in "${!ci_variables[@]}"; do |
125 | | - value="${ci_variables[$key]}" |
126 | | - ci_args+=(--form "variables[$key]=${value}") |
127 | | - done |
128 | | -
|
129 | | - echo "Running Pipeline with Variables: ${ci_args[*]}" |
130 | | -
|
131 | | - if [ "${{ github.event_name }}" = "pull_request" ]; then |
132 | | - REF="${{ github.event.pull_request.head.ref }}" |
133 | | - else |
134 | | - REF="${{ github.ref }}" |
135 | | - fi |
136 | | - curl --fail-with-body \ |
137 | | - --request POST \ |
138 | | - --form token=${{ secrets.PIPELINE_TOKEN }} \ |
139 | | - --form ref=${REF} \ |
140 | | - "${ci_args[@]}" \ |
141 | | - "${{ secrets.PIPELINE_URL }}" |
| 22 | + - name: Call Secure Deploy Workflow |
| 23 | + uses: ./.github/workflows/container-validation-backends.yml |
| 24 | + with: |
| 25 | + run_deploy_operator: ${{ github.event.inputs.run_deploy_operator }} |
0 commit comments