Open Arash-Sabet opened 7 months ago
I have never used Azurite therefore I am not able to help you unfortunately.
@WolfgangOfner Anything else similar to running another application within the docker image that you may have worked?
You can have multiple applications running inside a docker container, for example with a script starting them, but I have never done that. For my integration tests, I usually use real Azure resources. I create them before the test starts and delete them after the test is finished.
You can have multiple applications running inside a docker container, for example with a script starting them, but I have never done that. For my integration tests, I usually use real Azure resources. I create them before the test starts and delete them after the test is finished.
Yes, using azure resources is another approach too but we want to contain everything in the docker image to avoid creating expensive databases on cloud. Having another database within the image is another goal to achieve but communicating with it keeps failing likely due to the same reason as the communication with Azurite does. So, I picked a less complex application like Azurite in the code snippet.
You could run a second container with your database or azurite in your pipeline. Take a look at: https://devblogs.microsoft.com/devops/using-containerized-services-in-your-pipeline
Thanks @WolfgangOfner I'll have a look.
@WolfgangOfner Finally I managed to run Azurite in the docker image and the integration tests requiring Azurite can access it and started passing. This is the script snippet for that:
RUN sudo azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 -s -l /usr/local/lib/node_modules/azurite -d /usr/local/lib/node_modules/azurite/debug.log &
This success happens when the docker image runs on a local machine (e.g. my laptop) and connected to the build agent. The strange thing is that the azurite's instance is no longer accessible when the image is pushed to the ACR and pulled by the k8s cluster. Hence, the integration tests requiring azurite has started failing. I monitored the events through the k8s Event blade on Azure's portal and realized that the updated images were pulled successfully. Any idea why it happens on k8s?
Hmm no idea why it does not work in k8s. Do you get any error messages?
Connection refused to "host.docker.internal:10000". I changed it to 127.0.0.1:10000 but no luck either.
Where is the port 10000 coming from? You could try to allow all ports using the following command:
--blobPort 0 --queuePort 0 --tablePort 0
Where is the port 10000 coming from? You could try to allow all ports using the following command:
--blobPort 0 --queuePort 0 --tablePort 0
The ports are 10000, 10001 and 10002 by default if one elects not to specify them.
I have a feeling that azurite never launches! It's a difficult situation to address!
Hi @WolfgangOfner
I read through your article about the keda agent and I have to say that it was amazing! Thanks for sharing it.
We have an integration test project running as a part of our Azure DevOps' pipeline that uses azurite to run a few tests. So, I modified the docker yaml file to include azurite in the image. Here it is the script to achieve this goal:
The image is built and run successfully and it does not exhibit a problem but the integration tests fail due to the error message below:
Apparently the azurite instance is not launched or its port is unavailable within the docker. Hard to tell which one is happening. Just wondering, do you happen to have a solution or advice to address this issue? Thanks.