Build Docker* Containers for MPS and RPS and Deploy to the Cloud¶
The Open AMT Cloud Toolkit provides support for deploying Management Presence Server (MPS) and Remote Provisioning Server (RPS) microservices as Docker* containers to the cloud.
What You'll Do¶
This tutorial explains the steps to deploy MPS and RPS as Docker images to the cloud using Microsoft Azure*:
- Create a Microsoft Azure* subscription.
- Create a Docker Hub account. Supply it with a Docker ID which will be used later.
- Login to the accounts.
- Build and deploy to the cloud.
What You'll Need¶
Hardware¶
Configure a network that includes:
- A development system running Windows® 10 or Ubuntu* 18.04 or newer
- At least one Intel vPro® device to manage
Software¶
Before MPS and RPS installation, install or subscribe to the following software:
-
Microsoft Azure Subscription and Login
Microsoft Azure Configuration Details
- Create a subscription for Microsoft Azure.
- Download Microsoft Azure Command Line Interface (CLI).
- Test the Microsoft Azure CLI login
-
Docker Hub Account Configuration Details
- Creating an account on Docker Hub requires the creation of a unique Docker ID consisting of 4 to 30 lowercase letters and digits. This ID becomes the user namespace for hosted services. The password and Docker ID will be used in the deployment instructions.
- A Docker Hub account enables user access to Docker Hub repositories, forums, support and more.
- See detailed instructions for creating an account here.
-
Docker Configuration Details
- The Docker for Windows installer defaults to enabling and running all the required settings necessary for this tutorial.
- After successful installation, the Docker icon (whale), appears on the task bar.
- To troubleshoot the installation, see the troubleshooting guide.
Login to the Accounts¶
To login:
1. Login to Microsoft Azure with the Azure CLI using the az command. Type the command in a Windows Command Prompt or Azure PowerShell.
az login
This command will invoke the default browser, which displays a login screen.
2. Login to the Docker hub account with the Docker ID and password. [KD: Please place pix here.]
docker login --username [your Docker ID] --password [your Docker Hub Password]
Build the Repositories¶
Build the MPS and RPS Docker images from their respective directories with the build -t command, giving the image a name and tag:
- Create a name and tag with lowercase letters, digits, and separators (i.e., underscores, periods, and dashes).
- Do not end a name or tag with a separator.
- Tags contain up to 128 characters.
Note
Building a fresh Docker image may take several minutes.
To build MPS:
1. Navigate to the MPS folder and build the Docker image. Execute a build and push for MPS.
The docker push command with the -t or --tag option enables the naming and tagging of a build:
docker push -t [docker-id][name:tag]
cd parent directory\mps
docker build . -t f30911230045\mps-microservice:v1
docker push f30911230045\mps-microservice:v1
To build the RPS:
2. Navigate to the RPS folder and build the Docker image. Execute a build and push for RPS.
cd ..\rps
docker build . -t f30911230032\rps-microservice:v1
docker push f30911230032\rps-microservice:v1
Deploy the Images¶
To deploy to the cloud:
1. After building the new MPS and RPS images, navigate to mps\scripts\docker-compose
folder and use xcopy
to copy the .env.template file to .env
.
The environment file .env.template
contains the MPS and RPS environment variables to pass to the Docker engine.
cd mps\scripts\docker-compose
xcopy /Y .env.template .env
Note
Always preserve the .env.template file by copying it to a new file.
2. Set the image-related environment variables within the .env file:
MPS_IMAGE=[name:tag from the build step]
RPS_IMAGE=[name:tag from the build step]
MPS_IMAGE=mps-microservice:v1
RPS_IMAGE=rps-microservice:v2
3. Set the proper proxy values if behind a proxy.
set HTTP_PROXY=http://[your-proxy-server]:[your-proxy-server-port] set HTTPS_PROXY=http://[your-proxy-server]:[your-proxy-server-port]
set HTTP_PROXY=http://10.3.4.52:8080
set HTTPS_PROXY=http://10.3.4.52:8080
Note
If using a private Docker hub, set the password variable: DOCKER_LOGIN_PASSWORD=[your-docker-login-password]
4. Run the oact-stack-azure-vm.bat file. This file:
- Installs the Docker on the Microsoft Azure VM
- Runs the docker-compose up command.
- Copies the .env-template file to .env.
oact-stack-azure-vm.bat [your-solution-name] [region (e.g.,: westus)] [MPS-IMAGE] [RPS-IMAGE]
cd scripts\docker-compose
oact-stack-azure-vm.bat vprodemo westus
5. Log into Sample Web UI:
When running the stack in Azure, there are a few adjustments that need to be made to access the Sample Web UI that are different than the docker deployment. - https needs to be specified in the URL. If using a self-signed certificate, the first time you access the Sample Web UI, this certificate will need to be accepted. - Use the FQDN of the Azure instance for the URL instead of the IP address. - 8443 is the exposed port on the API gateway, so this needs to be appended to the URL.
https://test-instance.westus.azurecontainer.io:8443/
6. Creating CIRA profile:
- When creating the CIRA profile on an Azure deployment, use the FQDN option and fill in the FQDN of the Azure instance.
--insert screenshot here--