/kit-service

Backend for Predix Dev Kits

Primary LanguageJavaOtherNOASSERTION

view javadoc   view github pages

Kit Service

Kit Service is the back-end microservice that provides the rest end points to register device, get device, get device configurations.

Kit Service

##To Download and Push Kit Service

  1. Download a DevBox and launch it in Virtual Box or install the Dependencies

  2. Prepare your environment and follow the steps below to get up and running on Cloud Foundry.

  3. Download the project

$ git clone https://github.com/PredixDev/predix-kit.git  

$ cd predix-kit

$ mvn clean package  

  note: mvn clean install may run integration tests against services you may not have set up yet
  1. To load in eclipse (you may skip to 'Push to Cloud' if desired)

Vanilla Eclipse or [Eclipse STS - Springsource Tool Suite(https://spring.io/tools/sts/all) are both supported

$ mvn eclipse:clean eclipse:eclipse  

File/Import/General/Existing Projects/Browse to predix-microservice-cf dir  

Check the box 'Search for nested projects'  
  1. Try it out locally
in Eclipse - Right Click predix-kit project / Run As / Application 
in Eclise STS - Right Click predix-kit project / Run As / Spring Boot Application 

Visit service at http://localhost:9092 - this page provides health check, swagger documentation and Java documentation links.
Visit service at http://localhost:9092/device - with Authorization Header
This endpoint checks the token for application-scope to determine application specific scope authorization to allow users to register the device and model the device with Predix Asset service.

  1. Push to cloud

    Take a look at the kit-service manifest.yml which provides properties and instructions for pushing cloud foundry apps

$ cf push  

visit http://(cloud-url-here)/api/health - get the url from the output of cf push  

##Troubleshooting If you encounter a github acct/password issue then contact predixgithubaccount@ge.com.

If you encounter a corporate proxy issue, you might need to set up your env vars as required by your IT department.

If you encounter a maven or artifactory account issue, add your predix.io username and encrypted password to a maven ~/.m2/settings.xml file on your laptop. It should be setup already if in a DevBox.

##Preparation Predix Kit service accesses code repos at https://github.com/PredixDev.

The best experience is to use a DevBox which has all the tools and settings pre-installed.

  • In DevBox,

    • add your encrypted predix.io username and password to the ~/.m2/settings.xml by replacing predixuser@ge.com with your Predix.io user and pass.

    • to avoid entering user/pass several times, run this command to cache it

      git config --replace-all --global credential.helper 'cache --timeout=7200'
      
    • OSX: To enable Copy/Paste using Left Command key.

        On Host: Please choose VirtualBox/Preferences/Input/Virtual Machine/Host Key Combination.  
        Set to Right ⌘.  
        On VM: Choose System/Preference/Keyboard/Layouts/Layout Options/Alt/Win Key Behavior/Ctrl is mapped to Win Keys(and the usual Ctrl keys)
      

    We have a second DevBox for GE employees which helps with corporate proxy settings.

    In your own IT environment you may need to configure the proxy settings Environment variables within the VM or your own laptop.

  • For non-DevBox users,
    For users wanting to install all the tools, please reference the DevBox settings, and also ensure you have the prerequisites installed from Predix.io Getting Started documentation and the RMD Reference App Dependencies.

    • add your encrypted predix.io username and password to the ~/.m2/settings.xml by replacing predixuser@ge.com with your Predix.io user and pass.

    • to avoid entering user/pass several times, run this command to cache it

      git config --global credential.helper cache --timeout=7200
      

##Dependencies If you are not using DevBox, ensure your development environment is configured with the tools listed here.

Required Version Note
Java 8
GitHub Acct n/a logged in
Git latest
Maven latest https://artifactory.predix.io/artifactory/PREDIX-EXT
CloudFoundry ClI 6.12.2 https://github.com/cloudfoundry/cli/tree/v6.12.2#downloads. There is bug on this page, so you have to manually get the URL and the add "&version=6.12.2". For example for Windows32 it would look like this...https://cli.run.pivotal.io/stable?release=windows32&source=github&version=6.12.2

Analytics