Managing your service

With the files copied and the Docker image installed, you can begin to run the service. One of the items installed is the icr command script. This command is used to stop/start the service, update critical parameters used by the service and to uninstall the software if you need to do that. The usage model for the command is as follows:

icr [-a] [-d] [-l] [-v] [-vv] [-h] <arg> ? [-c <cmd>]

The options can be combined in a single command. However, the -c <cmd> should always go last since it is used to invoke server operations. We’ll be looking at each option in detail.

icr -a <IP Address>

The -a option is used to provide icr with an IP address for the server. The default IP address for the server is determined using localhost. However, if you are using a cloud-based repository, such as GitHub, there needs to be a way for GitHub to reach the server from the cloud. In that case, you would need to provide a public IP address to allow GitHub to reach the icr server. You must configure icr with the public IP address using this command.

As an example: icr -a 192.1.2.123

icr -d <directory-path>

The -d option is used to anchor icr with the point in your host file system where you plan to store projects for local access. While you may access GitHub, GitLab or Bitbucket to process repositories managed by those systems, you may also want to analyze and review projects resident in your local file system. You can also include directories that may be attached via a network attached storage and mounted into your file system. The default anchor point is the /home directory under which user directories are normally located within Linux.

As an example: icr -d /home/projects

icr -l <license-key>

The -l option is used when there is a need to update or replace your activation license. The license is activated when you first run icr (not when it was installed) and connect to the Navigator for the first time. Should your license become damaged or unusable, this is a way for us to provide you with a new license.

As an example: icr -l GHTG-WK9M-9HSK-J9OR

icr -v

It is sometimes important to know what version of icr software is being run. This command displays the current version of the software.

icr -vv

This is the verbose form of the version command. This command displays the current version of the software along with details about the various components in a particular package. It can be useful of you need to report a problem to Openrefactory.

As an example: icr -vv

@Java@
iCR for Java version 3.5.0
@/Java@@Python@
iCR for Python version 3.5.0
@/Python@@Go@
iCR for Go version 1.0.0
@/Go@
DevOps Release-0.0.1-Go 386cb2aa646b054c2dcb0676afcf07869d516b05
Engine Release-0.0.1 e846a9f90fbad68fc5cec89d81ebc6738acf9355
Navigator-Reviewer iCR-NavRev-1.0.0 aed26d8cf1b011586374f0ededb2c79f6d19d23d
Fixer-List main 59acd7deae7cc83ba6a374a2f999546be2363ec3
Container Release-0.0.1-@Java@Java@/Java@@Python@Python@/Python@@Go@Go@/Go@ f5e033fb0611f5b8dcd733e1e51022784d3e0a16

icr -h / icr ?

Displays the extended usage form for the icr command:

icr [-a] [-d] [-l] [-v] [-vv] [-h] <arg> ? \[-c <cmd>]
   Where:
      -a <IP_ADDRESS>                     # define the server's public IP address
      -d <MOUNT_DIR_PATH>                 # define a new root directory
      -l <LICENSE>                        # change the license key
      -v                                  # output the current version
      -vv                                 # output the current version and more details
      -h                                  # output this help
      ?                                   # output this help
      -c <cmd>
        Where < cmd >:
              start                       # start the service
              stop                        # stop the service
              revert                      # go back to the previous version
              uninstall                   # remove the service and all associated files

icr -c <cmd>

The previous options were used to update or change some configuration values. To actually operate icr you use the -c <cmd> option. There are three specific values that can be used to control your server’s operation:

  1. icr -c start

    This is the command that is used to start the icr server. It assumes that you have successfully installed the service on your host machine using install-icr. It starts the Docker image from scratch. The default passphrase will be used to access the Navigator for the first time. The default string is: icr. You will be prompted to change it once you access the Navigator.

  2. icr -c stop

    The stop command is used to stop the running instance of icr. The Docker container is stopped and any activity in progress is interrupted. For example, if the service is stopped during an analysis, that analysis will be abandoned. All results from previous analyses, however, are still available and can be viewed again once the service is restarted using the start command.

  3. icr -c revert

    The revert command provides you with the capability to fall back to a previous version of icr. After using the sudo ./install script to install a new version of icr, iCR keeps the previous version available for fall back in case there is any reason why the new version may have an issue. Either installing a new version or reverting to the previous version keeps any previous results intact. If there is no previous version, the revert command will have no effect. You would need to use the uninstall command if you want to undo the complete installation.

  4. icr -c uninstall

    There may be cases where you wish to remove icr entirely from your host system. If so, run the uninstall command. This will remove all of the Docker information as well as the directories that were created as part of the install-icr process. All results from analyses will be removed. Please be certain that you want to remove everything if you decide to run this command. If you need to restore icr, and you have kept your original package, you can re-install the service using the sudo ./install-icr command again.

Last updated