Skip to content

Commit 5192266

Browse files
committed
Revert "remove azure logins"
This reverts commit a58f273. Signed-off-by: oliver könig <okoenig@nvidia.com>
1 parent 7749f57 commit 5192266

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.github/actions/build-container/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@
1515
name: Build container
1616

1717
inputs:
18+
azure-client-id:
19+
description: "Azure Client ID"
20+
required: true
21+
azure-tenant-id:
22+
description: "Azure Tenant ID"
23+
required: true
24+
azure-subscription-id:
25+
description: "Azure Subscription ID"
26+
required: true
1827
dockerfile-path:
1928
description: "Path to dockerfile to build"
2029
required: true
30+
has-azure-credentials:
31+
description: "Has Azure credentials"
32+
required: false
33+
default: "false"
2134
PAT:
2235
description: "GitHub Personal Access Token"
2336
required: true
@@ -46,6 +59,26 @@ runs:
4659
if: startsWith(github.ref, 'refs/heads/pull-request/')
4760
uses: nv-gha-runners/get-pr-info@main
4861

62+
- name: Install Azure CLI
63+
shell: bash
64+
run: |
65+
echo "::group::Install Azure CLI"
66+
# Create systemd override for proper dependencies
67+
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
68+
echo "::endgroup::"
69+
70+
- name: Azure Login
71+
uses: azure/login@v2
72+
with:
73+
client-id: ${{ inputs.azure-client-id }}
74+
tenant-id: ${{ inputs.azure-tenant-id }}
75+
subscription-id: ${{ inputs.azure-subscription-id }}
76+
77+
- name: Azure ACR Login
78+
shell: bash
79+
run: |
80+
az acr login --name nemoci
81+
4982
- name: Install GH CLI
5083
shell: bash
5184
run: |

.github/actions/test-template/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ inputs:
3434
description: "Run tests on CPU only"
3535
required: false
3636
default: "false"
37+
azure-client-id:
38+
description: "Azure Client ID"
39+
required: true
40+
azure-tenant-id:
41+
description: "Azure Tenant ID"
42+
required: true
43+
azure-subscription-id:
44+
description: "Azure Subscription ID"
45+
required: true
46+
has-azure-credentials:
47+
description: "Has Azure credentials"
48+
required: false
49+
default: "false"
3750
PAT:
3851
description: "GitHub Personal Access Token"
3952
required: true
@@ -55,6 +68,27 @@ runs:
5568
with:
5669
path: NeMo-Automodel
5770

71+
- name: Install Azure CLI
72+
if: ${{ inputs.has-azure-credentials == 'true' }}
73+
shell: bash
74+
run: |
75+
echo "::group::Install Azure CLI"
76+
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
77+
echo "::endgroup::"
78+
79+
- name: Azure Login
80+
if: ${{ inputs.has-azure-credentials == 'true' }}
81+
uses: azure/login@v2
82+
with:
83+
client-id: ${{ inputs.azure-client-id }}
84+
tenant-id: ${{ inputs.azure-tenant-id }}
85+
subscription-id: ${{ inputs.azure-subscription-id }}
86+
87+
- name: Azure ACR Login
88+
shell: bash
89+
run: |
90+
az acr login --name nemoci
91+
5892
- name: Install uuidgen
5993
shell: bash -x -e -u -o pipefail {0}
6094
if: ${{ contains(inputs.runner, 'aws') }}

.github/workflows/cicd-main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ jobs:
152152
- name: main
153153
uses: ./.github/actions/build-container
154154
with:
155+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
156+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
157+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
155158
dockerfile-path: "./docker/Dockerfile"
159+
has-azure-credentials: "true"
156160
PAT: ${{ secrets.PAT }}
157161
repo-name: "Automodel"
158162
registry: ${{ vars.ECR }}
@@ -189,6 +193,10 @@ jobs:
189193
timeout: ${{ matrix.timeout || 10 }}
190194
is-unit-test: "true"
191195
cpu-only: ${{ matrix.cpu-only || false }}
196+
has-azure-credentials: "true"
197+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
198+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
199+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
192200
PAT: ${{ secrets.PAT }}
193201
test-data-path: ${{ needs.pre-flight.outputs.test_data_path }}
194202
container-image: ${{ vars.ECR }}/automodel:${{ github.sha }}
@@ -259,6 +267,10 @@ jobs:
259267
test-folder: ${{ matrix.test-folder }}
260268
timeout: ${{ matrix.timeout }}
261269
is_unit_test: "false"
270+
has-azure-credentials: "true"
271+
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
272+
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
273+
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
262274
PAT: ${{ secrets.PAT }}
263275
test-data-path: ${{ matrix.test-data-path }}
264276
container-image: ${{ vars.ECR }}/automodel:${{ github.sha }}

0 commit comments

Comments
 (0)