Provisioning an offline Content Runtime
It is possible to deploy a Content Runtime on an existing virtual machine with limited or no internet connectivity.
To provision an offline Content Runtime, a virtual machine must exist with a static IP address and the installed operating system in the virtual machine must be one of the supported Linux distributions. In addition, either manually download software prerequisites by using the steps in Download prerequisite software section or install the software prerequisites on the virtual machine before the deployment as described in Pre-install prerequisite software manually.
General steps
-
Optional - Pre-install prerequisite software manually (follow this step if you do not want to use the helper script that is described in Download prerequisite software to download the prerequisite software.)
Deploy a system to host the Content Runtime
For an offline deployment of the Content Runtime, a virtual machine must meet the general infrastructure requirements and the offline template installation requirements.
After your content runtime virtual machine is setup, follow the instructions in Download prerequisite software to download the software prerequisite and make them available during automation, or proceed to Pre-install prerequisite software manually to install the software prerequisite yourself before the offline content runtime deployment.
Download prerequisite software
When you deploy an offline content runtime as described in Deploy an offline Content Runtime, the automation installs all the software prerequisites. But you are required to download the binary and provide the location of the binary during deployment. A set of helper scripts is available in a public GitHub repository to assist you in gathering the supported versions of the required software prerequisites. This helper script downloads the following required software:
- Docker
- Docker Compose
- Chef server
- Chef client
- Chef DK
- CAMC Pattern Manager Docker Image
- CAMC Software Repository Docker Image
Follow the steps to execute the helper script that downloads the required software prerequisites.
- Clone helper repository
bash
git clone https://github.com/IBM-CAMHub-Open/IBM-CAMHub-Open.git
- Execute prereq-downloader.sh
The prereq-downloader.sh
script that is cloned in the previous step can be used to download all software prerequisites for an offline Content Runtime deployment.
bash
cd IBM-CAMHub-Open/bin/prereqDownloader
./prereq-downloader.sh <platform> <platform_version> <optional:release>
Where <platform>
and <platform_version>
are the Linux distribution and version of the virtual machine to which the Content Runtime is being deployed. The optional parameter <release>
provides
a way to obtain the required software for the older versions based on the environment's needs.
For example, downloading requirements for a Content Runtime installation on a virtual machine running Ubuntu 16.04
./prereq-downloader.sh ubuntu 16.04 3.0
If you use Advanced Content Runtime Version 2.6 or higher then use optional release parameter 3.0. Otherwise, use optional release parameter 2.0.
Requirements get downloaded to a folder named prereqs_<platform>_<platform_version>_<release>
which can later be copied to an HTTP server or the target virtual machine.
Known issues and workarounds
-
If the script execution fails with the following error, then you may have encountered a GitHub API rate hit limit:
"No repositories found, possibly the connection to the host https://github.com/IBM-CAMHub-Open failed"
To overcome the rate limit, set the following environment variable and rerun the script:
export CloneWithToken=YOUR_GITHUB_TOKEN@
Note: You must append @ to your GitHub token.
-
If
prereq-downloader.sh
execution fails due to curl auth error, then add--insecure
parameter at the end of the curl.
Copy software to the Content Runtime host system
Copy software from the prereqs_<platform>_<platform_version>_<release>
directory created in the previous step to the system which hosts the Content Runtime.
The file directory where the software is copied is used as input during Content Runtime deployment.
The deployment process requires the IBM-CAMHub-Open.tar
produced in the previous step to be copied to /var/
directory on the system that hosts the Content Runtime.
Alternatively, files can be placed on an accessible HTTP Server. In this case, the HTTP location is used as input to the Content Runtime deployment.
Running on a Chef 12 environment
If a Content Runtime is meant to be deployed using Chef client version 12, a version which is no longer officially supported, a third parameter can be specified when downloading requirements. If the release
parameter is set to 1.0
,
Chef client version 12 is downloaded along with other compatible versions of the requirements.
Load Content Runtime Templates
The Content Runtime templates need to be manually loaded into a Managed services environment that does not have access to github.com.
The recommended path is to first import the Content Runtime templates to a local GitLab or GitHub Enterprise. Content Runtime templates are available in Git repositories downloaded in the previous step and saved in IBM-CAMHub-Open_advanced_content_runtime.tar
.
After the templates are imported to GitLab or GitHub Enterprise, the desired Content Runtime templates can be loaded into Managed services by creating a template in the user interface.
If GitLab or GitHub Enterprise are not available, the script loadContentRuntimeTemplates.sh
in IBM-CAMHub-Open_advanced_content_runtime.tar
can be executed to load the Content Runtime templates into Managed services.
After the Content Runtime templates have been loaded into Managed services, confirm whether they appear in the dropdown under Manage > Content runtimes > Create content runtime.
Deploy an offline Content Runtime
Before you deploy your offline content runtime, make sure your content runtime virtual machine meets all the requirement specified in general infrastructure requirements page and offline template installation requirements section.
-
Select the
Other
Cloud Provider after you click Create content runtime. Name the instance and click Create. -
Provide the information required for establishing a connection with the existing virtual machine, the Docker and Chef settings, and other parameters.
Note: The value for
Chef Client Installation Binaries Path
must be provided. The value must be a local path to the binary without trailing slash. If your chef client binary is in directory /tmp/chef-clients then the value is as follows:/tmp/chef-clients
-
In the section
7. Optional Settings for Offline Installation
, five optional fields are displayed: Docker installation file, Docker Compose installation file, Chef Server installation file, Pattern Manager Docker image location and Software Repository Docker image location. These inputs must be filled out by either providing the file path to the installation binaries or the HTTP location from where they can be downloaded.-
File location: If the installation package has been stored in a location within the system, for example,
docker.deb
saved to/tmp
, the correct input would befile:///tmp/docker.deb
. The full path, including file name, has to be provided. -
HTTP location: Similar to the file location, if the installation package was stored in a server with enabled HTTP access, the correct input would be
http://<server_IP>/path/to/docker.deb
.
-
Optional - Pre-install prerequisite software manually
Instead of using the helper script described in Download prerequisite software, you may choose to download the prerequisite software manually and provide the location of the binary during content runtime
deployment. Alternatively, you may choose to download the prerequisite software manually, install them and during content runtime deployment, leave the section Optional Settings for Offline Installation
empty. The following section
describes the software you need to download in both the cases. After you download or download and installed the listed software, you can follow the steps in Deploy an offline Content Runtime to deploy
the offline content runtime.
Before you proceed, make sure your content runtime virtual machine meets all the requirements specified in general infrastructure requirements page and offline template installation requirements section.
Installation binaries
An internet connection is required to obtain the required software packages. These installation binaries need to either be installed previously on the virtual machine or stored in locations that can be accessed during the deployment. These files are:
These installation binaries need to be downloaded and stored in a location on content runtime virtual machine that can be accessed during the deployment
Docker, Chef Server, Chef DK and Chef Client need to be obtained in a .deb
(Ubuntu) or .rpm
(RHEL/CentOS) format depending on the Linux distribution to which the Content Runtime is deployed. Content runtime deploy has been
validated with Chef Server 12.17.33 and Chef Client 14.0.190.
In addition to the programs mentioned previously, two Docker images from DockerHub need to be manually downloaded from a machine with Docker installed:
Obtaining Docker images
The two docker images can be downloaded from the public DockerHub repository by running the following commands:
bash
$ docker pull ibmcom/camc-pattern-manager:3.0-current
$ docker pull ibmcom/camc-sw-repo:2.0-current
This downloads and installs the Docker images in the current machine, to obtain a file that can be shared with another machine, the docker save
command can be used as follows
bash
$ docker save ibmcom/camc-sw-repo:3.0-current > camc-sw-repo
$ docker save ibmcom/camc-pattern-manager:2.0-current > camc-pattern-manager
This creates two files camc-sw-repo
and camc-pattern-manager
that contains the images.
Offline template deployment installation requirements
The deployment process can handle the installation of the provided .deb
or .rpm
files. However, these packages may have requirements that need to be manually installed before starting the process. These packages can be
installed via apt-get install
or yum install
commands.
Requirements can be obtained from each .deb
installation package by running the following commands:
bash
# Ubuntu
dpkg -I <package>.deb
# Red Hat and CentOS
yum deplist <package>.rpm
Docker installation
Ubuntu:
iptables
init-system-helpers
lsb-base
libapparmor1
libc6
libdevmapper
libltdl7
libseccomp2
libsystemd0
Red Hat and CentOS:
device-mapper-devel
glibc-static
libseccomp
libseccomp-devel
libselinux-devel
libtool-ltdl-devel
selinux-policy
selinux-policy-devel
systemd-devel
Note: You can obtain the selinux related packages if you download container-selinux rpm.