-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate Azure Container Instances testing #925
Comments
Python (wait for Azure/azure-sdk-for-python#9146 to merge): prerequisite tools
Azure resourcesThis test requires instances of these Azure resources:
The rest of this section is a walkthrough of deploying these resources. set environment variables to simplify copy-pasting
resource groupaz group create -n $RESOURCE_GROUP --location westus2 managed identityCreate the managed identityaz identity create -g $RESOURCE_GROUP -n $MANAGED_IDENTITY_NAME Save its ARM URI for laterexport MANAGED_IDENTITY_ID=$(az identity show -g $RESOURCE_GROUP -n $MANAGED_IDENTITY_NAME --query id -o tsv) Key VaultCreate the Vaultaz keyvault create -g $RESOURCE_GROUP -n $KEY_VAULT_NAME --sku standard Add an access policy for the managed identityaz keyvault set-policy -n $KEY_VAULT_NAME \
--object-id $(az identity show -g $RESOURCE_GROUP -n $MANAGED_IDENTITY_NAME --query principalId -o tsv) \
--secret-permissions set delete container registryaz acr create -g $RESOURCE_GROUP -n $ACR_NAME --admin-enabled --sku basic build imagesThe test application must be packaged as a Docker image. Two images are needed authenticate to ACRaz acr login -n $ACR_NAME acquire the test codegit clone https://github.com/Azure/azure-sdk-for-python/ --branch master --single-branch --depth 1 The rest of this section assumes this working directory: cd azure-sdk-for-python/sdk/identity/azure-identity/tests build images and push them to the container registryset environment variablesexport REPOSITORY=$(az acr show -g $RESOURCE_GROUP -n $ACR_NAME --query loginServer -o tsv) \
IMAGE_NAME=test-pod-identity \
PYTHON_VERSION=2.7 build an imagedocker build --no-cache --build-arg PYTHON_VERSION=$PYTHON_VERSION -t $REPOSITORY/$IMAGE_NAME:$PYTHON_VERSION ./managed-identity-live push it to the registrydocker push $REPOSITORY/$IMAGE_NAME:$PYTHON_VERSION Then set run testsRun these commands twice, once with set a name for the container groupexport CONTAINER_NAME=managed-id-test-python${PYTHON_VERSION::1} run the testaz container create -g $RESOURCE_GROUP -n $CONTAINER_NAME \
--assign-identity $MANAGED_IDENTITY_ID \
--restart-policy OnFailure \
--registry-username $(az acr credential show -n $ACR_NAME --query username -o tsv) \
--registry-password $(az acr credential show -n $ACR_NAME --query passwords[0].value -o tsv) \
--image $REPOSITORY/$IMAGE_NAME:$PYTHON_VERSION \
-e AZURE_IDENTITY_TEST_VAULT_URL=$(az keyvault show -g $RESOURCE_GROUP -n $KEY_VAULT_NAME --query properties.vaultUri -o tsv) inspect outputaz container logs -g $RESOURCE_GROUP -n $CONTAINER_NAME Success looks like this:
delete Azure resourcesFinally, delete the resources created above: az group delete -n $RESOURCE_GROUP -y --no-wait |
Hi @chlowell , I am following above steps to do python E2E test. My suggestion as below. Please correct me if I miss anything. 1.We need add {} when combine two or more variables,or error will occur.
2. Also, It is not allowed to use ":" in container name. We can use hard code 27 or 38 as Python version to avoid this error.
|
The command lines don't work directly in PowerShell because I wrote them for bash or a compatible shell. They should work as expected in a Linux environment like WSL. |
@chlowell . Thanks for your clarification. So I need do this test against Linux? Or just format the command and run in windows like I used to? |
Your OS isn't relevant to the test. You can run bash, PowerShell, and the required tools on Windows or Linux. You need bash or a compatible shell only if you want to copy/paste all the command lines from the document. If you want to use a different shell, reformat the command lines as necessary. |
Hi @chlowell, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
@joshfree This issue has been closed. Do we need to continue testing this |
Hi @chlowell , Following above steps, encountered some issues after executing the following command: After ten tests, got the result of ' None' eight times as follows : And got the error logs twice as follows: Could you help to check and resolve the error? |
Tracking issue for step-by-step instructions for how to manually run e2e tests for Azure Container Instances for each of the azure-sdk-for-* languages. This issue will be used by our Vendor team for manually running tests in this scenario, and will be tracked on the EngSys backlog for eventual automation.
The text was updated successfully, but these errors were encountered: