Installing iCR

It is quick and easy to get going on analyzing and automatically correcting programming errors in your projects. With your iCR subscription (either paid or a Test Drive trial subscription), you will have been sent a message with a script file (extract_icr_pkg) that will manage the installation of iCR. The script will use DockerHub to extract all needed files.

The message also included your license file (license.json). Your license will enable iCR to execute on any platform upon which it has been installed. The license manages usage through tracking consumption. If more than one platform is running iCR, they can share the license and the total consumption will be reduced as the analyses complete.

Your license is enabled for a period of time and for a maximum number of OpenRefactory Bundled Lines of Code (OBLoCs). OBLoCs consist of only those executable lines of code that are actually used in the analysis. This means that whitespace and most comments are NOT counted against your licensed capacity. To get an estimate of a project’s OBLoC count, you can use the Linux utility cloc.

NOTE: Should you exhaust your OBLoC capacity, iCR will not be able to continue. In this case contact OpenRefactory to learn how to extend your license.

The iCR framework is designed to operate within a Docker environment. Docker allows you to install packages like iCR on your private Linux platform and know that it will be protected from other software on your system and your network. If you need to install Docker, please refer to the Docker installation instructions which can be found here: https://docs.docker.com/engine/install/.

NOTE: Once Docker is installed, you will want to follow the common practice of creating a User Group to allow Docker access without requiring root privileges for each user. To learn how to do that, please refer to this Docker post-install information. These instructions assume that you have done that so executing the icr commands will not require typing sudo before each command invocation.

To begin the installation process, from the command line, choose a directory to use for staging the installation. It can be any user directory. Place the extract_icr_pkg script in that directory along with your your license file (license.json). Make sure the extract_icr_pkg script is executable by using:

sudo chmod +x ./extract_icr_pkg

Then execute the commmand: ./extract_icr_pkg [<local-registry>]

NOTE: Some installations may not permit direct access to DockerHub and use a private DockerHub repository. This allows organizations to scan the containers prior to installing them. If this is the case for your installation, the extact_icr_pkg command takes an optional argument, [<local-registry>], which is the URL to your private DockerHub. Contact OpenRefactory for more information if this is something that you require.

Once extracted, you will see the following files in your installation directory:

  1. EULA_for_iCR

    This is the End-User license which gives you the authority to use the iCR on your private platform. You must have read and accepted this prior to receiving and installing this package.

  2. install-icr

    This is the script used to install the iCR Docker containers onto your host platform;

  3. icr

    This is the command used to manage your server after installation. Use it to start up your iCR service, update configuration values or even remove it from your host server completely;

  4. icr-compose.yml:

    This is a yml script that contains some Docker configuration information. It is used to make the Docker container installation go smoothly;

  5. SBOMs/

    This directory contains the Software Bill of Materials or SBoM files which identify all of the packages included in the iCR software. This is used to let you know what components are being included within the iCR Docker containers. There is one SBOM json file for each container used in iCR.

  6. activation.req, reqgen

    OpenRefactory supports running iCR in certain offline modes where access to the Internet is not permitted. Only some features are available in offline mode. The above files support managing license operation while in offline mode. Should you require running completely independently from the Internet, please contact OpenRefactory for information on what reduced fiunctionality occurs.

With the files extracted, install the iCR containers using the install-icr command. This installation step will require root privileges so MUST be done using sudo. Run the command as follows:

sudo ./install-icr

The install-icr command uses information from the icr-compose.yml file to extract Docker images from DockerHub. For this reason, you MUST be connected to the Internet and be able to reach DockerHub for the installation to complete.

As the installation proceeds you will see a lot of messages from Docker tracking the installation from DockerHub. It should appear similar to the sequence shown below:

~/Unified$ sudo ./install-icr
Docker config found.....
Installation is in progress.....
Try to pull all images...
4.1.1: Pulling from openrefactory/icr-unified-navrev
7593b730c6d2: Pull complete 
4d68c2071e37: Pull complete 
8fe42a16957b: Pull complete 
cce76e601746: Pull complete 
31a78332cc00: Pull complete 
Digest: sha256:fb42f84b6dc73c62d66d9dafc10bc483db937ba8da436174c6fb477fe662b203
Status: Downloaded newer image for openrefactory/icr-unified-navrev:4.1.1
docker.io/openrefactory/icr-unified-navrev:4.1.1
4.1.1: Pulling from openrefactory/icr-java-iso
7593b730c6d2: Already exists 
4548e1c16309: Pull complete 
043762dbe92f: Pull complete 
4f4fb700ef54: Pull complete 
4a93baf02659: Pull complete 
...
Status: Downloaded newer image for openrefactory/icr-worker:4.1.1
docker.io/openrefactory/icr-worker:4.1.1
6.0: Pulling from library/mongo
a8b1c5f80c2d: Pull complete 
6ed08b1245da: Pull complete 
424e77ee1a6d: Pull complete 
fe5b3225781c: Pull complete 
1df517147e11: Pull complete 
a4d7ed74cba0: Pull complete 
4ae88a75ed24: Pull complete 
4138c7eb3b71: Pull complete 
Digest: sha256:091797fed55ae0ba3a15b969bc56aa9ed8a4a90337d414501957f6f07f61b466
Status: Downloaded newer image for mongo:6.0
docker.io/library/mongo:6.0
Installation, Done!
Your current license key: GRZG-9BD9-H8NK-A2OR. To change it, use the command: icr -l <license key>.
Your current host IP in iCR: 0.0.0.0. To change it, use the command: icr -a <IP address>.

Once the Docker containers are installed, the installation script also sets up the icr command for you so that you can immediately use it to do any other confiuration that may be required.

The examples in the guide will be using Linux as the reference platform. Support for platforms other than Linux will be supported in future releases. All of the installation and configuration shown in this section will be performed from a command line interface. So, your first step would be to SSH into your server and login.

As a check, you can use the docker images command to see the new iCR containers:

~/Unified$ docker images
REPOSITORY                         TAG       IMAGE ID       CREATED        SIZE
openrefactory/icr-unified-navrev   4.1.1     f5359eb7e445   6 hours ago    1.62GB
openrefactory/icr-extract          4.1.1     c14151524758   36 hours ago   175MB
openrefactory/icr-python-iso       4.1.1     f411ce05d881   36 hours ago   2.9GB
openrefactory/icr-java-iso         4.1.1     304fb17e61ce   36 hours ago   1.59GB
openrefactory/icr-worker           4.1.1     e3f67b7bfb44   6 days ago     1.1GB
openrefactory/icr-go-iso           4.1.1     51ad17cc8196   6 days ago     1.19GB
mongo                              6.0       61ffd9d39bd0   4 weeks ago    727MB

Then, refer to the section Managing Your Service to see how to start your iCR service.

Last updated