GE’s Predix Cloud is an Internet of Things platform that offers powerful data analysis and machine learning services that make it easy to build sophisticated software infrastructure around machinery and IoT devices.
Solano CI integrates smoothly with Predix to give application developers a reliable, high-performance continuous delivery pipeline starting from any Git or Mercurial repo, using the Predix CloudFoundry environment for accurate integration testing, and then deploying into staging or production.
Contents of this guide:
We’ve built an example around the Predix RMD Reference App with the following workflow:
- Compile and run functional tests
- Deploy to isolated CloudFoundry apps to prepare for integration testing
- Run integration tests and environment validation smoke tests, in parallel
- If integration tests and environment validation pass, deploy to production
You can also interact with a live, public build.
You can see a working example in this GitHub repo:
It is built around tooling supplied by the reference app and the standard
npm builders and test runners.
solano.ymlconfiguration file defining the CD pipeline and the commands to run at each step.
- Setup scripting in
- A simple ruby script
bin/generate_propertiesto generate Java properties files that will configure integration tests to use the live-deployed integration testing apps and services. At the moment, the integration tests only run against the
rmd-datasourcecomponent of the reference app, and the property-generator is limited to that component.
- A Selenium-based integration test for the main RMD reference app
You’ll notice that the setup scripting omits any sensitive information, such as CloudFoundry auth tokens, passwords, and Artifactory credentials. These values are stored securely in the Solano CI system using config variables.
For this example, we are using the following repo scoped environment variables:
MV_SETTINGSholds the complete Maven settings XML file containing Artifactory keys (generated by following the Predix Reference App tutorial). It should also be possible to inject only the keys themselves, and leave a template settings XML file in the repo using Maven’s environment variable substitution. We’ll add that refinement in a future revision of our sample repo.
CF_AUTH_CONFIGholds a complete CloudFoundry
config.jsonwith credentials to allow the build to communicate with CF. This file was generated by running
Pipeline Workflow Details¶
This workflow uses Solano CI’s build pipeline functionality. Each step (node in the pipeline graph) uses a
single Solano CI Build Profile to define the commands run in that step.
You can follow along with this configuration in the
file in the sample repo.
The pipeline definition itself is this snippet at the top of the config file:
pipeline: functional: deploy-integrate: - validate: deploy-production - integrate edges: - integrate: deploy-production
First step: functional
Component-by-component functional testing. Each component’s functional tests are automatically executed in parallel in isolated Solano CI worker containers.
npm testfor the RMD UI NodeJS app
- Runs a subset of the Junit tests that can run isolated in a CI worker. These do not depend on set of deployed apps and services in CloudFoundry.
Second step: deploy-integrate
Prepare an integration testing environment in CloudFoundry by using the
installRefApp.py script that comes with the referece app to deploy all of
its components with a special prefix used only by this test workflow.
Third steps: validate and integrate (run by Solano CI in parallel)
The validate step uses the
“validate-only” mode to run its smoke-tests of the integration testing
The integrate step configures the
component to communicate with the deployed reference app (using the
bin/generate_properties script) and runs its integration tests.
It also runs newly written Selenium-based integration tests against the
test app instance. With Solano CI you can now run Selenium browser
tests in parallel against your Predix application.
Final step: deploy-production
If the tests passed against the integration environment, deploy the app to production.
Using This Workflow For Your Own Apps¶
It’s easy to use this workflow for your own apps, and to customize it to suit your team’s needs.
- Copy in the
solano.ymlto replace the sample app’s commands with the commands that you use to compile and test your app. Pay specific attention to the
You can also add or remove steps by editing the
sections - make sure that you add a corresponding entry under
if you add to the pipeline graph.