How to deploy MarkLogic docker hub image to Azure Container Instance ACI - azure

MarkLogic publishes its DB to Docker Hub.
I would like to explore how to run ML docker hub images on ACI.
I try to follow below link to do it.
(It works with that Sample Microsoft aci-helloword image deployment. I assume it should also work for ML.)
However I got below error message.
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"InaccessibleImage","message":"The image 'store/marklogicdb/marklogic-server:10.0-8.1-centos-1.0.0-ea2' in container group 'ml-container' is not accessible. Please check the image and registry credential."}]}

The issue is probably with image type. It's free, but since you're required to subscribe, it's not private. Try with private image type and you'll likely need to authenticate against Docker Hub. We have a detailed example at https://github.com/marklogic/marklogic-docker but I'm not sure how you can setup private image access on Azure.

I think Azure Container Instances Linux is based on ubuntu and there are some known limitations. That may be the reason why there are still some compatibility issues of deploying ML docker image to run in ACI.
It is pretty straightforward and cost-effective to follow the below guide to run ML in Azure.
https://www.marklogic.com/resources/deploy-on-azure/
ML regularly update its azure images in the marketplaces.
https://azuremarketplace.microsoft.com/en-in/marketplace/apps/marklogic.marklogic-developer-10?tab=Overview
As a result, there is no significate benefit of enabling ML to run in ACI.

Related

How to get Docker Images from Azure container registry and run onpremise servers using docker-compose?

I am using azure devops for CI/CD pipelines and one thing I couldn't find out, getting images from Azure container registry and run those images inside of my onpremise debian server. (I build and pushed the images to ACR already).
On release pipeline section:
I set Azure Container repository as source type and selected the latest artifact from there
then created a dev stage
Added a Command line tool to execute some scripts on server
-->This is the step where I lost<-- I need somehow to get these image from repository and fire compose up command in the server.
Extra info: you cannot use your docker-compose.yml(which mine is inside of the azure repo in same project) because you are using ACR as source type, not the build itself or source code.
*in my humble opinion this is a good case to enrich a content. Because there is lack of docs and videos on internet.
thanks,

Testing a Deployed container in Kubernetes via python

I have pushed a container to Container registry and am able to deploy it to kubernetes. Whats the best way to run this container to test if the deployment is working fine?
I have gone through the documentation and have seen that I can setup a endpoint but I am unable to figure out how to call the container once I have setup a post request to the endpoint. Note the container hosts a python script that basically runs a ml model and spits out a prediction. So I would like a way to do api calls to the cluster to run the container and a call to print the results of the container.
Or instead of setting a endpoint are there better ways to accomplish this?
• Setting an endpoint to the Kubernetes pod for accessing the container and executing the python script in the container is a good approach.
• As suggested in the Microsoft documentation, there are three options through which we can deploy API management in front of AKS. You can see the same in the picture provided in the document.
https://learn.microsoft.com/en-us/azure/api-management/api-management-kubernetes#kubernetes-services-and-apis
• Once you configure the API with Kubernetes cluster, you can deploy a model to Azure Kubernetes Service cluster, for that, you need to create a deployment configuration that describes the compute resources needed. For example, the number of cores and memory. You also need an inference configuration, which describes the environment needed to host the model and web service. For more information on creating the inference configuration, see how and where to deploy models.
For more information on how you can deploy and reference a python ML model, you can refer to this document below: -
https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-and-where?tabs=azcli

Is there a docker image for running in place of an Azure Event Hub in a Test or CI environments?

Is there docker image for running in place of an Azure Event Hub in a Test or CI environment?
I want to be able to stand up a full stack with mock event hubs running as docker containers, how are people doing this? The only other option I can think of is using ARM templates to stand up and tear down actual cloud infra, which seems a bit wasteful.

Run docker container on azure

I have a simple docker container which runs just fine on my local machine. I was hoping to find an easy checklist how I could publish and run my docker container on Azure, but couldn't find one. I only found https://docs.docker.com/docker-for-azure/, but this document kind of leaves me alone when it comes to actually copy my local docker container to Azure. Isn't that supposed to be very easy? Can anybody point me in the right direction how to do this?
But it is really easy.. once you know where to find the docs :-). I would take the azure docs as a starting point as there are multiple options when it comes to hosting containers in Azure:
If you're looking for this...
Simplify the deployment, management, and operations of Kubernetes -> Azure Container Service (AKS)
Easily run containers on Azure with a single command -> Container Instances
Store and manage container images across all types of Azure deployments
-> Container Registry
Develop microservices and orchestrate containers on Windows or Linux
-> Service Fabric
Deploy web applications on Linux using containers
-> App Service
Based on your info I would suggest storing the image using the Azure Container Registry and host the container using Azure Container Instances. No need for a VM to manage this way.
There is an excellent tutorial you could follow (I skipped the first 1 step since it involves creating a docker image, you already have one)
Another complete guide of pushing your image to azure and create a running container can be found here.
The good thing about Azure Container Instances is that you only pay for what you actually use. The Azure Container Registry is a private image repository hosted in Azure, if course you could also use Docker Hub but using ACR makes it all really simple.
In order to run an image, you simply need to configure a new VM with the Docker Daemon. I personally found Azure's documentation to be pretty complex. Assuming you are not trying to scale your service across instances, I would recommend using docker-machine rather than the Azure guide.
docker-machine is a CLI tool published by the Docker team which automatically installs the Docker Daemon (and all the dependencies) on a host. So all you would need to do is input your Azure subscription and it will automatically create a VM configured appropriately.
In terms of publishing the image, Azure is probably not the right solution. I would recommend one of two things:
Use Docker Hub, which serves as a free hosted Docker image repository. You can simply push images to Docker Hub (or even have them built directly from your Git repository).
Configure a CD tool, such as TravisCI or CircleCI, and use these to build your image and push directly to your deployment.
To run your docker image inside ACI, You can use of Azure Container Registry.
Step0: Create Azure Container Registry
Step1: Include a Dockerfile in your application code
Step2: Build the code along with the Dockerfile with a tag and create a
Docker image ( docker build -t imagename:tag .)
Step3: Push the Docker image to Azure container Registry with a image name and tag.
Step4: Now create a ACI, while creating, choose the image type as private, provide the image name, tag, image registry login server, image registry username, image registry password ( these details can be found under access keys tab inside Azure Container Registry)
Step5: choose running os as linux, in network step you can give an dns name for your ACI, then click on review & create
Step6: once ACI gets created you can go to overview and you can see fqdn, using fqdn you can access your application running inside Azure Container Instance.

Moving existing docker image to Azure

We have an existing docker container which is running an dotnet core website. Requirement is to move this container to Azure and run website over cloud.
All tutorials or Howtos point at creating new docker image.Can someone provide me a link or direction to achieve this requirement.
Just push the image to a docker repository that is accesible externally and pull the image from there. Depending on what you use (vms\webapp\container instances) procedures for pulling will be different. For vm's - regular procedure, for webapps - this for container instances - this

Resources