IBM / watson-waste-sorter

Create an iOS phone application that sorts waste into three categories (landfill, recycling, compost) using a Watson Visual Recognition custom classifier
https://developer.ibm.com/patterns/recycle-with-watson/
Apache License 2.0
46 stars 37 forks source link

Fix api-key command and update CLI instructions #18

Closed Tomcli closed 6 years ago

Tomcli commented 6 years ago

The --guid flag no longer return the correct API KEY for visual recognition. Thus Updating the command to parse with awk.

Also adding CLI reference for viewing model status.

scottdangelo commented 6 years ago

We'll see since it is still deploying, but I get this error early in the deploy (which I also got previously):

screen shot 2018-03-01 at 3 31 40 pm
Tomcli commented 6 years ago

Hmm, is your build stage pulling the latest commit?

scottdangelo commented 6 years ago

looks like it is:

screen shot 2018-03-01 at 3 45 53 pm
Tomcli commented 6 years ago

Hmm it works for me. Anyway, I will work on a create_classifier() function in case anyone can't get their API KEY using the cf command

scottdangelo commented 6 years ago

It might be something with the VizRec service. They recycle API keys, so whenever you start a new service you get the same key. Perhaps there's something going on when the toolchain provisions the new service and gets the credential. I've had a similar problem with Watson Natural Language Classifier, and I still haven't solved it. maybe you could put some debug code to print out the api key it gets. It seems I looked at it one of these Deploys, and it was different from the recycled one I keep getting.

scottdangelo commented 6 years ago

Note that I am not using cf to get the API key. I'm using the Deploy to IBM Cloud button.

scottdangelo commented 6 years ago

Perhaps you can try the Deploy to IBM Cloud button and see if that works for you?

Tomcli commented 6 years ago

Yeah, the Deploy to IBM Cloud button use a script that call cf command to get the API KEY

Tomcli commented 6 years ago

and the Deploy to IBM Cloud button works on my account

Tomcli commented 6 years ago

I believe the API KEY under VCAP_SERVICE should always be correct. I will add a condition in the server to create a new waste model when it's not exist.

scottdangelo commented 6 years ago

I don't think there's anything wrong with your code, I think there's a race condition in the deploy pipeline. I might test a couple things in a forked repo. In the mean time, I think we can move on.