Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Predix Robot committed May 26, 2017
1 parent df3242a commit 0a86bc4
Show file tree
Hide file tree
Showing 39 changed files with 5,124 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/target/
.classpath
.project
.settings/
src/main/resources/static/javadoc/
/.springBeans
1 change: 1 addition & 0 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The dependencies in this project are resolved by Maven pom.xml. Copyrights from those projects are included [here](http://predixdev.github.io/predix-rmd-ref-app/copyright.html). This list may be a superset of projects actually referenced by this project.
64 changes: 64 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
###GE Software Development License Agreement – General Release

THIS SOFTWARE LICENSE AGREEMENT (the “License”) describes the rights granted by the General Electric Company, operating through GE Digital (also referred to as “GE Software”), located at 2623 Camino Ramon, San Ramon, CA 94583 (herein referred to as “Licensor”) to any entity (the “Licensee”) receiving a copy of any of the following GE Digital development materials: Predix DevBox; Predix Reference Application (“RefApp”); Predix Dashboard Seed; Predix Px, Predix Security Service redistributable .jar files; Predix Machine redistributable .jar files; and Predix Machine SDK . These materials may include scripts, compiled code, supporting components, and documentation and are collectively referred to as the “Licensed Programs”. Both Licensor and Licensee are referred to hereinafter as a “Party” and collectively as the “Parties” to this License

### Section 1 – Conditional Grant.
No Licensee is required to accept this License for use of the Licensed Programs. In the absence of a signed license agreement between Licensor and Licensee specifying alternate terms, any use of the Licensed Programs by the Licensee shall be considered acceptance of these terms. The Licensed Programs are copyrighted and are licensed, not sold, to you. If you are not willing to be bound by the terms of this License, do not install, copy or use the Licensed Programs. If you received this software from any source other than the Licensor, your access to the Licensed Programs is NOT permitted under this License, and you must delete the software and any copies from your systems.

###Section 2 – Warranty Disclaimer.
NO WARRANTIES. LICENSOR AND OUR AFFILIATES, RESELLERS, DISTRIBUTORS, AND VENDORS, MAKE NO WARRANTIES, EXPRESS OR IMPLIED, GUARANTEES OR CONDITIONS WITH RESPECT TO USE OF THE LICENSED PROGRAMS. LICENSEE’S USE OF ALL SUCH PROGRAMS ARE AT LICENSEE’S AND CUSTOMERS’ OWN RISK. LICENSOR PROVIDES THE LICENSED PROGRAMS ON AN “AS IS” BASIS “WITH ALL FAULTS” AND “AS AVAILABLE.” LICENSOR DOES NOT GUARANTEE THE ACCURACY OR TIMELINESS OF INFORMATION AVAILABLE FROM, OR PROCESSED BY, THE LICENSED PROGRAMS. TO THE EXTENT PERMITTED UNDER LAW, LICENSOR EXCLUDES ANY IMPLIED WARRANTIES, INCLUDING FOR MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, AND NON-INFRINGEMENT. NO GUARANTEE OF UNINTERRUPTED, TIMELY, SECURE, OR ERROR-FREE OPERATION IS MADE.

THESE LICENSED PROGRAMS MAY BE USED AS PART OF A DEVELOPMENT ENVIRONMENT, AND MAY BE COMBINED WITH OTHER CODE BY END-USERS. LICENSOR IS NOT ABLE TO GUARANTEE THAT THE LICENSED PROGRAMS WILL OPERATE WITHOUT DEFECTS WHEN USED IN COMBINATION WITH END-USER SOFTWARE. LICENSEE IS ADVISED TO SAFEGUARD IMPORTANT DATA, TO USE CAUTION, AND NOT TO RELY IN ANY WAY ON THE CORRECT FUNCTIONING OR PERFORMANCE OF ANY COMBINATION OF END-USER SOFTWARE AND THE LICENSED PROGRAMS AND/OR ACCOMPANYING MATERIALS. LICENSEE IS ADVISED NOT TO USE ANY COMBINATION OF LICENSED PROGRAMS AND END-USER PROVIDED SOFTWARE IN A PRODUCTION ENVIRONMENT WITHOUT PRIOR SUITABILITY AND DEFECT TESTING.

###Section 3 – Feedback.
It is expressly understood, acknowledged and agreed that you may provide GE reasonable suggestions, comments and feedback regarding the Software, including but not limited to usability, bug reports and test results, with respect to Software testing (collectively, "Feedback"). If you provide such Feedback to GE, you shall grant GE the following worldwide, non-exclusive, perpetual, irrevocable, royalty free, fully paid up rights:

a. to make, use, copy, modify, sell, distribute, sub-license, and create derivative works of, the Feedback as part of any product, technology, service, specification or other documentation developed or offered by GE or any of its affiliates (individually and collectively, "GE Products");
b. to publicly perform or display, import, broadcast, transmit, distribute, license, offer to sell, and sell, rent, lease or lend copies of the Feedback (and derivative works thereof) as part of any GE Product;
c. solely with respect to Licensee's copyright and trade secret rights, to sublicense to third parties the foregoing rights, including the right to sublicense to further third parties; and
d. to sublicense to third parties any claims of any patents owned or licensable by Licensee that are necessarily infringed by a third party product, technology or service that uses, interfaces, interoperates or communicates with the Feedback or portion thereof incorporated into a GE Product, technology or service. Further, you represent and warrant that your Feedback is not subject to any license terms that would purport to require GE to comply with any additional obligations with respect to any GE Products that incorporate any Feedback.

###Section 4 – Reserved

###Section 5 – Limitation of Liability.
LIABILITY ARISING UNDER THIS LICENSE, WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), SHALL BE LIMITED TO DIRECT, OBJECTIVELY MEASURABLE DAMAGES. LICENSOR SHALL HAVE NO LIABILITY TO THE OTHER PARTY OR TO ANY THIRD PARTY, FOR ANY INCIDENTAL, PUNITIVE, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LIABILITY FOR ANY SOFTWARE LICENSED FROM THIRD PARTIES FOR USE WITH THE SERVICES IS EXPLICILTLY DISCLAIMED AND LIMITED TO THE MAXIMUM EXTENT PERMITTED BY LAW.

Notwithstanding anything to the contrary, the aggregate liability of Licensor and its suppliers under this License shall not exceed the total amounts paid by Licensee to Licensor hereunder during the one-year period immediately preceding the event which gave rise to the claims.

###Section 6 – License.

A. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants Licensee a worldwide, perpetual, royalty-free, non-exclusive license to:

1. install the Licensed Programs on Licensee’s premises, and permit Licensee’s users to use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging, and production of Licensee’s own software that makes use of the Licensed Programs in a way that adds substantial functionality not present in the Licensed Programs (the result, a “Licensee Application”);

2. permit Licensee to permit third-party hosts (“Hosts”) to install the Licensee Application on such Hosts’ respective premises on Licensee’s behalf, and permit Licensee’s users to access and use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging and production purposes

3. install the Licensee Application on Licensee’s own premises and permit its own users to use the Licensee Application so installed on the same terms as sub-sections (i) and (ii) above.

B. For the purposes of this License, the right to “use” the Licensed Programs shall include the right to utilize, run, access, store, copy, test or display the Licensed Programs. No right or license is granted or agreed to be granted to disassemble or decompile any Licensed Programs furnished in object code form, and Licensee agrees not to engage in any such conduct unless permitted by law. Reverse engineering of Licensed Programs provided in object code form is prohibited, unless such a right is explicitly granted by any explicit license subject to sub-section (d) below or as a matter of law, and then only to the extent explicitly permitted. Licensor shall have no obligation to support any such reverse engineering, any product or derivative of such reverse engineering, or any use of the Licensed Programs with any modified versions of any of their components under this License.

C. Licensee shall ensure that any Licensee Applications incorporate the Licensed Programs in such a way as to prevent third parties (other than Hosts) from viewing the code of the Licensed Programs or gaining access to any programmatic interface or other hidden aspect of the Licensed Programs. Licensee shall also restrict distribution of the Licensed Programs, including as part of Licensee Applications, to only those parties who are notified of, and subject to, an enforceable obligation to refrain from any of the prohibited activities listed herein, such as reverse engineering or disassembling the Licensed Programs.


D. Use of some open source and third party software applications or components included in or accessed through the Licensed Programs may be subject to other terms and conditions found in a separate license agreement, terms of use or “Notice” file located at the download page. The Licensed Programs are accompanied by additional software components solely to enable the Licensed Programs to operate as designed. Licensee is not permitted to use such additional software independently of the Licensed Programs unless Licensee secures a separate license for use from the named vendor. Do not use any third party code unless you agree with the applicable license terms for that code.

E. Title. Title to and ownership of the Licensed Programs shall at all times remain with Licensor.

###Section 7 – Termination.

A) The Licensor reserves the right to cease distribution and grant of further licenses to any or all of the Licensed Programs at any time in its sole discretion.

B) The Licensor reserves the right to at any time and at its sole discretion provide updated versions of any or all of the Licensed Programs that supercede and replace the prior version of that Licensed Program.

C) Your license rights under Section 6 are effective until terminated as described below:

i) This license and all rights under it will terminate or cease to be effective without notice if Licensee breaches the terms of the License and does not correct or remedy such breach promptly.

ii) Notwithstanding the foregoing, Licensee may terminate this License at any time for any reason or no reason by providing the Licensor written notice thereof.

D) Upon any expiration or termination of this License, the rights and licenses granted to you under this License shall immediately terminate, and you shall immediately cease using and delete the Licensed Programs. Licensee Applications based upon the Licensed Programs (see Section 6(a) above) are not subject to this limitation.

In the event of any expiration or termination of this Licensee, any Confidentiality provision, disclaimers of GE’s representations and warranties, choice of applicable law and limitations of GE’s liability shall survive.

###Section 8 – Applicable Law.
The License shall be governed by and interpreted in accordance with the substantive law of the State of California, U.S.A., excluding its conflicts of law provisions, and by the courts of that state.
115 changes: 113 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,113 @@
# kit-service
Backend for Predix Dev Kits
<a href="../../../../pages/adoption/kit-service/javadocs/index.html" target="_blank" >
<img height="50px" width="100px" src="images/javadoc.png" alt="view javadoc"></a>
&nbsp;
<a href="../../../../pages/adoption/kit-service" target="_blank">
<img height="50px" width="100px" src="images/pages.jpg" alt="view github pages">
</a>

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](https://www.predix.io/catalog/other-resources/devbox.html) and launch it in Virtual Box or install the [Dependencies](#dependencies)

1. [Prepare your environment](#preparation) and follow the steps below to get up and running on Cloud Foundry.

1. 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](https://www.eclipse.org/downloads) 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](manifest.yml) which provides properties and instructions for [pushing cloud foundry apps](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html)
```
$ 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](https://github.com/PredixDev/predix-rmd-ref-app/blob/master/docs/proxy.md#proxy), 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](docs/settings.xml) file on your laptop. It should be setup already if in a [DevBox](https://www.predix.io/catalog/other-resources/devbox.html).

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

The best experience is to use a [DevBox](https://www.predix.io/catalog/other-resources/devbox.html) which has all the tools and settings pre-installed.
* In DevBox,
* add your <a href="https://maven.apache.org/guides/mini/guide-encryption.html">encrypted</a> predix.io username and password to the ~/.m2/<a href="https://github.com/PredixDev/predix-rmd-ref-app/blob/master/docs/settings.xml">settings.xml</a>
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](docs/proxy.md) 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](https://www.predix.io/docs/?b=#Uva9INX3) documentation and the [RMD Reference App Dependencies](https://github.com/PredixDev/predix-rmd-ref-app#dependencies).

* add your <a href="https://maven.apache.org/guides/mini/guide-encryption.html">encrypted</a> predix.io username and password to the ~/.m2/<a href="https://github.com/PredixDev/predix-rmd-ref-app/blob/master/docs/settings.xml">settings.xml</a>
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](https://ga-beacon.appspot.com/UA-82773213-1/kit-service/readme?pixel)](https://github.com/PredixDev)
41 changes: 41 additions & 0 deletions config/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#properties for running locally or for unit tests
logging.level.root=INFO
logging.level.org.springframework=INFO
logging.level.org.springframework.security=INFO
logging.level.com.ge.predix.solsvc.kitservice=DEBUG
#<currentworkingdir>/config/application.properties are local ovverrides to src/main/resources(aka classpath)/application.properties
server.port=9092

spring.profiles.active=local,asset

predix.oauth.proxyHost=sjc1intproxy01.crd.ge.com
predix.oauth.proxyPort=8080

predix.oauth.issuerId.url=https://92c10ab6-9ed3-4daf-a1b7-b71207885eb1.predix-uaa-training.run.aws-usw02-pr.ice.predix.io/oauth/token
predix.oauth.clientId=app_client_id:secret
#for debugging purposes, set to a high value
predix.rest.defaultSocketTimeout=500000

springfox.documentation.swagger.v2.path=/
java.docs.url=https://predixdev.github.io/kit-service
accessTokenEndpointUrl=${predix.oauth.issuerId.url}

predix.asset.restHost=predix-asset.run.aws-usw02-pr.ice.predix.io
predix.asset.zoneid=67e1d772-4ed8-4ae7-bf26-1b4351f64cd0

#timeseries details
predix.timeseries.queryUrl=https://time-series-store-predix.run.aws-usw02-pr.ice.predix.io/v1/datapoints
predix.timeseries.zoneid=743e1d4a-e546-4e77-a22c-f775ecf85288
predix.timeseries.websocket.uri=wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages
predix.timeseries.websocket.pool.maxIdle=5
predix.timeseries.websocket.pool.maxActive=5
predix.timeseries.websocket.pool.maxWait=8000

endpoints.beans.enabled=true
endpoints.info.enabled=true

register.device.deactivation=60

kit.webapp.url=https://kit-cloud-poc.run.aws-usw02-pr.ice.predix.io
kit.device.credentials=ZGV2aWNlX2NsaWVudF9pZDpzZWNyZXQ=

Loading

0 comments on commit 0a86bc4

Please sign in to comment.