Another useless IBM Cloud Billing Script …. or not

Recently I have have had a customer ask me some questions about billing on the IBM Cloud. Specifically, they wanted to be able to download their billing information. Now I know that you can do this interactively from the IBM Cloud. You just go to your usage page and hit the little Export CSV button in the upper right-hand corner. This will dump out a CSV file of your current months usage for you.

“That’s nice…..but we want to be able to break down usage and get it into a spreadsheet”, was the response from my customer. “But CSV format IS a spreadsheet”, I thought to myself. So I decided to ask some more questions. It turns out that my customer is interested in AUTOMATING the administration of their IBM Cloud. This means that they want to dump not just one month’s worth of data, but a full 12 months of data into statements that will outline internal chargebacks (based on resource groups), as well as showing visual graphs that summarize usage and spending over the past 12 months.

Now I understood why the “button in the upper right” wasn’t going to work. They wanted some sort of script that would run automatically, to generate all of this content for their IBM Cloud user community. I had wanted to do some work with the Billing and Usage API and Resource Manager API on IBM Cloud, so I decided to script something up for them.

This project also led me to using the Resource Controller API – which is slightly different from the Resource Manager API. The Resource Controller API focuses on the various different service instances (resources) that have been created within an account. The Resource Manager API deals more with the resource groups defined within the account.

Note: If you’re reading this post and serious about doing this sort of automation for your IBM Cloud, PLEASE check out the API links above. It is possible to use different API calls to do more targeted operations – instead of the very broad implementation that I have done.

As usual, I decided to work within Watson Studio, and I decided to write my script in Python. Watson Studio includes some environments that have pre-defined collections of packages – including ones you will depend on like pandas, numpy, and IBM_Watson. It also allows me to run my script up on the IBM Cloud (not on my local machine), version my script, and dump my results to IBM Cloud’s Cloud Object Storage. My goal was to show this customer how to do a dump of just the services with usage (and not EVERY service, since there are many services out there which are on Lite plans). I also wanted to highlight how to get to some of the information available via the Resource Controller API.

I quickly learned that in order to get ALL of the information that I needed, I would need to cross-reference some of the data coming back from these various IBM Cloud API’s. That meant using all of the IBM Cloud API’s mentioned above.

So now I have this Python code all sitting in my new GitHub repository called IBMCloudBillingScript. This script only really does a lot of the same things that the “Export CSV” button does – so this makes this script kind of useless. The reason I built it, and have shared it on GitHub, is because we often want to AUTOMATE things based on this information. This script shows you how to get (and manipulate) this kind of information about your IBM Cloud account.

Finding Custom Models in Watson Discovery

My blog posts often focus on issues that my customers are having – I solve them once for someone and then share that with the wider world in the hopes that someone else may find my guidance useful. This week, I ran into a new issue with a new customer of mine.

My customer was wondering about the use of custom models in their account, and how this impacted their usage of the Watson Discovery service. They were being charged for each custom model used by the Discovery service, but they had no idea of where they were being used. I went and looked in the UI, but found nothing that indicated where custom models had been applied.

So I dug into the API and found out how you can tell. The key is the API call to get-configuration, which returns a JSON payload with information about the configurations in your Discovery instance. Using that information, along with some calls to other API services likelist_collections and list_configurations, you can find out which Discovery collections are using custom models.

Since I had to figure this out for myself, I decided to do some quick and dirty Python code to do this for me, for any given Discovery instance. If you’re interested, you can go and get your own copy of the code out in my GitHub project called Discovery Custom Model Detect. The code is a bit rough, but it gets the job done. Feel free to pretty it up or make it more interactive.

I’m Having an Issue on IBM Cloud Part 2 – What is Happening on the IBM Cloud?

By: Daniel Toczala 

Note: This is the second blog in a series of blogs that I am co-authoring with Paula Williams, as part of an “I have an Issue…” series on the IBM Cloud. The first article, Part 1 – Why Can’t I Create Anything can be found on my WordPress site. The next article, Part 3 – Who you Gonna Call ? For Your IBM Cloud Watson AI Software As A Service (SaaS) Needs can be found on Paula’s Medium site. These blog posts will cover how to deal with common issues and roadblocks for users of the IBM Cloud. 

I like helping my IBM Cloud customers, and I like dealing with the technology.  Every new technology (and even established technologies) has a learning curve.  My goal in writing this series of articles is to help you more quickly conquer that learning curve with respect to the IBM Cloud.   

Today’s article deals with understanding what is going on in the “big picture” with the IBM Cloud.  How do you know what new services are available on the IBM Cloud?  How do I know when maintenance windows will occur?  How do I find out when services are getting deprecated and retired?  If my services are down, is it just me?  Is it other people too?  Is the whole data center down? 

Checking the Current IBM Cloud Status 

When things are not working, or seem to be slow, the first place I check is the overall IBM Cloud status page.  You can find it here -> https://cloud.ibm.com/status?selected=status.  There are a few different ways to look at this page.  The first tab shows the Status of the overall cloud – which services might be unavailable and which regions are impacted.  There are four other tabs, and they show other information.  One is for Planned Maintenance, and this shows upcoming maintenance windows and describes their impact on users of the services.  It’s always good to check this once a week to see what upcoming activities may impact your users and cloud projects.  Another tab is for Security Bulletins, and this one shows important security bulletins and events that you will want to be aware of.  There is also a tab for more general IBM Cloud Announcements, which contains general cloud announcements and event notifications.  The final tab is for History, so you can see the events of the past few days, and see what the resolution of those events was. 

This is a lot of different tabs for you to check.  I have to admit, even as a frequent user of the IBM Cloud platform, I rarely check these tabs on a daily, or even weekly, basis.  Instead, I subscribe to an RSS feed that will give me push notifications of IBM Cloud events as they get posted.  For those of you unfamiliar with RSS, it is a publishing technology which allows users to “subscribe” to event streams.  There are a bunch of free RSS readers out there, just look one up and install it.  Then point your RSS reader at the IBM Cloud RSS feed.  The RSS link is on the IBM Cloud Status page – just click on the Subscribe icon on the right-hand side of the page. 

Signing Up For Email Notifications 

Another thing that IBM Cloud account owners and IBM Cloud Administrators should do is to sign up for email notifications.  You can have the account owner (your IBM Cloud account which “owns” the subscription) get notifications each month when certain events occur.   

Setting this up is easy, for the account owner.  Log into the IBM Cloud as the account owner, and then select Manage -> Billing and Usage from the top navigation bar for the IBM Cloud.  In the resulting screen, look at the menu on the left side of the browser, and select the Spending Notifications option. 

On this Spending Notifications screen, you should now be able to specify sending spending notifications to yourself for any of the conditions specified.  Set your limits, and be aware that you will be notified when you reach 80%, 90% and 100% of your specified threshold.  Your Spending Notification screen should look similar to this: 

Click in those checkboxes to make sure that you get emails sent to you whenever those threshold limits are hit. 

Why Can’t I See That Support Ticket? 

I like the IBM Cloud, but on occasion you will need to open a support ticket because you have run into an issue on the IBM Cloud, or with one of the IBM Cloud services.  In order to open up a support ticket, click on Support on the top menu bar.  In the resulting Support page, click on the Manage Cases tab, and you will see a list of support cases that you are involved with. 

Be aware of the fact that this Manage Cases page has a filter which will only show support cases that you are involved with, and that are in some open state.  You may want to go and change your filters, to be able to see additional support cases.  If you are not able to see a support case, it could be because your organization has not given you the ability to see or open support cases for the organization.  If this is the case, then you’ll need to ask your IBM Cloud administrator to give you that capability.  The Create A Service Support Case documentation page has a great description of the process used to create a support case.

If you are the IBM Cloud administrator, then you will need to go to the Manage –> Access (IAM) page, and then go to Access Groups.  Once there, create a new access group, and make sure that it follows your naming conventions.  A good example might be, “SupportTicketAccess_AG”.  Once the access group is created, you’ll see the Access Group page.  Click on the Access Policies tab, and then on the Assign Access button.  Now you will need to select Assign Access to Account Management Services.  Select the Support Center service, and then apply ALL levels of access (Administrator, Editor, Operator, and Viewer) to the support center.  Now all you need to do to give users access to all of the support tickets for an organization is to add them to this access group. 

Note that you could create finer-grained access groups, like “SupportTicketViewer_AG”, that would only allow limited capability with support tickets.  Just create the additional access groups, and change your assignment of levels of access accordingly. 

Oh My God – EVERYTHING IS BLOWING UP! 

Now I’m getting 5438 email messages a day about things going down – are things really THAT bad??  OK – maybe 5438 is a bit of an exaggeration, but you get the idea…. 

You have subscribed to get email notifications of outages in the IBM Cloud.  Nice job – you should be proud of yourself for being proactive!  Our IBM Cloud has a lot of different customers, all co-located with services in a lot of different data centers.  When our infrastructure team detects a loss of service (let’s say a machine dies, which causes some IBM Cloud service to fail for the 5 customer instances running on that machine), they want to notify our customers as soon as possible.  So we send out an automated warning email to our users.  This is all nice automation, and allows us to be “good” Cloud providers and let our customers know when things go wrong. 

Now we get to the not-so-pretty part.  At the time this happens, we cannot tell EXACTLY which 5 customer instances have gone down, so we err on the side of over-communication, and let EVERY CUSTOMER IN THAT DATA CENTER know that they MIGHT have lost service.  We didn’t want to ignore or pretend the errors weren’t happening – so we took this approach.  Unfortunately, these things happen relatively frequently, and while they are short in duration and limited in scope (only a couple of customers lose service for a short period of time), the email blast to customers is EXTENSIVE.  Inside of IBM we half-jokingly (with accompanying eye roll) refer to this as our BLAST RADIUS. 

What does this mean for you?  It means that you will get a lot of notices, only 5-10% of which will actually apply to you.  We SHOULD watch this issue though, as this is a known (and painful) issue that IBM is currently addressing and rolling out fixes for.  As these fixes and changes to the IBM Cloud get implemented, the percentage of notices that actually apply to you will increase from 5-10% to 100% (meaning we only notify you about things that WILL actually impact you). 

Conversational Assistants and Quality with Watson Assistant

By Daniel Toczala

Note: I updated this blog post in February 2020 to add a link to a much better testing notebook that I discovered, and to do a slight rewrite of that section.

Recently my team inside of IBM decided that we needed to capture some of the “institutional knowledge” that some of our more experienced members knew, but that didn’t seem to be captured anywhere so our newer team members could be as effective as our more seasoned members.  We also wanted an excuse to get our hands dirty with our own technology, some of us had been focused on some of the other Watson technologies and needed to get reintroduced to the Watson Assistant since the migration to the “skills based” UI.

I went looking for something good about developing a chatbot (or conversational assistant), with Watson Assistant, and some good lessons learned.  I found some good information, but not one spot with the kind of experience and tips that I was looking for.  So I thought it might be good to capture it in my own blog post.

Getting Started with Your Conversational Assistant

We spent a week or two coming to a common vision for our chatbot.  We also mapped out a “growth path” for our chatbot, and we agreed on our roles.  I cannot begin to stress how important this is – Best Practice #1 – Know the scope and growth path for your chatbot.  We had a good roadmap for the growth of our chatbot.  We mapped out the scope for a pilot, where we wanted to be to release it to our end users, and a couple of additional capabilities that we wanted to add on once we got it deployed.

My boss graciously agreed to be our business sponsor – his role is to constantly question our work and our approach.  “Is this the most cost-effective way to do this?”, and, “Does that add any value to your chatbot?”, are a couple of the questions he constantly challenges us with.  As a technical guy, it’s important to have someone dragging us back to reality – it’s easy to get focused on the technology and lose sight of the end goal.

Our team of “developers” also got a feel for the roles we would play.  I focused on the overall view and dove deeper on technical issues, some of my co-workers served primarily as testers, some as knowledge experts (SME’s), and others as served as UI specialists, focusing on the flow of conversation.  This helped us coordinate our work, and it turned out to be quite important – Best Practice #2 – Know your roles – have technical people, developers, SME’s, architects, and end users represented.  If you don’t have people in these roles, get them.

Starting Out – Building A Work Pipeline

As we started, we came together and worked in a spreadsheet (!?!), gathering the basic questions that we anticipated our chatbot being able to answer.  We cast a pretty wide net looking for “sample” questions to get us kickstarted.  If you are doing something “new”, you’ll have to come up with these utterances yourself.  If you’re covering something that already exists, there should be logs of end user questions that you can use to jumpstart this phase of your project.

Next, we wanted to make sure that we had an orderly development environment.  Since our chatbot was strictly for internal deployment, we didn’t have to worry too much about the separation of environments, so we could use the versioning capabilities of Watson Assistant.  Since our chatbot was going to be deployed on Slack, we were able to deploy our “development” version on Slack, and also deploy our “test” and “production” versions on Slack as well.  These are all tracked on the Versions tab of the Watson Assistant Skill UI.  This gives us the ability to “promote” tested versions of our skill to different environments.  All of this allowed us to have a stable environment that we could work and test in – which leads us to Best Practice #3 – Have a solid dev/test/prod environment set up for your Conversational assistant or chatbot.

How Are We Doing? – K- Fold Testing

As we started out, we began by pulling things together and seeing how our conversational assistant was doing in real-time, using the “Try It” button in the upper right-hand corner of the Watson Assistant skills screen.  Our results were hit and miss at first, so we knew that we needed a good way to test out our assistant. 

We started out with some code from a Joe Kozhaya blog post on Training and Evaluating Machine Learning Models.  I ended up modifying it a little bit, and you can find the modified notebook in my Watson Landing Page GitHub repo, under notebooks, in a Python notebook stored as ANYBOT_Test-and-Deploy.ipynb.  We also read some good stuff from Andrew Freed (Testing Strategies for Chatbots) and from Anna Chaney (Data DevOps Rules of Engagement),  and used some of those ideas as well.  This led me to create that modified Python notebook, which I used to provide automated k-fold testing of our assistant implementation. 

In February of 2020 I was informed of this great blog post and Python notebook, on How to Design the Training Data for an AI Assistant. I really like this Python notebook MUCH better than my own K-fold notebook mentioned above. The other nice thing is that you can discover this Python notebook in the catalog in Watson Studio, and just apply it and have it added to your Watson Studio project. The only big difference with this notebook is that you need to have your testing data in a separate CSV file – it doesn’t break up “folds” based on your training data. This highlights Best Practice #4 – Automate Your AI Testing Strategy.

After all of this was in place, our team fell into a predictable rhythm of work and review of our work.  Since this was a side project for all of us, some of us contributed some weeks, and didn’t contribute on other weeks.  We were a small team of people (less than 10), so it was easy to have our team manage itself.

Using Feedback

As we let our automated training process take hold, we noted that our results were not what we had hoped, and that updating things was difficult.  We also learned that taking time each week to review our Watson Assistant logs was time well spent. 

It was quite difficult to add new scope to our conversation agent, so we looked at our intents and entities again.  After some in-depth discussions, we decided to try a slightly different focus on what we considered intents.  It allowed us to make better use of the entities that we detected, and it gave us the ability to construct a more easily maintained dialog tree.  We needed to change the way that we were thinking about intents and entities.

All of this brings us to our next piece of wisdom – Best Practice #5 – Be Open-Minded About Your Intents and Entities.  All too often I see teams fall into one of either two traps.  Trap 1 – they try to tailor their intents to the answers that they want to give.  If you find yourself with intents like, “how_to_change_password” and “how_to_change_username”, then you might be describing answers, and not necessarily describing intents.  Trap 2 – teams try to have very focused intents.  This leads in an explosion of intents, and a subsequent explosion of dialog nodes.  If you find yourself with intents like, “change_password_mobile”, “change_password_web”, “change_password_voice”, then you have probably fallen into this trap.

We found that by having more general intents, and then using context variables and entities to specify things with more detail, that we have been able to keep our intents relatively well managed, our dialog trees smaller and better organized, and our entire project is much easier to maintain.  So, if our intent was “find_person”, then we will use context variables and entities to determine what products and roles the person should have.  Someone asking, “How do I find the program manager for Watson Assistant?”, would return an intent of “find_person”, with entities detected for “program manager” and “Watson Assistant”.  In this way, we can add additional scope without adding intents, but only by adding some entities and one dialog node. 

Why K-Fold Isn’t Enough

One thing that we realized early on was that our k-fold results were just one aspect of the “quality” of our conversational assistant.  They helped quantify how well we were able to identify user intents, but they didn’t do a lot for our detection of entities or the overall quality of our assistant.  We found that our k-fold testing told us when we needed to provide additional training examples for our classifier, and this feedback worked well.

We also found that the “quality” of our assistant improved when we gave it some personality.  We provided some random humorous responses to intents around the origin of the assistant, or more general questions like, “How are you doing today?”.  The more of a personality that we injected into our assistant, the more authentic and “smooth” our interactions with it began to feel.  This leads us to Best Practice #6 – Inject Some Personality Into Your Assistant

Some materials from IBM will break this down into greater detail, insisting that you pay attention to tone, personality, chit-chat and proactivity.  I like to keep it simple – it’s all part of the personality that your solution has.  I usually think of a “person” that my solution is – say a 32-year old male from Detroit, who went to college at Michigan, who loves sports and muscle cars, named Bob.  Or maybe a 24-year-old recent college graduate named Cindy who grew up in a small town in Ohio, who has dreams of becoming an entrepreneur in the health care industry someday.  This helps me be consistent with the personality of my solution.

We also noticed that we often needed to rework our Dialog tree and the responses that we were specifying.  We used the Analytics tab in the skill we were developing.  On that Analytics tab, we would often review individual user conversations and see how our skill was handling user interactions.  This led us to make changes to the wording that we used, as well as to the things we were looking for (in terms of entities) and what we were storing (in terms of conversation context).  Very small changes can result in a big change in the end-user perception.  Something as simple as using contractions (like “it’s” instead of “it is”), will result in a more informal conversation style.

The Analytics tab in Watson Assistant is interesting.  It provides a wealth of information that you can download and analyze.  Our effort was small, so we didn’t automate this analysis, but many teams DO automate the collection and analysis of Watson Assistant logs.  In our case, we just spent some time each week reviewing the logs and looking for “holes” in our assistant (questions and topics that our users needed answers for that we did not address), and trends in our data.  It has helped guide our evolution of this solution.

Summary

This blog post identifies some best practices for developing a chatbot with IBM Watson Assistant – but these apply to ANY chatbot development, regardless of technology.

  • Best Practice #1 – Know the scope and growth path for your chatbot
  • Best Practice #2 – Know your roles – have technical people, developers, SME’s, architects, and end users represented
  • Best Practice #3 – Have a solid dev/test/prod environment set up for your Conversational assistant or chatbot
  • Best Practice #4 – Automate Your AI Testing Strategy
  • Best Practice #5 – Be Open Minded About Your Intents and Entities
  • Best Practice #6 – Inject Some Personality Into Your Assistant

Now that you have the benefit of some experience in the development of a conversational assistant, take some time to dig in and begin building a solution that will make your life easier and more productive.

AI Changes Everything (but nothing really changes…)

I usually don’t write big long opinion rants, and usually, I stick to more technical focused content. However, recent events are beginning to make my head explode. There is so much misunderstanding about data, privacy, and artificial intelligence. So I decided to write something to help one of the younger members of my family make sense of everything. So please read this – and pass this along to your friends who are not “tech people” if you think it will help them understand and make sense of recent events.

Note: The attempt to make this like the Ryan Tomayko REST article is deliberate. I LOVED that article – it clarified the concept of REST for me and countless others a long time ago. I hope this article is half as effective as that one was. Ryan has since taken the original version of his article down because it was deemed sexist…

The Conversation

Young Person: What is with all of the recent media panic about FaceApp and what happens to your data? Is this just like the Facebook attention focused on user privacy?

Tox : Are you sure that you want to get into this? It gets kind of weird.

Young Person: Sure. How bad could it be? You work with Artificial Intelligence and that AI stuff don’t you? Can’t you just have Watson explain it to me?

Tox : Artificial Intelligence, or AI, isn’t really like that. I can’t just ask Watson to explain it to you. AI isn’t magic, it’s just different from how we traditionally programmed computers and created applications.

Young Person: What is an application?

Tox : An app – those things on your phone. Your phone hasn’t always been smart – phones were pretty dumb for the longest time.

Young Person: I know that, I think I saw a picture of one once. But why is AI different?

Tox : Previously, computer software and applications (or apps) operated as a set of rules. Picture them as big diagrams where you check some data (like age, name, location, etc.), and then do something based on the value of that data. So an auto loan calculator app would take in all of the various things needed to calculate your loan payment (length of the loan, downpayment, interest rate, etc.), and would “do the math” based on your individual situation, and return the answer to you. Most apps are bigger and more complex than my example, but they all work the same way every time. If I enter the same data each time, I can predict what the answers coming back will be. This is because traditional computer apps are essentially “rules engines” – they follow the same rules, every time, no matter what.

Young Person: So software developers are just writing “rules” all day long?

Tox : Yes – at some level, that is what a programming language does. It allows you to write rules about how to calculate things, and how to show things to the human users.

Young Person: So how is AI different?

Tox : Artificial Intelligence works differently. It is primarily based on statistical models. It looks at things and creates statistical models so it can try to “predict”, with some level of confidence, what the next steps should be. So in the case of facial recognition, it takes the pictures that you give to it, and it is able to “look” at the picture and say, “I am 90% confident this is an eye, I am 88% confident that this is hair, I am 93% confident that this is a mouth”. Doing this repeatedly allows it to go through a progression of steps, first it will isolate a person from a picture, then it will isolate the face, then it will isolate individual features in the face, and then it will compare those to specific individuals and may be able to “identify” an individual person.

Young Person: So that’s what those “auto tags” in Facebook do? They just apply statistics to my pictures? That’s AI?

Tox : It’s one aspect of AI – visual recognition and facial recognition.

Young Person: So why do people get so worked up about it?

Tox : Because I can use it to keep tabs on people – to make them do what I want them to. To take away their freedom. Have you heard about the Chinese facial recognition used to help enforce their laws?

Young Person: We talked about it in school, but that kind of stuff could never happen here in Texas. Right?

Tox : We could get into a whole political discussion about that – let’s just stick to the stuff I know. The key thing here is that Artificial Intelligence is not “magic” – it isn’t a small computer brain that we have in a lab somewhere bathed in a solution with electrodes attached. It’s just looking at things from a statistical perspective, instead of the more traditional rules-based perspective.

Young Person: OK – so now I know that AI is different. But why does this stuff matter – statistics vs. rules? It might be important to tech types like you and Uncle Marc, but why does it matter to me?

Tox : Since AI is statistically based, it needs to have a lot of data. Statistics has some interesting things, it’s not as bad as it can seem in school. Did you know that the more samples of something that you have, the more accurate your predictions about future behavior can be. This is called the Law of Large Numbers, and it is a CORE driving concept for AI. Having a large amount of data is essential for this to work properly, so AI solutions require a lot of data – a lot of samples – that help them “learn” about something.

Young Person: OK – so how does that work?

Tox : The best illustration of this might be from the world of sports, using baseball batting averages. Or shooting percentages from other sports. As players perform, a history of performance is built up. Early in the year, a player may do very well, and have a high average (or score of success). Later in the year, they may not do as well, and their average (or score of success) will drop. (For those of you who want to learn more, this is called regression to the mean – another interesting statistical concept).

Looking at these scores later in the year will give a coach (or a casual sports fan) a way to compare the probability of success for two different players. Now here is the key point – it will not predict WHO will be successful, but it will tell you who has a higher probability of success. This is what AI does – it uses statistical models to predict future behavior or make sense of current data.

Young Person: So I could create an AI thing that would predict which stocks will do great in the next year – and then make millions. Right?

Tox : Not really. Remember, AI only gives you the probability of success – it doesn’t predict the future. It tells you what the chances of something happening are. If something happens one time every hundred times, I can tell you that it probably won’t happen – and I would be right 99% of the time.

Young Person: But a lot of AI doesn’t predict anything. It changes things. Like some of the deepfakes that I saw. Some of those were really funny….

Tox : These videos are modified using those statistical models. They get enough examples of one persons face, and they “predict” what it would look like on a different person. What gets done is different, and more complex, but the concept is the same.

At this point we took a break to grab some food off of the grill, play with my dogs, and relax a little bit. Then we picked our conversation back up….

Young Person: OK, so now I understand why AI is different. It’s all statistics, and it’s not magic. Why is this becoming such a big deal now?

Tox : As time and technology progress, the computing power and availability of computing resources allow us to tackle larger and larger problems. Large amounts of data can now be easily collected, stored and processed. You can do this on a cloud platform (like the IBM Cloud) for relatively little money. An individual who has the correct background and knowledge can now build and launch an AI application serving hundreds or even thousands of users for around $100 a month.

Young Person: So you mean that I could be doing deepfake videos on the cloud? Or other stuff?

Tox : Sure. You and anyone else you can think of. The issue is now “What is useful for people?” – and how can I provide some capability that people are willing to pay me for? Right now, most of the business models in this space tend to follow the same path that broadcasting took in the last century. Broadcasters provided service for free, but charged advertisers for the ability to expose a large audience to a particular marketing or advertising message. people couldn’t DVR stuff and blast past the commercials. Today, internet companies use your personal information to allow advertisers to “target” particular populations of people – based on income, interest, location and a variety of other things.

Young Person: So I could be like one of those people that are a billionaire before they are 30?

Tox : Why not? But you need to figure out HOW? Entrepreneurs begin to look at where they can make money – and make an impact on the world. Online companies are attractive because they do not require large amounts of capital (I don’t need a factory, and thousands of workers, just a team of 15 software developers and some laptop computers). They can try to build user groups who will pay for a service with some sort of monthly “subscription” (like Netflix). This model means influencing a LOT of people, and getting a small amount of money from each. The other approach is to focus your attention – get a few BIG users, who will spend a lot of money. This leads to the advertising business models where large corporations are the ultimate target customer (like Facebook) – and the consumer is given something for “free”.

Young Person: Facebook is mostly for older people like you. I spend most of my time in Snapchat or Instagram.

Tox : Those guys use the same type of business model – they provide an audience and information about that audience to advertisers, and the consumer gets something for “free”.

Young Person: What’s wrong with getting something for free. Why should I pay to get these things if I don’t have to?

Tox : When I was younger, there was a saying that my Dad had, and it still holds true today. There’s no such thing as a free lunch. You may not be paying for these services and apps with money, but you ARE paying for them.

Young Person: What’s are you talking about? I’m not paying anyone any money. If they give me ads I don’t have to buy any of the stuff getting advertised. So how am I “paying for it”?

Tox : You may not be paying for these services and apps with money, but you ARE paying for them. You are paying for them with a loss of privacy. People in older generations, and people from areas of the world with repressive governments, know what living in a “police state” or “surveillance state” means for people. That brings us back to politics again – and we said that we weren’t going to get into that.

Young Person: So I guess we pay for everything, just sometimes we pay with things other than money.

Tox : Now you’re getting it. So all of this new technology – AI, minaturization, 5G, and whatever else you can think of – has changed the perception of things in the world. It feels like we are able to do things for “free” – but the reality is that we are paying with other currency. Sometimes it is access to our private data. Sometimes it is access to our movements. Sometimes it is limits on what we can do.

I’m Having an Issue on IBM Cloud Part 1 – Why Can’t I Create Anything?

By: Daniel Toczala

Note: This is the first blog in a series of blogs that I am co-authoring with Paula Williams, as part of an “I have an Issue…” series on the IBM Cloud.  These blog posts will cover how to deal with common issues and roadblocks for users of the IBM Cloud. Check out her post on “What the Heck is a CSM?

I like helping my IBM Cloud customers, and I like dealing with the technology.  Every new technology (and even established technologies) have a learning curve.  My goal in writing this series of articles is to help you more quickly conquer that learning curve with respect to the IBM Cloud.

Typical Issues That People See

Some typical issues that users experience when working with the IBM Cloud will often be with respect to their services.  These could be one of the Watson services (like Watson Conversation or Watson Discovery), or maybe Cloud Object Storage, or a DB2 or Mongo database.  The issues that people will typically experience fall into one of two categories:

I’ve Created Something That I Cannot See

These situations have you going out and creating an instance of a service, but now you just can’t seem to figure out how to find it or how to get to it.  It’s almost as if we have decided to hide it on you.

In these situations, it is best to first figure out WHERE you are on the IBM Cloud.  Look in the upper right corner of your browser window.  As soon as you log into the IBM Cloud, you’ll see something like this:

Finding the area you are working in on the IBM Cloud

That text in that small black block tells you WHERE you are.  It tells you the account that you are operating in.  Clicking on this box you can CHANGE where you are looking.  Confused yet?  Maybe we should step back a bit….

You have an ACCOUNT and IDENTITY on the IBM Cloud.  Your IDENTITY from an IBM perspective is typically an email address, which is also your IBM ID (for our example let’s assume that mine is tox@acme.com).  It has the same username/password as your IBM ID (which you might use for things on ibm.com).  You might even have a Federated ID, where we use your company email address/identity and your company authentication mechanisms.  Some things to remember when looking at your IBM ID:

  • Just because you have an IBM ID, doesn’t mean that you have an IBM Cloud account.  You will need to register for an IBM Cloud account. While both the IBM Cloud and ibm.com both use your IBM ID, they are DIFFERENT domains.
  • When you sign up for your IBM ID, use a valid email address as your user ID.  You will need to VALIDATE your account by responding to an email that is sent to (you guessed it!) your user ID.  So in my case I cannot sign up for an IBM ID at tox_is_awesome@acme.com (unless I have convinced my corporate IT folks to give me that email address).

Now let’s get back to finding those cloud resources that we created.  Once you see what context you are in, you will have a better idea of what you can EXPECT to see.  Since I am an Acme Co. employee, I have been added as an approved user of the Acme corporate account.  What does this mean?  Well the Acme corporation created a different account, a corporate account, associated with a service account called IBM_Cloud_Admin@acme.com.  This account has a subscription which provides it with a set amount of “credits” for IBM Cloud services, which it burns down over time.  Since I am a member of this account, I can create IBM Cloud services in this corporate account, and their costs get assigned to the corporate account.  IBM Cloud services are billed based on where they are LOCATED (logically), and not based on who created them.

So now you hopefully have a better feel for how your account fits into the grand scheme of things, maybe you can find out WHERE that Watson service that you created is located, by looking at the various different contexts that you operate in.

Advanced Developer Note: Your IBM ID is based on an email ID.  So I have an IBM ID for tox@acme.com, but I also have one associated with my personal email address (tox_is_awesome@freebiemailcorp.com). I use my acme.com account for doing my regular work, and I use my personal email based ID to do open source work.  That account is a trial account (or maybe I even attach my personal credit card to it), and I am careful not to rack up big charges on the account.  I use it for doing simple little things in the cloud environment.

I Cannot Work With Something I Created

These situations are a little different.  You are able to create some service, but you are then unable to access it.  Either the service is broken, or down, or just not responding to your repeated attempts to use it.  Or maybe you can see a service but you just cannot create it.

So let’s go back to that tox@acme.com account.  First of all, you need to check and make sure that the account that you are attempting to create a service in is able to pay for that service.  If the account has a credit card associated with it, which guarantees payment for cloud services used, then the account is referred to as a “PAYGO” (short for pay-as-you-go) account.  People who use things like GitHub and other SaaS based services should be familiar with this model.  If the account has prepaid for services, via an IBM Cloud subscription, then it is referred to as a “SUBSCRIPTION” account.  Either “PAYGO” or “SUBSCRIPTION” accounts can create any type of service.  Your personal account might not have a guaranteed payment method, like my tox_is_awesome@freebiemailcorp.com account.  In that case you have a “TRIAL” account.  “TRIAL” accounts can create lite (or no charge) instances of most services on the IBM Cloud.  TRIAL accounts will not be able to create more robust versions of those services until they either become “PAYGO” or “SUBSCRIPTION” accounts.

So let’s get back to our example.  My tox_is_awesome@freebiemailcorp.com account is a “TRIAL” account (I’m not paying for anything!), but since I am an approved user of the IBM_Cloud_Admin@acme.com account (which is a “SUBSCRIPTION” account), I can create non-lite service instances within THAT account.  There is one hitch…. I have to have PERMISSIONS granted to me to be able to see particular logical areas of the Acme IBM_Cloud_Admin account.

What Are These “Logical” Areas?

There are two different types of logical areas where IBM Cloud resources can be created.  Each is based on a different security model. 

The Cloud Foundry security model uses the concept of Organizations (called “ORGs”) and Spaces.  These “Orgs” and “Spaces” live in a hierarchal model, with a single Org hosting one or more Spaces.  The administrator/owner of an IBM Cloud account will create these Orgs and Spaces, and will assign people various roles in each org/space.  These roles determine what a user can do within that particular logical environment.  You need to make sure that your account has access to the orgs and spaces that you need to work in.

The IBM Access Management (IAM) security model is based on Resource Groups.  Each resource group may have a series of Access Groups associated with it, and these Access Groups can be used to provide fine-grained access controls and role management.  You need to make sure that your account is enabled to do what is needed for the resource groups that you need to work in.

You can learn all about Orgs, Spaces, Resource Groups, Access Groups and best practices for organizing your IBM Cloud account by reading my blog post entitled, Getting Started Right on the IBM Cloud.

Getting Swagger API Pages for Watson APIs

In the past couple of weeks, I have seen a few comments from my customers complaining about the lack of “sufficient” API documentation for the various Watson API’s. I used to like to point my customers to the Swagger API documentation, but I can’t seem to find it anymore. So I asked some of my fellow IBM folks if they knew where these pages were. They didn’t know, they just had some vague notion that they were no longer supported.

I miss those Swagger API pages – so I found out how to get them. The IBM development teams no longer host these pages, but you can generate them for yourself, whenever you want, but just following this short little guide.

Go Ahead – Get That Swagger

Step 1 – Figure out which API you want to generate a Swagger page for. Go to the IBM Cloud catalog, and select the service that you want to see. For the purposes of this example, I’ll go and look at the Watson Assistant service.

Step 2 – Get to the API Documentation page by clicking on the link titled View API Docs – as shown below.

Step 2a – You can skip all of this hassle by just going to the IBM Cloud API Docs page, and then selecting the specific API documentation page that you are looking for (which in our case is Watson Assistant v1). This is much quicker – and easier to bookmark and remember.

Step 3 – You are now on the Watson Assistant API (V1) page. Look for the ellipsis in the white text portion of the UI, as shown below, and click on it. Save a version of the API by selecting Download OpenAPI Definition. This will download a JSON file to your local machine.

Step 4 – Open a new browser window, and go to the web-based Swagger editor.

Step 5 – In the Swagger editor window, select File -> Import File. Then select your recently downloaded Watson API JSON file (from Step 3).

You can now look at the Swagger API version of the Watson API documentation. This allows you to see all of the API calls for the service, along with the various parameters, and the responses. It also allows you to try to use the interface in an interactive manner. Pretty nice!!

Building on the Cloud – Some Guidelines for App Development on the Cloud

Sometimes I post about things where I have done some work and provided some deep thought, and I want to share my knowledge. Sometimes I just “pass things along”, when I find something that is technically solid and useful. This post is more of a “pass it on” post.

Many of my customers are beginning to seriously think about doing “Cloud Native” development in 2019, based on the questions that I get asked. When I say “Cloud Native” development, I am referring to the development of projects that are built on the Cloud, and produce applications and (micro)services that live on the Cloud. This isn’t about moving server workloads to the cloud, it’s about new development efforts.

These customers are asking me about tooling, approaches and techniques for doing software development on the Cloud. I would often point them to some of my blog posts on how to organize your IBM Cloud environment, or to something good on microservices. One other good site, which I thought was more popular, is the 12 Factor App guidelines.

The 12 Factor App site has a nice simple write up which reminds you a bit of the Agile Manifesto. It has 12 factors which you can see, and each has a short and quick description of what is important about that factor. it’s definitely worth a look – it takes a grand total of about 15 minutes to read through the whole thing. Some of the factors are more development focused (like Config and Codebase), some are operations focused (Dev/Prod parity and Build/Release/Run), and others are more architectural (Dependencies and Concurrency) in nature. The important thing to remember is that ALL project participants should be aware of, and know the importance of, each one of the factors.

So if you are one of those organizations that are looking at making a serious impact with Cloud Native development this year, I strongly urge you to take the time to read the 12 Factor App guidelines and let me know what you think. Then feel free to ask me how to accomplish any of these things in the IBM Cloud.

Watson Text to Speech – The Costs of Personalization

I tend to write these blog posts to share interesting things that I have learned when working with our customers.  Just this past week I have had 2 or 3 blog worthy events happen, so I hope to be publishing these posts at a brisker pace in the coming months.

This week I had a customer that is using the Watson Text to Speech service.  They are using it to do short utterances, things like street names, addresses, and city names.  The utterances are relatively short.  They told me that they had no idea how they were being charged for the service.

This particular customer has a focus on producing a positive customer experience.  No tinny, mechanical voice for this customer!!  They are tweaking the speaking voice and customizing it, using SSML (Speech Synthesis Markup Language) to modify and “humanize” the synthesized speech from the Watson Text-to-Speech (TTS) service.  You have the ability to modify things like the emotion used in the speech generated (called expressive SSML), to more basic things like the pitch and glottal tension (and yes, I had to look up the definition of glottal tension).  The typical curl call that they use looked similar to this:

curl -X POST -u apikey:*****************************--header "Content-Type: application/json" --header "Accept: audio/wav" --data "{\"text\":\"<speak><voice-transformation type=\\\"Custom\\\" breathiness=\\\"35%\\\" pitch=\\\"-80%\\\" pitch_range=\\\"60%\\\" glottal_tension=\\\"-40%\\\" >$text</voice-transformation></speak>\"}" --output $finalFile "
https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_MichaelVoice"

So this curl command will ask for some text (referenced by the $text parameter) that will have breathiness set to 35%, pitch at -80%, the pitch range set to 60%, with a glottal tension of -40%.  I’m sure that someone played with these values, before settling on this combination.  It’s a great way to customize the sound and the tone of your automated speaking responses. 

How Does This Impact Cost?

 The cost of doing something like this will vary, and this is where I learned how some small changes can have a HUGE impact on the costs associated with your Watson solution.  The basic price for using the Watson TTS service is $0.02 per thousand characters.  There are some interesting things to keep in mind here.  Whitespace is NOT counted, so only count the non-whitespace characters.  Also, remember that the voice customizations and everything between the “<speak>” and the “</speak> ” are included in this count.

Now let’s assume that the text being converted was a home address, something like, “9 Marine Drive, Round Rock, Texas 78681”.  Let’s also assume that the user is being referred to by name.  There will also be some other text (a meter reading, a service interruption, etc.) as well, informing the end user about something about to happen near their home address.  We want to figure out the monthly costs for something like this if we estimate that we’ll build and issue 100,000 of these notices in a month.  A sample utterance might sound/look like this:

“This message is for Dan Toczala.  We are informing you of a service interruption tomorrow morning at 9 Marine Drive, Round Rock, Texas 78681.  Please call us at 1-800-123-4567 if you have questions.”

Breaking It Down

Your application can look up the customer name and address, and build this entire text string for each individual event, and then submit each one to the Watson Text To Speech service.  Your typical call would look like this:

curl -X POST -u apikey:*****************************--header "Content-Type: application/json" --header "Accept: audio/wav" --data "{\"text\":\"<speak><voice-transformation type=\\\"Custom\\\" breathiness=\\\"35%\\\" pitch=\\\"-80%\\\" pitch_range=\\\"60%\\\" glottal_tension=\\\"-40%\\\" >This message is for Dan Toczala.  We are informing you of a service interruption tomorrow morning at 9 Marine Drive, Round Rock, Texas 78681.  Please call us at 1-800-123-4567 if you have questions.</voice-transformation></speak>\"}" --output $finalFile "
https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_MichaelVoice"

For the purposes of this discussion, we’re going to just focus on the “payload”, or the part in the data section of the curl command.  The part that impacts what your costs are.  So this chunk:

<speak><voice-transformation type=\\\"Custom\\\" breathiness=\\\"35%\\\" pitch=\\\"-80%\\\" pitch_range=\\\"60%\\\" glottal_tension=\\\"-40%\\\" >This message is for Dan Toczala.  We are informing you of a service interruption tomorrow morning at 9 Marine Drive, Round Rock, Texas 78681.  Please call us at 1-800-123-4567 if you have questions.</voice-transformation></speak>\

Now in this example, we count ALL non-whitespace characters inside of the quotes.  We have 336 non-whitespace characters.  Multiply that by 100,000 notices in a month, and I get a rate of 33,600,000 characters a month.  Apply the TTS cost of $0.02 per thousand characters, and you get a final monthly cost of $672.

Now let’s see what happens if we change the way that we think about this.  What if we quit customizing so much of the voice?  Then we would end up with something looking like this:

<speak><voice-transformation>This message is for Dan Toczala.  We are informing you of a service interruption tomorrow morning at 9 Marine Drive, Round Rock, Texas 78681.  Please call us at 1-800-123-4567 if you have questions.</voice-transformation></speak>\

So for the non-customized example, we have 225 non-whitespace characters.  Multiply that by 100,000 notices in a month, and I get a rate of 22,500,000 characters a month.  Apply the TTS cost of $0.02 per thousand characters, and you get a final monthly cost of $450.  Customizing my voice could be looked at as a cheap way to have an impact on customer satisfaction (it’s only $222 a month), or a really expensive way to do this (it’s about 49% more expensive than the base translation).  Remember, it all depends on how you want to look at things.  I suggest focusing on your problem and the overall costs of your solution.

Now let’s look at a final example.  In this example, we’ll keep our customized voice, but we’ll try to stop converting the same text over and over again.  What if our message was built in a way that minimized what needed to be converted each time?  What if we converted a basic message once, and the rest of the customized part for each customer?  So we could do this for each customer:

<speak><voice-transformation type=\\\"Custom\\\" breathiness=\\\"35%\\\" pitch=\\\"-80%\\\" pitch_range=\\\"60%\\\" glottal_tension=\\\"-40%\\\" >This message is for Dan Toczala, who resides at 9 Marine Drive, Round Rock, Texas 78681</voice-transformation></speak>\

And then follow that with this “standard” section which we would only need to convert once (for a one time cost of fractions of a cent):

<speak><voice-transformation type=\\\"Custom\\\" breathiness=\\\"35%\\\" pitch=\\\"-80%\\\" pitch_range=\\\"60%\\\" glottal_tension=\\\"-40%\\\" >We are informing you of a service interruption tomorrow morning. Please call us at 1-800-123-4567 if you have any questions.</voice-transformation></speak>\

So for the modified script example, we have 244 non-whitespace characters.  Multiply that by 100,000 notices in a month, and I get a rate of 24,400,000 characters a month.  Apply the TTS cost and you get a final monthly cost of $488.

Final Conclusions

So let’s look at all of these options together:

ApproachCharacters /
Msg.
Characters /
Month
Monthly
Cost
% Change
Basic
22522,500,000$4500%
Full
Customization
33633,600,000$67249.3%
Modified
Customization
24424,400,000$4888.4%

Looking at things in this way helped us make a rational decision on what things really cost, and helped us look at ways we could maximize our impact and minimize our costs.

P.S.  For those of you who were patient enough to read through this entire article, you can save yourself even more by removing the <speak> and </speak> tags.  These are assumed by the Watson Text To Speech service, so you can omit using them and save yourself 15 characters per message.  For the purposes of this example, that would reduce the monthly cost of each of the above approaches by $30 a month.

Enabling Your IBM Cloud Users To Submit Support Tickets

Every once in a while I have a customer ask me a simple question, or bring me a simple problem, and I don’t know the answer for it.  So I make sure that I understand the question, and then I go off and find out the answer for them.  Sometimes these answers are simple, and sometimes these answers SHOULD be simple, but they are not well known.  Today I ran into one of those situations, and thought it would be good to share it.

The Problem – Users Cannot Open Support Tickets on IBM Cloud

My customer is relatively new to the IBM Cloud, let’s call them the Acme Corporation.  They have a subscription with a corporate account (ibmcloudadmin@acme.com).  One of their users (Sally@acme.com) goes into the account and is doing some work with an instance of Watson Assistant.   She runs into some odd behaviour and wants to open up a support ticket.   If you look in the upper right of the browser UI, you will see that she is in the proper context (ibmcloudadmin@acme.com).  When she tries to open a ticket, it tells her that she has Basic Support, and when she attempts to submit the ticket she gets an error dialog that says, “You do not have ticket add and view permissions”.  So what do we do to fix this?

The problem is that our user (Sally@acme.com) does not have permissions to open tickets for the account in question (ibmcloudadmin@acme.com).  

Solution #1 – Add Sally to the Account With Infrastructure Access

The first solution to this is to add Sally’s account (Sally@acme.com) to the list of users with access to the ibmcloudadmin@acme.com infrastructure resources.  This needs to be done by the account administrator, who will need to be logged in as an account administrator/owner.

You can now do this by inviting Sally as a new user, using the Invite New User page (part of the normal user management on the IBM Cloud).  When you do this, you will want to be sure to give Sally a “Basic User” role for her Infrastructure access (see the picture below).

Make sure to give your user “Basic User” permissions for Infrastructure Access

This will allow Sally’s account to create support tickets while working in the context of the corporate IBM Cloud account.

Solution #2 – Change Sally’s Infrastructure Access

The other thing that can be done is to modify the Infrastructure permissions assigned for Sally’s account (Sally@acme.com).  This also needs to be done by the account administrator, who will need to be logged in as an account administrator/owner.

You can do this by following the steps outlined here.  First, start by looking at the list of tickets for the account.   

You can do this by following the steps outlined here.  First, start by looking at the list of tickets for the account.  From the Menu bar, select Support -> View Tickets.

Then you will want to get a list of the users who have access to the infrastructure available in the IBM Cloud, so select Account -> Users -> User List.

Now in that list of IBM Cloud infrastructure users, you will want to find the users that you want to give the ability to submit support tickets, and you will select Edit Portal Access.  This will take you to the IBM Cloud Infrastructure portal access dialog for that particular user.

Once the portal access dialog comes up in the browser, make sure that you have selected the correct user, and then give that user permission to add, edit, view, and search thru support tickets.  Your screen should look similar to what you see below.

Conclusion: You need to give your users the ability to submit support tickets

The IBM Cloud has a finer-grained access, role, and permission model with the move towards resource groups and IAM.  Part of this finer-grained access is the ability to allow your users to submit, view, search, and edit support tickets.  Make sure that you get your users set up correctly the first time – so you can avoid these issues in the future.