open-horizon / examples Goto Github PK
View Code? Open in Web Editor NEWCode examples you can use with Horizon.
License: Apache License 2.0
Code examples you can use with Horizon.
License: Apache License 2.0
This doc explains the steps to put a docker image (that is part of a horizon service) into the bx cr registry and use it with horizon: https://docs.google.com/document/d/1Qlff9PT_o8Qv83viKKLZda5L-o0QdRm_8Cqi7MpA1qU
Convert it to markdown, place it in examples/edge/doc
, and link to it from the relevant other docs.
2 Issues discovered by Chris working through the dev guide on arm64:
Makefile
and the Dockerfiles to ../../../tools/kafkacat/$(ARCH)/
don't resolve when following Dave's recommended development procedure (copying files from open-horizon/examples over to ~/hzn
. I think these paths should be: ~/examples/tools/kafkacat/$(ARCH)/
. So glen will instruct the user to also copy the tools/kafkacat/$(ARCH)
dir.build
, some bash is used. Without calling bash explicitly this fails on arm64/ubuntu16.04 (TX2 current with Jetpack3.3). See fix in comment below.The current doc of how to do this is: https://docs.google.com/document/d/1Qlff9PT_o8Qv83viKKLZda5L-o0QdRm_8Cqi7MpA1qU . In our bluehorizon hybrid environment, this was done for location2wiotp.
The basic use of images stored the bx container registry is documented in https://docs.google.com/document/d/1awe8WZxJbXE1Xt2GiiSrODQfgrhWCTWtUGG0ZWbGcXI . But that is a lot of manual steps required on every edge node using the image. So i'd like to see an end-to-end bulleted list flow with the minimum possible steps to both put the image in the registry, and to get many edge nodes to be able to use it. Including the highest priority updates to horizon to streamline the process.
Isaac will put the new microphone ms and a sample wk to use it on github.com/openhorizon/examples. He'll also put the aural2 docker image in docker hub, exch ms def file in openhorizon/examples, and a sample workload to use it
Use the same process for our own samples and what we suggest to our customers.
Design is here: https://ibm.ent.box.com/notes/542507981970
Also investigate gitflow to see if it would be useful.
The http://freegeoip.net/csv/ api used by the horizon gps service was deprecated, so the ip estimated location stopped working, so i updated that code to use the new api. In the process i noticed that get_location_from_ip_address()
doesn’t return elevation, but the gps service still returns it as 114.6
(at least for my location). From looking at the code, i couldn’t figure out how that was happening. Please debug and fix. Thx.
speedtest
and speedtest2wiotp
) and associated deployment pattern (speedtest2wiotp
) for architectures arm
, arm64
, and amd64`.speedtest2wiotp
explaining what to set up in wiotp org, instance, device type, device ID/token, API key name and token (required to run and test the code, or to register an Edge Node on this pattern)speedtest2wiotp
README.md file about how to do this.Part of epic https://github.ibm.com/Edge-Fabric/project-summary/issues/35
When running the SDR POC on my RPI, the GPS container failed to estimate my GPS location. The following was in the GPS container log. It appears that ifconfig.co return an error and the GPS code didnt handle it, just kept going and made the call the api.ipstack.com. I have confirmed that the failure from ifconfig.co is not permanent, it worked on my rpi while debugging this issue, so perhaps simply adding an intermitent retry until it succeeds is sufficient to solve the problem.
Oct 18 21:16:56 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:16:56 WARNING: Env variable HZN_USE_GPS should have been set, but it was not.
Oct 18 21:16:56 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:16:56 Estimating node location using public IP address.
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: Response from http://api.ipstack.com/Error from ifconfig.co: Get http://ifconfig.co: dial tcp [2606:4700:30::6812:3f80]:80: connect: cannot assign requested address?access_key=166f0d44636d9ed71c6a01530f687fdb&format=1:
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: {
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "ip":"Errorfromifconfig.co:Gethttp:/ifconfig.co:dialtcp[2606:4700:30::6812:3f80]:80:connect:cannotassignrequestedaddress",
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "type":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "continent_code":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "continent_name":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "country_code":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "country_name":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "region_code":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "region_name":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "city":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "zip":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "latitude":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "longitude":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "location":{
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "geoname_id":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "capital":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "languages":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "country_flag":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "country_flag_emoji":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "country_flag_emoji_unicode":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "calling_code":null,
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: "is_eu":null
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: }
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: }
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 Blue Horizon gps service configuration:
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 HZN_GPS_PORT=31779
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 HZN_USE_GPS=false
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 HZN_LAT=0
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 HZN_LON=0
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 HZN_LOCATION_ACCURACY_KM=0
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 (location source): Estimated
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 (/dev patterns): /dev/ttyACM*, /dev/ttyAMA*
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 CACHED: Source: "Estimated" -- no obfuscation
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 CACHED: {"location":{"latitude":0,"longitude":0,"elevation":0,"accuracy_km":0,"loc_source":"Estimated","loc_last_update":0},"satellites":null}
Oct 18 21:17:08 raspberrypi workload-github.com-open-horizon-examples-wiki-service-gps_2.0.5_ae9f6194-7f1f-42cd-9137-a5b5449f7d25_gps[396]: 2018/10/18 21:17:08 REST server is launching on port 31779.
EVTSTREAMS_*
This script will require:
Uses feature open-horizon/anax#967
Currently blocked by issue open-horizon/anax#1084
Currently, the gps sample service sets the deployment.services.gps. privileged
field to true
so it can access the gps sensor on the edge node. (See
Instead of using the blanket privileged
access, it should be possible to use the cap_add
field to get the access needed to the gps sensor. (See https://github.com/open-horizon/anax/blob/master/doc/deployment_string.md#deployment-string-fields .)
This will be a good example to service developers of how to address a common issue. To get details about the cap_add
field, talk with ling.
The beginning of the cpu2msghub log looks like:
Optional environment variables (or default values): SAMPLE_INTERVAL=2, SAMPLE_SIZE=5, PUBLISH=true, MOCK=false
Checking for required environment variables for publishing to IBM Message Hub:
HZN_ORGANIZATION=IBM
HZN_DEVICE_ID=bpmac
MSGHUB_TOPIC=cpu2msghub
MSGHUB_API_KEY=LheItOe2b6UquCt7C_hdUEuQdSI1tsOXygr03gwAwyT4
MSGHUB_BROKER_URL=9.30.210.34:30226
Will publish to topic: cpu2msghub
Starting infinite loop to read from the cpu and gps services then publish...
jq: error (at <stdin>:1): Cannot index number with string "cpu"
Interval 1 cpu:
(standard_in) 2: syntax error
Interval 2 cpu: 1
(standard_in) 1: syntax error
Interval 3 cpu: 0.25
(standard_in) 1: syntax error
Interval 4 cpu: 0.75
(standard_in) 1: syntax error
Interval 5 cpu: 0.75
(standard_in) 1: syntax error
(standard_in) 1: syntax error
echo {"nodeID":"bpmac","cpu":,"gps":{"lat":42.0738,"lon":-73.9797,"alt":50.05}} | kafkacat -P -b 9.30.210.34:30226 -X api.version.request=true -X security.protocol=sasl_ssl -X sasl.mechanisms=PLAIN -X sasl.username=token -X sasl.password=LheItOe2b6UquCt7C_hdUEuQdSI1tsOXygr03gwAwyT4 -X ssl.ca.location=/tmp/es-cert.pem -t cpu2msghub
Also, the 1st msg sent to event streams was:
cpu2msghub/0/3/: {"nodeID":"bpmac","cpu":,"gps":{"lat":42.0738,"lon":-73.9797,"alt":50.05}}
(Note there is no value after the "cpu"
field. This is invalid json.)
It is normal/expected that a service might not get a good result from required service api's for the 1st few tries, because all the services start concurrently, so the top-level service might start calling the required services before they have finished initializing. But in this case cpu2msghub should handle those errors more gracefully and not log syntax errors and not send invalid json to event streams.
BTW, i saw these error when running it via hzn dev service start -S
. I think they will also happen when run via a full hzn register ...
. But it will be easier for you to debug with hzn dev service start -S
.
Working with Glen, move the services from https://github.com/TheMosquito/detect into open-horizon/examples.
Need to add instructions to README.md, and we should consider adding a pointer to it in the KC getting started section.
Do this after open-horizon/anax#1041 is fixed:
version
fields in the cpu2msghub requiredServices
section back to [0.0.0,INFINITY)
Blocked by open-horizon/anax#1041
Running Ubuntu, I had some troubles to run the wiotp_agent_setup to register my edge on Watson. I had to edit the wiopt_agent_setup file manually to escape some quote characters, otherwise I got this error:
export WIOTP_INSTALL_DEVICE_TOKEN=token
As you can see, the token is not "in quotes", but it should be.
It would be more convenient to correct this in the code, so other users won't have the same problem.
Thanks
cpu2msghub
to be structured like helloworld
(bruce)cpu2msghub
to not use HZN_PATTERN for the msg hub topicREADME.md
(ivan reviewing)Test in all 3 modes the examples are used in:
horizon/hzn.env
, build/hzn dev/publish/hzn register for all 3 arches and use a pattern that includes all 3.horizon/hzn.env
, build/hzn dev/publish/hzn register for current machine's arch. (ivan testing)hzn register
on their edge node. (ivan testing)there is a lot of good info in the developer guide you wrote that i want to make available to users. I know it needs updating and i’ve been thinking about the best way to make use of the guide and here’s my thoughts: the dev quick start has the step-by-step, but almost nothing giving the bigger picture about how all the pieces fit together and general concepts and architecture about horizon and how it fits with wiotp. The developer guide already has a lot of this, so i suggest transforming it into a Horizon Principles and Concepts doc (title can be changed).
I don’t think it is worth it to try to have step-by-step commands in the developer guide. I don’t want us to have 2 places we have to maintain that info, and with the developer guide being longer, it will always take longer to review
in my mind that also goes for the step-by-step of setting up bluemix, wiotp ui, etc. I know we only cover that very tersely in the quick start, but i’m hoping the wiotp team can provide that info
the updates to the developer guide would also have to include converting it from microservice/workload to services. See the services design for some background info on that: https://docs.google.com/document/d/1xKCPP8Rx_KTGZxYFOl4ZEg-hE1qGO8eUAf-i_FyGzGA/edit#heading=h.sb4u7ixyrfmz
To simplify the sample Makefiles and avoid specifying a sleep time, which will never be right for all platforms, create a bash script that can be used, and put it in the tools
dir. It should have these features:
docker logs -f <container>
on mac (Darwin)tail -f /var/log/syslog | grep <regex>
on linux
Status:
In Makefile
# Configurable parameters for testing service
export MATCH:='echo {"nodeID":'
export TIME_OUT:=60
test:
hzn dev service start -S
@echo 'Testing service...'
../../../tools/serviceTest.sh $(SERVICE_NAME) $(MATCH) $(TIME_OUT) && \
{ hzn dev service stop; \
echo "*** Service test succeeded! ***"; } || \
{ hzn dev service stop; \
echo "*** Service test failed! ***"; }
Service Test Script:
#!/bin/bash
########################### TESTING ############################
# For now on Mac:
# docker logs -f `docker ps -q --filter name=$SERVICE_NAME`
#
# For now on Linux:
# sudo tail -f /var/log/syslog
################################################################
# $1 == $SERVICE_NAME
# $2 == "key" being searched for to know if service is successfully runnning. If found, exit(0)
# $3 == timeout - if exceeded, service failed. exit(1)
name=$1
match=$2
timeOut=$3
START=$SECONDS
##################################### Check the operating system #########################################
if [ $(uname -s) == "Darwin" ]; then
# This is a MAC machine
command="docker logs -f `docker ps -q --filter name=$name`"
else
# This is a LINUX machine
command="sudo tail -f /var/log/syslog"
fi
####################### Loop until until either MATCH is found or TIMEOUT is exceeded #####################
$command | while read line; do
# MATCH was found
if grep -q -m 1 "$match" <<< "$line"; then
exit 0
# TIMEOUT was exceeded
elif [ "$(($SECONDS - $START))" -ge "$timeOut" ]; then
exit 1
fi
sleep 1;
done
There is a poor man's example of copying services in https://raw.githubusercontent.com/open-horizon/examples/master/tools/loadResources . But a better approach is for us to define a packaging format for service definitions (and associated patterns and deployment policies):
horizon
dirdocker save
the images to tar files and include them in the pkg.hzn
sub-cmd to publish 1 service-pkg or a tar file of them:
hzn
sub-cmd to get a service from the exchange and package itAs a reference, there is a sample telco pkging format: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/004/02.07.01_60/gs_NFV-SOL004v020701p.pdf
EDIT: See longer post below for more details on this task.
Only change bluehorizon.network. Do not modify staging.bluehorizon.network for now.
Got a little more info about this problem that we've been seeing:
--connect-timeout 5
to the curl cmds, but it didn't help this problem.hzn dev service start
and hzn register ...
We've run cpu2msghub for a long time w/o seeing this problem, so the question is why has this come up now? Is it caused by a new version of docker? New version of anax? Listening on port 80? Some investigation steps:
-v
to the curl cmds to get more info on who it connected toIt seems the bbc website has changed in such a way that the scraping functionality of the bbcfake no longer works as intended and is no longer returning URL's properly. This has been verified on a VM edge node in it's syslog with errors that look like this:
Apr 18 21:16:18 ctiijimatest02 workload-ibm_github.com.open-horizon.examples.sdr_0.0.7_4da208c9-0b1c-49fd-b07a-449ced9edd4e_sdr[1043]: got 0 urls
Apr 18 21:16:18 ctiijimatest02 workload-ibm_github.com.open-horizon.examples.sdr_0.0.7_4da208c9-0b1c-49fd-b07a-449ced9edd4e_sdr[1043]: no urls, refreshing
Apr 18 21:16:18 ctiijimatest02 workload-ibm_github.com.open-horizon.examples.sdr_0.0.7_4da208c9-0b1c-49fd-b07a-449ced9edd4e_sdr[1043]: fetching a new set of URLs
This repeats infinitely on the edge nodes syslog.
And document for customers.
sdr
edge docker image and service definitionsdr2msghub
edge docker image and service definitionwiotp/location2wiotp
. Remove wiotp/cpu2wiotp
?cpu
to be structured like helloworld
gps
to be structured like helloworld
sdr2msghub
to be structured like helloworld
sdr
to be structured like helloworld
service.definition.json
move env vars from deployment.services.*.environment
to userInput
documentation
field point to it.Test in all 3 modes the examples are used in:
horizon/hzn.env
, build/hzn dev/publish/hzn register for all 3 arches and use a pattern that includes all 3.horizon/hzn.env
, build/hzn dev/publish/hzn register for current machine's arch.hzn register
on their edge node.Hi,
I tried to follow "Hello-World" example. In this i am stuck with "hzn exchange user list" command. It returns
Error: bad HTTP code 401 from GET https://alpha.edge-fabric.com/v1/orgs/HZN_ORG_ID/users/iamapikey, output: {"code":"invalid-credentials","msg":"IAM authentication succeeded, but no matching exchange org with a cloud account id was found for <HZN_ORG_ID"}
Here i am setting HZN_ORG_ID as my email address which i have used to create my free IBM Cloud account.
Can you guide my about HZN_ORG_ID, from where can i get it.
Thanks
Vulnerable packages:
cp -a
Package repository (pkg.bluehorizon.network) is only accesible via http. The repository public key is also only accessible via http.
Currently, (I think only on RPi?) if rtl_* is called every 30 seconds for some hours / days, the hardware will stop working. There are two solutions:
(Moved Authenticate IBM Cloud users to separate issue in sprint 3.)
Part of https://github.ibm.com/Edge-Fabric/project-summary/issues/4
On the edge node top nouns page, add a link to a new page: top stations, which will show a table of fields: frequency
, numberofclips
, dataqualitymetric
, timeupdated
from the stations
table, ordered by: numberofclips desc, timeupdated desc limit 20
.
Note that a frequency of 0.0
indicates that audio is coming from the internet, so the UI should replace 0.0
with (internet)
in the table.
Also note that soon we will be adding column callletters
to the stations
table. In the case of an "internet station" the callletters
field might contain the url.
Part of epic https://github.ibm.com/Edge-Fabric/project-summary/issues/35
Make changes similar to those made to cpu2msghub
in #140 in all of our other services:
[ ] gps
[ ] cpu
[ ] sdr
[ ] sdr2msghub
Then follow the procedure in https://github.ibm.com/Edge-Fabric/project-mgmt/issues/151 to release these changes.
The discourse server (https://discourse.bluehorizon.network/) does not allow any new entries .
How may we ask questions or report problems ?
--net=host
option)Wifi Signal Scan sample - Troy
--net=host
Offline Voice Assistant - Pooja
Smart Audio w/Edge - Lily
Security Camera Sample - Sadiyah
Edge Gateway - Sanjeev
--net=host
Noise Compliance through Situational Awareness - James
Edge Fabric Chatbot - Ivan
Intranet Performance Monitor - Nadim
--net=host
Switch2Msghub - Abhishek
--net=host
Network Observer - Max
--net=host
User @dnguyenv reported that when he tried to run deploy.sh
on his MacOS machine that it just stopped (no error message) if you don’t have any instance of the services already created in your IBM Cloud account. Apparently it will stop at lines 160
, 189
, 212
,241
,and 264
, but if you manually create the services, and comment out the lines listed, then it will run.
Here is some of the chat from a thread in the user channel attached to the message from @dnguyenv at 1:54PM Pacific on Friday Dec 14:
mosquito [12 minutes ago]
@dnguyenv Yes, but could you please share what errors you got when you tried to run it and it stopped at those lines? I’d like to understand what went wrong.
dnguyenv [5 minutes ago]
it just stops there without any error message, let me show you
dnguyenv [4 minutes ago]
2018-12-14 17:11:35 Checking prerequisites:
=============================================================
Found jq
Found curl
Found ibmcloud
Found psql
Found sed
Found grep
Found cut
Found npm
Found node
2018-12-14 17:11:35 All prerequisites are met
=============================================================
2018-12-14 17:11:35 The current action is deploy for all component(s)
2018-12-14 17:11:35 Creating all service instances required for running SDR PoC
2018-12-14 17:11:35 Creating edge-sdr-poc-speech-to-text Watson Speech-To-Text service instance with the standard plan
2018-12-14 17:11:35 Current Watson Speech-To-Text instances:```
Mock mode for sdr2msghub that gets audio from BBC radio.
0.0
Part of https://github.ibm.com/Edge-Fabric/project-summary/issues/8
userInput
variables in the service definitionSome FM radio stations broadcast their call letters. This is useful to help users connect a frequency with an actual station, and to associate a station that is broadcast on multiple frequencies (usually by repeaters). It can also be useful to identify internet radio "stations".
callletters
column to stations
table in db, as an additional key. (No automated migration - sdr is an example)sdr
service to get the call letters from FM stations that broadcast itsdr
service to put the url of internet radio "stations" (used for mocking) in the call letters fieldsdr2msghub
service to add the callLetters
field to the json sent to the cloudcallletters
column of the stations
tablePart of epic https://github.ibm.com/Edge-Fabric/project-summary/issues/35
The Problem: After a service is created, hzn exchange service list
shows them like IBM/github.com-open-horizon-examples-wiki-service-cpu2msghub_1.2.5_amd64
. The url value has to be munged because a regular url can't be passed into the exchange rest methods as part of the service id, because it would mess up the route of the rest method. This presents a usability problem because in other places in which a user needs to specify a service url (e.g. other services or pattern), they might think they should use github.com-open-horizon-examples-wiki-service-cpu2msghub
. Also, in the 2+ years we've had service/microservice/workload definitions in the exchange, i've never gotten any traction (even with the horizon team) on using the url field as the link to the documentation (which was part of the original reason for using the url as part of the unique identifier. Because of this, users have been confused about why it is a url and what they should set it to. Note that since the introduction of orgs, service identifiers only need to be unique within the org, not globally.
Solution Options:
github.com.open-horizon.examples.cpu2msghub
. This is similar to how java packages are named. Note that this approach works today. The only thing we might want to add is a warning or error if the url value contains chars that require munging (but we will wait on that). Also add an optional new field in the service definition called documentation
that explicitly points to the service documentation.hzn
command completely hide the munged url-version-arch. So only exchange rest api exploiters would ever need to deal with it. Hzn would always refer to services with the regular url, version, and arch for both creation and view (but under the covers still munge it). This will be problematic because some of the error msgs (about a referenced service not existing come from the exchange.123059851202345981043958123
. Handle the migration issues, and make hzn changes such that the user doesn't have to keep doing the mental mapping from id to url, version, and arch.We are planning to do option 1.
Issue reported by Chris trying to run through the dev guide on a TX2 (arm64).
Doing an hzn dev dependency fetch --url
on that host for the gps service sets "arch": "amd64"
in the service definition JSON file (but this should be arm64):
"requiredServices": [
{
"url": "https://$MYDOMAIN/service-$CPU_NAME",
"org": "$HZN_ORG_ID",
"version": "$CPU_VERSION",
"arch": "$ARCH"
},
{
"url": "https://github.com/open-horizon/examples/wiki/service-gps",
"org": "IBM",
"version": "2.0.5",
"arch": "amd64"
}
],
Bruce examined the code and says:
If i’m reading the code correctly (dave wrote that code), if arch isn’t specified it takes the 1st one it comes to (that is at the highest version), which isn’t the correct behavior
Yes, the code which looks up the dependency in the exchange does not default the arch to the arch of the system where the user is running hzn dev commands.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.