open-horizon / examples

Code examples you can use with Horizon.
Apache License 2.0
40 stars 65 forks source link

Investigate exchangePublishScript with new version of anax #307

Closed t-fine closed 4 years ago

t-fine commented 4 years ago

When Nadim recently went thru the installation process he mentioned to me that he encountered an error when running this script while using the newest version of anax. So I'm going to update and investigate this.

t-fine commented 4 years ago

Nadim's original error:

Creating ibm.cpu2evtstreams_1.4.3_amd64 in the exchange...
Error: bad HTTP code 400 from POST https://icp-console.apps.stlouisblues.os.fyre.ibm.com/ec-exchange/v1/orgs/IBM/services: invalid-input, Unrecognized field "owner" (class com.horizon.exchangeapi.PostPutServiceRequest), not marked as ignorable (15 known properties: "sharable", "deployment", "imageStore", "public", "matchHardware", "url", "deploymentSignature", "label", "arch", "version", "documentation", "description", "requiredServices", "userInput", "jsonFormats"])
 at [Source: (String)"{"owner":"","label":"ibm.cpu2evtstreams for amd64","description":"Sample Horizon service that repeatedly reads the CPU load and GPS location, and sends it to IBM Event Streams","documentation":"https://github.com/open-horizon/examples/blob/master/edge/evtstreams/cpu2evtstreams/README.md","public":true,"url":"ibm.cpu2evtstreams","version":"1.4.3","arch":"amd64","sharable":"multiple","matchHardware":null,"requiredServices":[{"url":"ibm.cpu","org":"IBM","versionRange":"[0.0.0,INFINITY)","arch":"amd"[truncated 2259 chars]; line: 1, column: 2760] (through reference chain: com.horizon.exchangeapi.PostPutServiceRequest["owner"])
Makefile:71: recipe for target 'publish-service-overwrite' failed
make[1]: *** [publish-service-overwrite] Error 5
t-fine commented 4 years ago

Running these versions:

horizon: 2.25.1
exchange: 2.15.0

I did not encounter the error Nadim hit with my initial test:

Troys-MacBook-Pro:release4.1 troyfine$ ./exchangePublishScript.sh 
fatal: destination path 'examples' already exists and is not an empty directory.
/Users/troyfine/Desktop/policyPublishTest/release4.1/examples/edge/services/helloworld
hzn exchange service publish -O -P -f horizon/service.definition.json
Checking private key file format ... 
Verifying public key file ... 
Signing service...
Pulling openhorizon/troy.test.helloworld_amd64:0.2.2...
0.2.2: Pulling from openhorizon/troy.test.helloworld_amd64
Digest: sha256:4ee6644ea4a4350c59a57d5da1153837aa43b1bd0b82b702fd1713ca438d19e6
Status: Image is up to date for openhorizon/troy.test.helloworld_amd64:0.2.2
Using 'openhorizon/troy.test.helloworld_amd64@sha256:4ee6644ea4a4350c59a57d5da1153837aa43b1bd0b82b702fd1713ca438d19e6' in 'deployment' field instead of 'openhorizon/troy.test.helloworld_amd64:0.2.2'
Updating troy.test.helloworld_0.2.2_amd64 in the exchange...
Storing service.public.pem with the service in the exchange...

No errors were encountered. Removing examples directory...
t-fine commented 4 years ago

Sadiyah confirmed this has been fixed. Closing!