Deploy an Application to the MobiledgeX Platform
Deploy a container (Application) to the MobiledgeX platform.
Last Modified: 3/23/2020
In this tutorial, you will learn how to:
- Create a Docker image of a sample Application and push the image to the MobiledgeX container registry
- Deploy the newly created Application to a specific cloudlet on the MobiledgeX platform
- Manage and monitor your new Application
Once all the prerequisites are met, follow these simple steps to deploy an application to the MobiledgeX platform.
Step 1: Create your organization and add users
Once you create your MobiledgeX account, create an Organization.
- Log on to the Edge-Cloud Console. The Organizations page opens.
- Click New. The Create new Organization screen opens.
- Populate all the required fields. Required fields are indicated by asterisks.
- Click Create Organization.
- Populate all the required fields, and review your organization to make sure you entered the information correctly.
- From the Organizations page, and under Actions, click Manage on your newly created organization. Upon clicking Manage, submenus appear on the left navigation of the Edge-Cloud Console.
FaceDetectionServer sample app
Step 2: Modify the makefile for the
Once the sampleapps are cloned from the MobiledgeX Github repository, the
Makefile associated with the FaceDetectionServer sample app used for this tutorial must be modified. Once the
Makefile is modified, we will push the file to the MobiledgeX registry. Modifying the
Makefile prepares it as an image to upload to the registry.
- Navigate to the
Makefile for the FaceDetectionServer sample app from this directory:
- Open the
Makefile using any text editor and replace
mobiledgex with the name of the organization you created, as shown in the example below. Note that the
Makefile is case-sensitive, and therefore, ensure the name of your organization is typed in all lower-case.
- Save the
In the preceding step, you will use the same login credentials as your Edge-Cloud Console to access the Docker registry and upload an image of this Application.
FaceDetectionServer sample app to the MobiledgeX registry
Step 3: Upload the
When you create an organization, both Docker and VM registries are generated automatically for you. You will upload an image of your application to its respective registry.
Note: If you run into any module errors, you need to update your submodule using the following commands:
git submodule init
git submodule update
- Login to your Docker registry using the same login credentials as your Edge-Cloud Console login. At the shell prompt, type the following commands:
docker login docker.mobiledgex.net
Username: <type in your username>
Password:<type in your password>
You will see a Login Succeeded message. If you do not see this message, you may have typed in the wrong username and password. Go back and try again.
- From the terminal, navigate to the
- From that directory, run the
make command. This builds, tags, and pushes the image
mobiledgexsdkdemo20:latest to the
docker.mobiledgex.net/<your organization> repository. Please allow a few minutes for the fulfillment of the pushed image. Once the image is pushed to the registry, you may use the Docker Desktop to view your image on the MobiledgeX repository.
- Return to the Edge-Cloud Console.
Step 4: Create an Application Definition
After successfully uploading your application image to the MobiledgeX Docker registry, specify the application definition. This creates an 'inventory' of applications within the Apps page.
- From the Organization page, click Manage on your newly created organization.
- Navigate to the submenu Apps. The Apps page opens.
- Click New. The Settings page opens.
- Populate all required fields.
- Type in facedetection as the name of the Application.
- Specify the App Version as latest.
- Select Kubernetes from the drop-down list for Deployment Type.
- Specify the image path as
organization_name is the name of the organization you created.
- Select x1.medium as the Flavor of the compute instance that this application will be running.
- Use 2 TCP ports: 8008 and 8011
- Click Create. The application appears on the Apps page. You can click on the application to view details.
Step 5: Create a Cluster Instance (
After successfully creating an application, you may create a cluster instance, however, this is an optional step. The cluster instance can also be created automatically during the Create App Instance step by selecting the Auto Cluster instance box.
A cluster instance represents a collection of compute resources on a Cloudlet for deploying your application instance, or containers. For example, you can select a Kubernetes cluster to deploy your pods, or select Docker to deploy your docker containers. Note that some of the required fields should be identical to the information entered for the Application Definition, where applicable.
- From the submenu, select Cluster Instance.
- Click New.
- Select your Region from the drop-down list.
- For Organization Name, select the name of your organization from the drop-down list.
- For Cluster Name, type in a name for your cluster.
- For Operator, select the Operator network you wish to deploy the cluster.
- Select the Cloudlet in which the cluster resides.
- Select your Deployment Type from the drop-down list.
- For Flavor, select the compute substrate.
- Click Create. You can view the provisioning status of your cluster by clicking the Progress icon.
Step 6: Provision your Application
You are now ready to deploy your application onto a cloudlet. This step is called Application Provisioning.
- Navigate to the submenu Apps.
- Under Actions, click Create Instance the quick view menu.
The Create App Instance page opens.
- Select an Operator and Cloudlet from the available lists to deploy your application.
- Select the cluster instance created in Step 5 from the drop-down list, or enable Auto Cluster Instance.
- If you require additional configurations for your application, such as adding environmental variables or including customization files for helm deployments, you can specify these types of configurations by specifying the content of the configuration file in the Config* field, and selecting either envVarsYaml or hemlCustomationYaml.
- Click Create. You can view the progress via the Progress bar. It can take up to a few minutes to deploy your application to the specified cloudlet.
After you've successfully deployed your application, information about your deployed application appears on the App Instances page.
Step 7: Monitor and view Audit Logs
You can view and monitor historical activities made by you, or others, within your organization. Click the submenu Monitoring to view historical activities through a single pane of glass. For more information on monitoring and audit logs, see the Edge-Cloud Console UI Guide for Developers.
Where to Go From Here
Access other tutorials here: Guides and Tutorials