MidVision RapidDeploy on Docker on AWS

Amazon EC2 Installation guide

1. Overview

This guide will provide step by step instructions on how to start using the installed products on your AWS EC2 instance.

This AMI comes with Docker installed and a running RapidDeploy container. In order to use this image, you need to launch it with your selected type. MidVision RapidDeploy will be launched automatically during startup and you just need to log in to the web console from your browser after the initial launching.

Visit the MidVision RapidDeploy Cloud Edition page on the AWS Marketplace

2. Launching an instance

In order to launch MidVision RapidDeploy, a few settings need to be configured on the AWS console as follows. The instructions for launching an instance differ depending on where you launch it from. Initially you will launch the instance from the AWS Marketplace.

 3. Initial login and setup

It is necessary to log into the EC2 instance to get the MidVision RapidDeploy server on Docker up and running. Most of the steps are automatic, but here are all of them described as to get a better understanding of what’s happening.

Once the instance has started up (you can see this by having the “2/2 checks passed” status check in the EC2 console):

3.1 Log onto the instance

You can do this from the EC2 console or via SSH as the ‘midvision’ user using the key you selected at instance creation.

  • From the EC2 console by clicking  the “Connect to your instance” button with the username “midvision“, using the previously selected (at instance launch time) .pem key file.

  • Via SSH from your desktop application or from your terminal. Here’s an example:

ssh -i /home/midvision/keys/MidVisionUSMC.pem midvision@ec2-52-87-198-23.compute-1.amazonaws.com

3.2 The MidVision-Cloud welcome banner

After you log into the instance you’ll be able to see the following output:

Welcome to                                                                                                                                             
 __  __ _     ___     ___     _                    ____ _                 _ 
|  \/  (_) __| \ \   / (_)___(_) ___  _ __        / ___| | ___  _   _  __| |
| |\/| | |/ _` |\ \ / /| / __| |/ _ \| '_ \ _____| |   | |/ _ \| | | |/ _` |
| |  | | | (_| | \ V / | \__ \ | (_) | | | |_____| |___| | (_) | |_| | (_| |
|_|  |_|_|\__,_|  \_/  |_|___/_|\___/|_| |_|      \____|_|\___/ \__,_|\__,_|
A MidVision Service

* WebSite: https://www.midvisioncloud.com/product-category/amazon-web-services-marketplace
* Support: http://support.midvision.com/redmine/projects/devtestcloud
* Forum: https://www.midvisioncloud.com/community

Welcome, this is the MidVisionCloud RapidDeploy on Docker image first run configuration.

3.3 Docker upgrade

This AMI comes with the latest stable version of Docker that was available in the repository at AMI creation time, which is “3:18.09.1-3.el7”, but you will be given the option to upgrade to the latest available stable version at current time when you create the instance:

   - Upgrade Docker

Do you want to upgrade Docker to the latest available verion in the repository? [y/n]
y
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
Docker CE Stable - x86_64 84 kB/s | 3.8 kB 00:00
Red Hat Update Infrastructure 3 Client Configuration Server 8 27 kB/s | 2.1 kB 00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs) 25 kB/s | 2.8 kB 00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs) 22 kB/s | 2.4 kB 00:00
Installed Packages
docker-ce.x86_64 3:18.09.1-3.el7 @docker-ce-stable
Available Packages
docker-ce.x86_64 3:19.03.13-3.el8 docker-ce-stable
Last metadata expiration check: 0:00:05 ago on Thu 24 Sep 2020 08:04:54 UTC.
Dependencies resolved.
============================================================================================================================================================================================================
Package Architecture Version Repository Size
============================================================================================================================================================================================================
Upgrading:
containerd.io x86_64 1.3.7-3.1.el8 docker-ce-stable 29 M
docker-ce x86_64 3:19.03.13-3.el8 docker-ce-stable 24 M

Transaction Summary
============================================================================================================================================================================================================
Upgrade 2 Packages

Total download size: 53 M
Downloading Packages:
(1/2): docker-ce-19.03.13-3.el8.x86_64.rpm 47 MB/s | 24 MB 00:00
(2/2): containerd.io-1.3.7-3.1.el8.x86_64.rpm 43 MB/s | 29 MB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 78 MB/s | 53 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: containerd.io-1.3.7-3.1.el8.x86_64 1/1
Upgrading : containerd.io-1.3.7-3.1.el8.x86_64 1/4
Running scriptlet: containerd.io-1.3.7-3.1.el8.x86_64 1/4
Upgrading : docker-ce-3:19.03.13-3.el8.x86_64 2/4
Running scriptlet: docker-ce-3:19.03.13-3.el8.x86_64 2/4
Running scriptlet: docker-ce-3:18.09.1-3.el7.x86_64 3/4
/usr/bin/dockerd has not been configured as an alternative for dockerd

Cleanup : docker-ce-3:18.09.1-3.el7.x86_64 3/4
Running scriptlet: docker-ce-3:18.09.1-3.el7.x86_64 3/4
Running scriptlet: containerd.io-1.2.0-3.el7.x86_64 4/4
Cleanup : containerd.io-1.2.0-3.el7.x86_64 4/4
Running scriptlet: containerd.io-1.2.0-3.el7.x86_64 4/4
Verifying : containerd.io-1.3.7-3.1.el8.x86_64 1/4
Verifying : containerd.io-1.2.0-3.el7.x86_64 2/4
Verifying : docker-ce-3:19.03.13-3.el8.x86_64 3/4
Verifying : docker-ce-3:18.09.1-3.el7.x86_64 4/4

Upgraded:
containerd.io-1.3.7-3.1.el8.x86_64 docker-ce-3:19.03.13-3.el8.x86_64

Complete!
Docker version 19.03.13, build 4484c46d9d

3.4 Upgrading the RapidDeploy container

The AMI comes with the latest version of RapidDeploy available at AMI creation time, which is RapidDeploy 5.0.23, but you will be given the option to upgrade to the latest available version of RapidDeploy in the Docker Hub:

  - Upgrade the RapidDeploy image and run a new container

Do you want to upgrade the RapidDeploy image and run a new container? [y/n]
y
Upgrading to the latest version available of RapidDeploy in Docker Hub, please wait...

Using default tag: latest
latest: Pulling from midvision/rd
Digest: sha256:d4673dec078909d929def59ccb53849d087f492762004edf125f3f1e16b7b761
Status: Image is up to date for midvision/rd:latest
docker.io/midvision/rd:latest
midvision_rapiddeploy
9ca7c381f35317abaa9d5514480b8ff979dacf59dc238dbe1037018605f67a80

3.5 RapidDeploy default password setting

Now you’ll be required to enter the default RapidDeploy user ‘mvadmin‘ password:

  - Set RapidDeploy framework initial password.

Configuring password for RapidDeploy default user 'mvadmin'.
Set password for user 'mvadmin'. Submit blank for default value of the instance ID: i-04b0770c1c90ba16f

If everything goes fine you should see something like the following:

Setting RapidDeploy password for user 'mvadmin'...
<html><head><title>changePasswd</title><link href="http://localhost:9090/MidVision/ui/javax.faces.resource/components.css?ln=primefaces" rel="stylesheet" type="text/css" /></head><body><div style="border-bottom: 0.1em solid black; display: block; height: 30px; margin-bottom: 1em; margin-top: 0.5em; position: relative; width: 100%;"><h2>changePasswd</h2></div><div class="ui-messages ui-widget" aria-live="polite"><div class="ui-messages-info ui-corner-all"><ul><li><span class="ui-messages-info-summary">Change password</span><br/><span class="ui-messages-info-detail">SUCCESS: The password has been changed.</span></li></ul></div></div></body></html>

3.6 Open RHEL firewall

And finally you’ll be asked if you want to open the default port for RapidDeploy, ‘ 9090‘, I recommend to do so to be able to access the RapidDeploy web console later on:

  - Open ports on RHEL firewall.

Open firewall port for RapidDeploy (default port 9090) [y/n]?
y
Open firewall port 9090
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

3.7 Final message

If all the steps went through correctly now you’ll be able to see a message confirming this and showing you the URL you can use to connect to the RapidDeploy web console:

  - Configuration finished, you may now start using the RapidDeploy services on the following URL:

http://ec2-52-91-200-29.compute-1.amazonaws.com:9090/MidVision

4. Accessing the web console

4.1 Access the RapidDeploy Web Console

RapidDeploy server and agent will start up automatically when you start your instance. You can access the web console on:

http://[publicip]:9090/MidVision

Note: make sure you have port 9090 open in the Security Group associated to your instance when trying to access the RapidDeploy web console. For the first time, you can set the password for the default username ” mvadmin “.

You can prevent auto starting RapidDeploy on instance startup by removing it from the ‘Systemd’ services list:

[midvision@ip-10-47-171-208 ~]$ sudo systemctl disable rapiddeploy

5. Maintaining the installation

The following sections cover some of the activities you might want to perform after the instance has been started.
  • midvision: This is the default user, which you can log in as. It is permitted to use all SUDO rights. To switch to the root user, type “sudo su“.
  • root: This is the superuser in Linux systems. You can log in as any other user without using passwords. E.g: “su ec2-user“, “su midvision“.
  • ec2-user: This user does not have SUDO rights. If you want to switch back to root user, type “exit“, this will take you back to the previous user session.

RHEL instances are shipped with a firewall by default to protect your machine. For security reasons, the instance is only accessible via SSH (port 22) at first, so further ports can be opened on the firewall as needed. You will need to open all the ports in this internal firewall that you have open in your Security Group. There is a script placed in the home folder for the ‘midvision’ user (/home/midvision) which is also the starting location when logged in. You will need to be the root user to run this script. Example usage:

[midvision@ ] sudo ./open-firewall.sh 9090
Open firewall port 9090 iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

To start, stop, or restart RapidDeploy manually from the command line interface you can use the ‘rapiddeploy‘ Linux service running one of the following commands:

[midvision@ip-10-47-171-208 ~]$ sudo systemctl start rapiddeploy
[midvision@ip-10-47-171-208 ~]$ sudo systemctl stop rapiddeploy
[midvision@ip-10-47-171-208 ~]$ sudo systemctl restart rapiddeploy

The RapidDeploy server uses an in-memory database, so your RapidDeploy framework needs to be shut down properly to save your work. This happens when the instance is stopping or by stopping the service manually from the command line interface. Note that on instance restart, unsaved data will be lost.

For security reasons, you will need to change the default password (the default value is ‘mvadmin‘) for user ‘mvadmin‘. This will be requested the first time you log in to the RapidDeploy instance. If you don’t specify any value during this process, the ‘[instance-id]‘ value will be set for the ‘mvadmin‘ user.

There are a few scripts and other files in the ‘midvision’ and ‘root’ users home directories that will need to remain unchanged in order to keep the provided scripts working.

There are a set of scripts in the ‘midvision’ home folder that are executed when logging into the instance for the first time that are controlled by the .bash_profile file.

There are some hidden files used as well: the .firstrun file indicates that the setup wizard has already ran for the first time and should not be removed in order to avoid unknown behaviour.

6. Troubleshooting

6.1 Session loss during setup

If you lose your SSH connection to the target instance during the first run setup script execution (e.g. as a result of a network problem), we advise you to delete and recreate the EC2 instance and let the initial configuration script run again.

6.2 Contacting MidVision support

Please visit our support website.