azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

MQ: Update Identity tests for Azure Pod

Open v-jiaodi opened this issue 3 years ago • 16 comments

Describe the issue: Test the Testing azure-identity in Azure Pod with instructions (Repro steps) . When run the kubectl logs -f test-xxx command, it displays the error :

image

In addition, this issue also occurs in other sdk ( python, go, js). We don't file duplicate isssues under other repo.

Environment: Env: Azure Pod Package: https://search.maven.org/artifact/com.azure/azure-identity/1.7.0-beta.2/jar Related issue: https://github.com/Azure/azure-sdk/issues/814

Expected behavior: Run the kubectl logs -f test-xxx. expected the logs output test pass.

@josefree for notification.

v-jiaodi avatar Oct 28 '22 11:10 v-jiaodi

@chlowell could you please assist here as this is the same failure for all languages, and @v-jiaodi only opened the 1 tracking issue in the java repo

joshfree avatar Oct 31 '22 17:10 joshfree

It isn't unusual to see that error for a short period of time immediately after launching the pod, because the pod does take at least a few seconds to initialize. If it's still initializing after a couple of minutes though, the pod could be stuck. If you do have a stuck pod, can you please share the output of kubectl describe pods test-xxx for that pod?

chlowell avatar Oct 31 '22 18:10 chlowell

@chlowell The output of kubectl describe pods test-xxx for that pod.

image

v-jiaodi avatar Nov 02 '22 10:11 v-jiaodi

I was able to get the tests to pass for Go, Java, JS, and Python, and along the way I learned the instructions are out of date in several places. Your pod is probably stuck initializing because Pod Identity isn't fully configured.

For Java in particular, the Dockerfile in the instructions needs updating before the test app will build. Let me add what I used here, so it doesn't get lost (thanks @g2vinay):

FROM alpine/git as clone
RUN git clone https://github.com/Azure/azure-sdk-for-java --single-branch --depth 1 /azure-sdk-for-java

FROM maven:3-jdk-8
COPY --from=clone /azure-sdk-for-java /azure-sdk-for-java
WORKDIR /azure-sdk-for-java

RUN mvn clean install -Dgpg.skip -DskipTests -f eng/code-quality-reports/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -f common/perf-test-core/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core-test/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core-http-netty/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/identity/azure-identity/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-secrets/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-keys/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-certificates/pom.xml

CMD [ "mvn", "test", "-Dtest=ManagedIdentityCredentialLiveTest#testMSIEndpoint*", "-f", "sdk/e2e/pom.xml", "-Dgpg.skip", "-am", "-DfailIfNoTests=false" ]

I'll leave this issue open pending updates to the instructions.

chlowell avatar Nov 04 '22 18:11 chlowell

Moving milestone and updating title to match what the work item is now tracking

joshfree avatar Nov 07 '22 18:11 joshfree

@chlowell , I updated the Dockfile as described above and retested. First of all, it takes too long ( about 46855s ) to build the docker image. Is this normal? image Even so, the same error finally occurred: image

Output of kubectl describe pods test-xxx for that pod as follow: image

v-jiaodi avatar Nov 08 '22 09:11 v-jiaodi

This image is large and slow to build. It could be more efficient, but the top priority was getting the tests to run. I did that, and the tests passed. The Dockerfile wasn't the only problem. The deployment instructions in the linked issue are (still) out of date, so following them doesn't produce a working test environment. AKS docs have better deployment instructions, and Pod Identity docs have a helpful troubleshooting guide. To be clear though, I don't think it's necessary to run the tests again at this time.

chlowell avatar Nov 08 '22 16:11 chlowell

@chlowell ,Please help update the test instructions:https://github.com/Azure/azure-sdk/issues/814#issuecomment-568112609.

v-jiaodi avatar Nov 10 '22 07:11 v-jiaodi

@jianghaolu , @jntrnr and @catalinaperalta, For testing azure identity in azure Pod, the current test instructions are out of date, please help update the test instructions. Related issue: https://github.com/Azure/azure-sdk/issues/814 About python language, @pvaneck has opened a PR to update: https://github.com/Azure/azure-sdk-for-python/pull/27585.

v-jiaodi avatar Nov 18 '22 08:11 v-jiaodi

@joshfree For testing azure identity in azure Pod, python language has updated test instruction, but the test instructions in other languages are still outdated. Can you help contact relevant personnel to update them?

v-jiaodi avatar Dec 01 '22 06:12 v-jiaodi

@joshfree, @jianghaolu For testing azure identity in azure pods, the test instructions for other languages (except python) are outdated. Could you please contact the relevant people to update it? Thanks in advance.

v-xuto avatar Mar 10 '23 09:03 v-xuto

In the Azure Identity SDK RC Test Pass for May 2023, this issue still exists for Java, go, js.

  • java identity version: https://github.com/Azure/azure-sdk-for-java/tree/7d20dd9e7cebafad7503d1e17fe31f70b7d14b44/sdk/identity/azure-identity
  • go identity version: v1.3.0-beta.5.0.20230425151240-402376456ba8
  • Js identity version: @azure/[email protected]

@joshfree, @billwert , @chlowell , @KarishmaGhiya Could you help check it?

v-jiaodi avatar May 09 '23 07:05 v-jiaodi

Hi @v-jiaodi I will take a look at this soon (probably next week.)

billwert avatar May 24 '23 22:05 billwert

Adding this to the Azure Identity SDK Improvements github project so it's tracked better

joshfree avatar Aug 24 '23 18:08 joshfree

Updated Java docker instructions.

g2vinay avatar Jan 03 '24 18:01 g2vinay

Updated Java docker instructions.

@g2vinay , I retested based on your updated Java docker instructions, the same issue can still be reproduced: image Output of kubectl describe pods test-xxx for that pod as follow: image

zhangjiale-64 avatar Jan 19 '24 06:01 zhangjiale-64

Hi @v-jiaodi, we deeply appreciate your input into this project. Regrettably, this issue has remained unresolved for over 2 years and inactive for 30 days, 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.

github-actions[bot] avatar Nov 18 '24 18:11 github-actions[bot]