apiconnect-init-datapower-gateway
v1.0.3
Published
This package automates the building of the `ibm-apiconnect-toolkit/datapower-*` Docker images. While, this can also be accomplished by running `apic start` in an API Connect project that defines an API configured to run with `datapower-gateway`, this app
Downloads
84
Readme
apiconnect-init-datapower-gateway
This package automates the building of the ibm-apiconnect-toolkit/datapower-*
Docker images. While, this can also be
accomplished by running apic start
in an API Connect project that defines an API configured to run with datapower-gateway
,
this approach has several advantages:
User experience: Because of the underlying implementation of
apic start
, the initial build phase is not visible to the user. While it is usually preferable to not expose users to the interal machinations of a process, the build phase's duration in unreasonably long. Especially when downloading the DataPower Docker images. Becauseapic start
does not provide any feedback to the user, it can give users the impression that it has frozen when, in reality, it is silently progressing.Less cryptic failures: Because we are not obscuring the output of the build operations, it is much easier to determine what is causing failures
Installation
npm install -g apiconnect-init-datapower-gateway
Usage
Build options
Once installation is complete, the package can be executed with the apic-init-dp
command. There are three optional
build types:
v5
-- Install and build the current API Connect v5 gatewayFor example:
apic-init-dp v5
experimental
-- Install and build the experimental preview of the API Connect reboot gateway
For example:
apic-init-dp experimental
all
-- Install and build both the v5 and experimental gatewaysFor example:
apic-init-dp all
This is equivalent to using both
v5
and theexperimental
flags:# Same thing as `apic-init-dp all` apic-init-dp v5 experimental
The default behavior (i.e., running without any options) is equivalent to
apic-init-dp v5
System validation
By default, apic-init-dp
will perform a platform-specific system validation before attempting to download and build
any Docker images. This essentially amounts to checking that the correct versions of Docker and docker-compose
are
installed and that Docker has enough resources to run the DataPower images.
If validation fails, apic-init-dp
immediately halts, and an explanation is printed on the screen, along with
platform-specific instructions for resolving the issue.
If you wish to skip the validation step, run with the --no-validation
flag. For example:
apic-init-dp all --no-validation
Alternatively, if you wish to run with validation failures printed, but without halting the script, run with the
--warn-validation
flag. For example:
apic-init-dp all --warn-validation
A couple things to keep in mind:
If validation errors are ignored, the actual initialization steps may fail for the same reasons that validation failed, but with less helpful information.
--no-validation
takes precedence over--warn-validation
. Thus,apic-init-dp all --no-validation --warn-validation
is equivalent to
apic-init-dp all --no-validation
Uninstallation
Once you have installed the images, feel free to uninstall apic-init-dp
:
npm uninstall -g apiconnect-init-datapower-gateway
Future Work
- Container reachability network tests: We have observed, on Linux systems with marginally unconventional network settings, containers may not be able to establish connections with open ports on the host system. We would like to add several simple tests with network connections to and from containers, which would run before actually installing the DataPower images.