Skip to content

Commit bc7d40b

Browse files
authored
Merge pull request #951 from NVIDIA/anuragd/setup_ci
2 parents 7330c48 + 5af6933 commit bc7d40b

File tree

3 files changed

+98
-4
lines changed

3 files changed

+98
-4
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Copyright (c) 2022, NVIDIA CORPORATION.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
16+
name: Blossom-CI
17+
on:
18+
issue_comment:
19+
types: [created]
20+
workflow_dispatch:
21+
inputs:
22+
platform:
23+
description: 'runs-on argument'
24+
required: false
25+
args:
26+
description: 'argument'
27+
required: false
28+
jobs:
29+
Authorization:
30+
name: Authorization
31+
runs-on: blossom
32+
outputs:
33+
args: ${{ env.args }}
34+
35+
# This job only runs for pull request comments
36+
if: |
37+
contains( ${{ secrets.AUTHORIZED_USERS }}, format('{0},', github.actor)) &&
38+
github.event.comment.body == '/nvidia-ci'
39+
steps:
40+
- name: Check if comment is issued by authorized person
41+
run: blossom-ci
42+
env:
43+
OPERATION: 'AUTH'
44+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
46+
47+
Vulnerability-scan:
48+
name: Vulnerability scan
49+
needs: [Authorization]
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v2
54+
with:
55+
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
56+
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
57+
lfs: 'true'
58+
59+
- name: Run blossom action
60+
uses: NVIDIA/blossom-action@main
61+
env:
62+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
64+
with:
65+
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
66+
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
67+
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
68+
69+
Job-trigger:
70+
name: Start ci job
71+
needs: [Vulnerability-scan]
72+
runs-on: blossom
73+
steps:
74+
- name: Start ci job
75+
run: blossom-ci
76+
env:
77+
OPERATION: 'START-CI-JOB'
78+
CI_SERVER: ${{ secrets.CI_SERVER }}
79+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
Upload-Log:
82+
name: Upload log
83+
runs-on: blossom
84+
if : github.event_name == 'workflow_dispatch'
85+
steps:
86+
- name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here)
87+
run: blossom-ci
88+
env:
89+
OPERATION: 'POST-PROCESSING'
90+
CI_SERVER: ${{ secrets.CI_SERVER }}
91+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

core/lowering/register_trt_placeholder_ops.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ c10::AliasAnalysisKind aliasAnalysisFromSchema() {
1010
RegisterOperators trt_placeholder_ops_reg({
1111
/// Op marks a Tensor to be conveted from an Torch Tensor
1212
/// to a TRT constant Tensor
13-
Operator(
14-
"trt::const(Tensor val) -> Tensor",
15-
[](Stack& stack) { /*noop*/ },
16-
aliasAnalysisFromSchema()),
13+
Operator("trt::const(Tensor val) -> Tensor", [](Stack& stack) { /*noop*/ }, aliasAnalysisFromSchema()),
1714
});
1815

1916
} // namespace jit

noxfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def download_models(session, use_host_env=False):
2626
if use_host_env:
2727
session.run_always('python', 'hub.py', env={'PYTHONPATH': PYT_PATH})
2828
else:
29+
session.install("-r", os.path.join(TOP_DIR, "py", "requirements.txt"))
2930
session.run_always('python', 'hub.py')
3031

3132
def install_torch_trt(session):
@@ -328,4 +329,9 @@ def l2_multi_gpu_tests_host_deps(session):
328329
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
329330
def download_test_models(session):
330331
"""Grab all the models needed for testing"""
332+
download_models(session, use_host_env=False)
333+
334+
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
335+
def download_test_models_host_deps(session):
336+
"""Grab all the models needed for testing using host dependencies"""
331337
download_models(session, use_host_env=True)

0 commit comments

Comments
 (0)