@@ -53,6 +53,11 @@ inputs:
5353runs :
5454 using : " composite"
5555 steps :
56+ - name : Checkout repository
57+ uses : actions/checkout@v2
58+ with :
59+ path : NeMo-Automodel
60+
5661 - name : Install Azure CLI
5762 if : ${{ inputs.has-azure-credentials == 'true' }}
5863 shell : bash
@@ -69,78 +74,11 @@ runs:
6974 tenant-id : ${{ inputs.azure-tenant-id }}
7075 subscription-id : ${{ inputs.azure-subscription-id }}
7176
72- - name : Azure Fileshare
73- if : ${{ inputs.has-azure-credentials == 'true' && inputs.is-unit-test == 'false' }}
74- shell : bash
75- id : azure-fileshare
76- run : |
77- echo "::group::Mount SMB drive"
78- sudo apt update
79- sudo apt install -y cifs-utils
80-
81- RESOURCE_GROUP_NAME="azure-gpu-vm-runner_group"
82- STORAGE_ACCOUNT_NAME="nemocistorageaccount2"
83- FILE_SHARE_NAME="fileshare"
84-
85- MNT_ROOT="/media"
86- MNT_PATH="$MNT_ROOT/$STORAGE_ACCOUNT_NAME/$FILE_SHARE_NAME"
87-
88- echo "MNT_PATH=$MNT_PATH" | tee -a "$GITHUB_OUTPUT"
89-
90- sudo mkdir -p $MNT_PATH
91-
92- # Create a folder to store the credentials for this storage account and
93- # any other that you might set up.
94- CREDENTIAL_ROOT="/etc/smbcredentials"
95- sudo mkdir -p "/etc/smbcredentials"
96-
97- # Get the storage account key for the indicated storage account.
98- # You must be logged in with az login and your user identity must have
99- # permissions to list the storage account keys for this command to work.
100- STORAGE_ACCOUNT_KEY=$(az storage account keys list \
101- --resource-group $RESOURCE_GROUP_NAME \
102- --account-name $STORAGE_ACCOUNT_NAME \
103- --query "[0].value" --output tsv | tr -d '"')
104-
105- # Create the credential file for this individual storage account
106- SMB_CREDENTIAL_FILE="$CREDENTIAL_ROOT/$STORAGE_ACCOUNT_NAME.cred"
107- if [ ! -f $SMB_CREDENTIAL_FILE ]; then
108- echo "username=$STORAGE_ACCOUNT_NAME" | sudo tee $SMB_CREDENTIAL_FILE > /dev/null
109- echo "password=$STORAGE_ACCOUNT_KEY" | sudo tee -a $SMB_CREDENTIAL_FILE > /dev/null
110- else
111- echo "The credential file $SMB_CREDENTIAL_FILE already exists, and was not modified."
112- fi
113-
114- # Change permissions on the credential file so only root can read or modify the password file.
115- sudo chmod 600 $SMB_CREDENTIAL_FILE
116-
117- # This command assumes you have logged in with az login
118- HTTP_ENDPOINT=$(az storage account show --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --query "primaryEndpoints.file" --output tsv | tr -d '"')
119- SMB_PATH=$(echo $HTTP_ENDPOINT | cut -c7-${#HTTP_ENDPOINT})$FILE_SHARE_NAME
120-
121- STORAGE_ACCOUNT_KEY=$(az storage account keys list --resource-group $RESOURCE_GROUP_NAME --account-name $STORAGE_ACCOUNT_NAME --query "[0].value" --output tsv | tr -d '"')
122-
123- sudo mount -t cifs $SMB_PATH $MNT_PATH -o credentials=$SMB_CREDENTIAL_FILE,serverino,nosharesock,actimeo=30,mfsymlinks
124-
125- ls -al $MNT_PATH/TestData
126- echo "::endgroup::"
127-
128- - name : Checkout repository
129- uses : actions/checkout@v2
130- with :
131- path : NeMo-Automodel
132-
133- - name : Build container
77+ - name : Azure ACR Login
78+ if : ${{ inputs.has-azure-credentials == 'true' }}
13479 shell : bash
135- env :
136- GH_TOKEN : ${{ inputs.PAT }}
13780 run : |
138- echo "::group::Build test container"
139- docker system prune -af
140- docker build -f docker/Dockerfile \
141- --build-arg BASE_IMAGE=pytorch \
142- --target automodel_final -t automodel .
143- echo "::endgroup::"
81+ az acr login --name nemoci
14482
14583 - name : Start container
14684 shell : bash
0 commit comments