Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Agent deb packages are available for different architectures under Agent releases. For more information check section "Agent installation and registration".

Configuration after installation Open Horizon Management Hub and Agent

...

https://github.com/open-horizon/anax/blob/master/docs/api.md

Trying to configure agent

Firstly the problem seems to be that agent is not configured.

Agent installation and registration

Install docker

follow

https://docs.docker.com/engine/install/ubuntu/

Install required dependencies by Agent.
Code Block
sudo apt-get install jq


then download and install agent package from

https://github.com/open-horizon/anax/releases

Follow

https://open-horizon.github.io/docs/installing/advanced_man_install.html

to change

Code Block
/etc/default/horizon

like following

Code Block
ubuntu@ubuntu:~$ cat /etc/default/horizon
HZN_EXCHANGE_URL=
Code Block
titleAgent hzn node list
ubuntu@ubuntu:~$ hzn node list
{
  "id": "node1",
  "organization": null,
  "pattern": null,
  "name": null,
  "nodeType": null,
  "token_last_valid_time": "",
  "token_valid": null,
  "ha": null,
  "configstate": {
    "state": "unconfigured",
    "last_update_time": ""
  },
  "configuration": {
    "exchange_api": "http://192.168.100.32:3090/v1/",
    "exchange_version": "2.78.0",
    "required_minimum_exchange_version": "2.44.0",
    "preferred_exchange_version": "2.76.0",
    "mms_api": "
HZN_FSS_CSSURL=http://192.168.100.32:9443",
    "architecture": "arm",
    "horizon_version": "2.29.0-498"
  }
}
ubuntu@ubuntu:~$ 

Key generation

Code Block
pcube@PF1JYLUV:~$ ssh ubuntu@192.168.100.32
ubuntu@192.168.100.32's password:
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.

https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.


Last login: Mon Aug 2 16:08:52 2021
ubuntu@ubun2:~$ export HZN_ORG_ID=myorg
ubuntu@ubun2:~$ export HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
ubuntu@ubun2:~$ ls -al
total 132
drwxr-xr-x 3 ubuntu ubuntu 4096 Jul 29 23:00 .
drwxr-xr-x 3 root root 4096 Jul 29 20:55 ..
-rw------- 1 ubuntu ubuntu 345 Jul 29 23:27 .bash_history
-rw-r--r-- 1 ubuntu ubuntu 220 Feb 25 2020 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 3771 Feb 25 2020 .bashrc
drwx------ 2 ubuntu ubuntu 4096 Jul 29 20:55 .cache
-rw-r--r-- 1 ubuntu ubuntu 807 Feb 25 2020 .profile
-rw-r--r-- 1 ubuntu ubuntu 0 Jul 29 20:58 .sudo_as_admin_successful
-rwxr-xr-x 1 root root 57457 Jul 29 22:25 deploy-mgmt-hub.sh
-rw-r--r-- 1 root root 1380 Jul 29 22:53 docker-compose-agbot2.yml
-rw-r--r-- 1 root root 5848 Jul 29 22:53 docker-compose.yml
-rw-r--r-- 1 root root 111 Jul 29 23:00 node.policy.json
-rwxr-xr-x 1 root root 14163 Jul 29 22:53 test-mgmt-hub.sh
-rwxr-xr-x 1 root root 9155 Jul 29 22:53 test-sdo.sh
ubuntu@ubun2:~$ env | grep "HZN"
HZN_ORG_ID=myorg
HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
ubuntu@ubun2:~$ vim open_horizon_exports.sh
ubuntu@ubun2:~$ vim .bashrc
ubuntu@ubun2:~$ vim .bashrc
ubuntu@ubun2:~$ . .bashrc
ubuntu@ubun2:~$ env | grep "HZN"
HZN_ORG_ID=myorg
HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
ubuntu@ubun2:~$ sudo reboot
[sudo] password for ubuntu:
ubuntu@ubun2:~$ Connection to 192.168.100.32 closed by remote host.
Connection to 192.168.100.32 closed.
pcube@PF1JYLUV:~$ ssh ubuntu@192.168.100.32
ubuntu@192.168.100.32's password:
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information disabled due to load higher than 1.0

* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.

https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.


Last login: Mon Aug 2 16:10:14 2021 from 192.168.100.22
ubuntu@ubun2:~$ env | grep "HZN"
HZN_ORG_ID=myorg
HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
ubuntu@ubun2:~$ hzn agreement list
[
{
"name": "Policy for myorg/node1 merged with myorg/policy-ibm.helloworld_1.0.0",
"current_agreement_id": "faf1ba0cfc9ec7344d985b23856427c54841d773f75a9ffa8a90db5a1db9ceca",
"consumer_id": "IBM/agbot",
"agreement_creation_time": "2021-07-29 23:01:06 +0000 UTC",
"agreement_accepted_time": "2021-07-29 23:01:09 +0000 UTC",
"agreement_finalized_time": "2021-07-29 23:01:22 +0000 UTC",
"agreement_execution_start_time": "2021-07-29 23:01:12 +0000 UTC",
"agreement_data_received_time": "",
"agreement_protocol": "Basic",
"workload_to_run": {
"url": "ibm.helloworld",
"org": "IBM",
"version": "1.0.0",
"arch": "amd64"
}
}
]
ubuntu@ubun2:~$ git clone https://github.com/TheMosquito/easy-open-horizon.git
Cloning into 'easy-open-horizon'...
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 26 (delta 10), reused 12 (delta 2), pack-reused 0
Unpacking objects: 100% (26/26), 7.56 KiB | 595.00 KiB/s, done.
ubuntu@ubun2:~$ ls
deploy-mgmt-hub.sh docker-compose.yml node.policy.json test-mgmt-hub.sh
docker-compose-agbot2.yml easy-open-horizon open_horizon_exports.sh test-sdo.sh
ubuntu@ubun2:~$ cd easy-open-horizon/
ubuntu@ubun2:~/easy-open-horizon$ tree

Command 'tree' not found, but can be installed with:

sudo snap install tree # version 1.8.0+pkg-3fd6, or
sudo apt install tree # version 1.8.0-1

See 'snap info tree' for additional versions.

ubuntu@ubun2:~/easy-open-horizon$ ls
LICENSE Makefile README.md pattern.json service.json
ubuntu@ubun2:~/easy-open-horizon$ vim Makefile
ubuntu@ubun2:~/easy-open-horizon$ vim service.json
ubuntu@ubun2:~/easy-open-horizon$ make publish-service
Using Exchange Org ID: "myorg"
Error: stat /home/ubuntu/.hzn/keys/service.private.key: no such file or directory. Please create the signing key.
make: *** [Makefile:20: publish-service] Error 7
ubuntu@ubun2:~/easy-open-horizon$ ls ~/.hzn
ls: cannot access '/home/ubuntu/.hzn': No such file or directory
ubuntu@ubun2:~/easy-open-horizon$ cd /
ubuntu@ubun2:/$ find | grep "service.private.key"
find: ‘./var/lib/polkit-1’: Permission denied


ubuntu@ubun2:/$ find | grep -v "Permission denied" | grep "service.private.key"
find: ‘./var/lib/polkit-1’: Permission denied


ubuntu@ubun2:/$ find | grep -v "Permission denied" | grep service.private.key
find: ‘./var/lib/polkit-1’: Permission denied

ubuntu@ubun2:/$ hzn exchange user list
{
"myorg/admin": {
"password": "********",
"email": "not@used",
"admin": true,
"hubAdmin": false,
"lastUpdated": "2021-07-29T22:58:16.508975Z[UTC]",
"updatedBy": "root/root"
}
}
ubuntu@ubun2:/$ hzn key create "SoftServer" "przemyslawcuber@gmail.com"
Creating RSA PSS private and public keys, and an x509 certificate for distribution. This is a CPU-intensive operation and, depending on key length and platform, may take a while. Key generation on an amd64 or ppc64 system using the default key length will complete in less than 1 minute.
Created keys:
/home/ubuntu/.hzn/keys/service.private.key
/home/ubuntu/.hzn/keys/service.public.pem
ubuntu@ubun2:/$ make publish-service
make: *** No rule to make target 'publish-service'. Stop.
ubuntu@ubun2:/$ cd -
/home/ubuntu/easy-open-horizon
ubuntu@ubun2:~/easy-open-horizon$ make publish-service
Using Exchange Org ID: "myorg"
Checking private key file format ...
Verifying public key file ...
Signing service...
Pulling eclipse-mosquitto:1.6.9...
Error: could not inspect image eclipse-mosquitto:1.6.9: Get "http://unix.sock/images/eclipse-mosquitto:1.6.9/json": dial unix /var/run/docker.sock: connect: permission denied.
make: *** [Makefile:20: publish-service] Error 7
ubuntu@ubun2:~/easy-open-horizon$ hzn version
Horizon CLI version: 2.29.0-515
Horizon Agent version: 2.29.0-515
ubuntu@ubun2:~/easy-open-horizon$ hzn exchange version
2.78.0
ubuntu@ubun2:~/easy-open-horizon$ cat pattern.json
{
"name": "$PATTERN_NAME",
"services": [
{
"serviceUrl": "$SERVICE_NAME",
"serviceOrgid": "$HZN_ORG_ID",
"serviceArch": "$ARCH",
"serviceVersions": [ { "version": "$SERVICE_VERSION" } ]
}
]
}

ubuntu@ubun2:~/easy-open-horizon$ hzn exchange pattern publish -f pattern.json
Warning: environment variable 'PATTERN_NAME' is referenced in input file, but not defined in the environment.
Warning: environment variable 'SERVICE_NAME' is referenced in input file, but not defined in the environment.
Warning: environment variable 'SERVICE_VERSION' is referenced in input file, but not defined in the environment.
Error: Failed to validate the secret binding. Error retrieving service myorg/ version from the Exchange. expecting at least 1 service myorg , got 0
ubuntu@ubun2:~/easy-open-horizon$ cp pattern.json pattern.json_bak
ubuntu@ubun2:~/easy-open-horizon$ vim pattern.json
ubuntu@ubun2:~/easy-open-horizon$ hzn exchange pattern publish -f pattern.json
ERROR: logging before flag.Parse: E0802 16:51:42.863611 21036 service.go:396] Exchange RPC expecting 1 service glen.helloworld local-cluster 1.0.0 response: &{map[] 0}
Error: Failed to validate the secret binding. Error retrieving service local-cluster/glen.helloworld version 1.0.0 from the Exchange. expecting 1 service glen.helloworld local-cluster 1.0.0, got 0
ubuntu@ubun2:~/easy-open-horizon$ cd ..
ubuntu@ubun2:~$ ls
deploy-mgmt-hub.sh docker-compose.yml node.policy.json test-mgmt-hub.sh
docker-compose-agbot2.yml easy-open-horizon open_horizon_exports.sh test-sdo.sh
ubuntu@ubun2:~$ vim deploy-mgmt-hub.sh
ubuntu@ubun2:~$ sudo docker container ps
[sudo] password for ubuntu:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
89d149cab8af openhorizon/ibm.helloworld_amd64 "/bin/sh -c /service…" 3 days ago Up About an hour faf1ba0cfc9ec7344d985b23856427c54841d773f75a9ffa8a90db5a1db9ceca-ibm.helloworld
38852a8c7957 openhorizon/amd64_agbot:latest "/bin/sh -c /usr/hor…" 3 days ago Up 59 minutes (healthy) 127.0.0.1:3110->8080/tcp, 0.0.0.0:3111->8083/tcp agbot
71cc38d60c24 openhorizon/sdo-owner-services:latest "/bin/sh -c $WORKDIR…" 3 days ago Up About an hour (healthy) 0.0.0.0:8040->8040/tcp, 0.0.0.0:8042->8042/tcp, 0.0.0.0:9008->9008/tcp sdo-owner-services
324a6a4009af openhorizon/amd64_cloud-sync-service:latest "/usr/edge-sync-serv…" 3 days ago Up About an hour (healthy) 0.0.0.0:9443->8080/tcp css-api
587afb807273 openhorizon/amd64_exchange-api:latest "/bin/sh -c '/usr/bi…" 3 days ago Up About an hour (healthy) 8083/tcp, 0.0.0.0:3090->8080/tcp exchange-api
15e71961ae9b mongo:latest "docker-entrypoint.s…" 3 days ago Up About an hour (healthy) 27017/tcp mongo
98b48ab9ccaf postgres:latest "docker-entrypoint.s…" 3 days ago Up About an hour (healthy) 5432/tcp postgres
ubuntu@ubun2:~$ ls
deploy-mgmt-hub.sh docker-compose-agbot2.yml docker-compose.yml easy-open-horizon node.policy.json open_horizon_exports.sh test-mgmt-hub.sh test-sdo.sh
ubuntu@ubun2:~$ 

Agent configuration - it has to be investigated.

https://open-horizon.github.io/docs/installing/registration.html

https://open-horizon.github.io/docs/installing/automated_install.html

https://github.com/open-horizon/SDO-support/blob/master/README-1.10.md

https://open-horizon.github.io/docs/installing/many_install.html#batch-install

Code Block
ubuntu@ubuntu:/$ cd /usr/horizon/bin/
ubuntu@ubuntu:/usr/horizon/bin$ ls
agent-install.sh agent-uninstall.sh anax edgeNodeFiles.sh horizon-container hzn
ubuntu@ubuntu:/usr/horizon/bin$ sudo -s ./agent-install.sh -i 'css:' -p IBM/pattern-ibm.helloworld -w '*' -T 120
2021-08-03 19:44:04 AGENT_INSTALL_ZIP: (from default value)
2021-08-03 19:44:04 INPUT_FILE_PATH: css: (from command line flag)
2021-08-03 19:44:04 INPUT_FILE_PATH adjusted to: css:/api/v1/objects/IBM/agent_files
2021-08-03 19:44:04 AGENT_CFG_FILE: (from default value)
2021-08-03 19:44:04 AGENT_VERBOSITY: 3 (from environment variable)
2021-08-03 19:44:04 ERROR: A value for HZN_ORG_ID must be specified
ubuntu@ubuntu:/usr/horizon/bin$ env | grep HZN
HZN_DEVICE_TOKEN=Zm4Y1wFgrUD2D1MTrtn1UmyBaOnn8u
HZN_DEVICE_ID=node1
HZN_ORG_ID=myorg
HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
HZN_EXCHANGE_URL=http://192.168.100.32:3090/v1/
HZN_FSS_CSSURL=http://192.168.100.32:9443/
ubuntu@ubuntu:/usr/horizon/bin$ export HZN_ORG_ID=myorg
ubuntu@ubuntu:/usr/horizon/bin$ sudo -s ./agent-install.sh -i 'css:' -p IBM/pattern-ibm.helloworld -w '*' -T 120
2021-08-03 19:44:50 AGENT_INSTALL_ZIP: (from default value)
2021-08-03 19:44:50 INPUT_FILE_PATH: css: (from command line flag)
2021-08-03 19:44:50 INPUT_FILE_PATH adjusted to: css:/api/v1/objects/IBM/agent_files
2021-08-03 19:44:50 AGENT_CFG_FILE: (from default value)
2021-08-03 19:44:50 AGENT_VERBOSITY: 3 (from environment variable)
2021-08-03 19:44:50 ERROR: A value for HZN_ORG_ID must be specified
ubuntu@ubuntu:/usr/horizon/bin$ sudo export HZN_ORG_ID=myorg
sudo: export: command not found
ubuntu@ubuntu:/usr/horizon/bin$ sudo su
root@ubuntu:/usr/horizon/bin#
root@ubuntu:/usr/horizon/bin# HZN_ORG_ID=myorg
root@ubuntu:/usr/horizon/bin# export HZN_ORG_ID=myorg
root@ubuntu:/usr/horizon/bin# env | grep HZN
HZN_ORG_ID=myorg
root@ubuntu:/usr/horizon/bin# ./agent-install.sh -i 'css:' -p IBM/pattern-ibm.helloworld -w '*' -T 120
2021-08-03 19:46:08 AGENT_INSTALL_ZIP: (from default value)
2021-08-03 19:46:08 INPUT_FILE_PATH: css: (from command line flag)
2021-08-03 19:46:08 INPUT_FILE_PATH adjusted to: css:/api/v1/objects/IBM/agent_files
2021-08-03 19:46:08 AGENT_CFG_FILE: (from default value)
2021-08-03 19:46:08 AGENT_VERBOSITY: 3 (from environment variable)
2021-08-03 19:46:08 HZN_ORG_ID: myorg (from environment variable)
2021-08-03 19:46:08 HZN_MGMT_HUB_CERT_PATH: (from default value)
2021-08-03 19:46:08 AGENT_CERT_FILE: agent-install.crt (from default value)
2021-08-03 19:46:08 ERROR: A value for HZN_FSS_CSSURL must be specified
root@ubuntu:/usr/horizon/bin# export HZN_DEVICE_TOKEN=Zm4Y1wFgrUD2D1MTrtn1UmyBaOnn8u
root@ubuntu:/usr/horizon/bin# export HZN_DEVICE_ID=node1
root@ubuntu:/usr/horizon/bin# export HZN_ORG_ID=myorg
root@ubuntu:/usr/horizon/bin# export HZN_EXCHANGE_USER_AUTH=admin:1eAVOw1dWRKve5b5KIkRk2PcBjXLnO
root@ubuntu:/usr/horizon/bin# export HZN_EXCHANGE_URL=http://192.168.100.32:3090/v1/
root@ubuntu:/usr/horizon/bin# export HZN_FSS_CSSURL=http://192.168.100.32:9443/
root@ubuntu:/usr/horizon/bin# ./agent-install.sh -i 'css:' -p IBM/pattern-ibm.helloworld -w '*' -T 120
2021-08-03 19:47:57 AGENT_INSTALL_ZIP: (from default value)
2021-08-03 19:47:57 INPUT_FILE_PATH: css: (from command line flag)
2021-08-03 19:47:57 INPUT_FILE_PATH adjusted to: css:/api/v1/objects/IBM/agent_files
2021-08-03 19:47:57 AGENT_CFG_FILE: (from default value)
2021-08-03 19:47:57 AGENT_VERBOSITY: 3 (from environment variable)
2021-08-03 19:47:57 HZN_ORG_ID: myorg (from environment variable)
2021-08-03 19:47:57 HZN_MGMT_HUB_CERT_PATH: (from default value)
2021-08-03 19:47:57 AGENT_CERT_FILE: agent-install.crt (from default value)
2021-08-03 19:47:57 HZN_FSS_CSSURL: http://192.168.100.32:9443/ (from environment variable)
2021-08-03 19:47:57 HZN_EXCHANGE_USER_AUTH: ****** (from environment variable)
2021-08-03 19:47:57 HZN_EXCHANGE_NODE_AUTH: (from default value)
2021-08-03 19:47:57 Downloading file http://192.168.100.32:9443/api/v1/objects/IBM/agent_files/agent-install.cfg/data ...
2021-08-03 19:47:58 AGENT_SKIP_REGISTRATION: false (from default value)
2021-08-03 19:47:58 HZN_EXCHANGE_URL: http://192.168.100.32:3090/v1/ (from environment variable)
2021-08-03 19:47:58 HZN_AGBOT_URL: http://127.0.0.1:3111 (from configuration file)
2021-08-03 19:47:58 HZN_SDO_SVC_URL: http://127.0.0.1:9008/api (from configuration file)
2021-08-03 19:47:58 NODE_ID: (from default value)
2021-08-03 19:47:58 HZN_DEVICE_ID: node1 (from environment variable)
2021-08-03 19:47:58 HZN_NODE_ID: (from default value)
2021-08-03 19:47:58 HZN_EXCHANGE_PATTERN: IBM/pattern-ibm.helloworld (from command line flag)
2021-08-03 19:47:58 HZN_NODE_POLICY: (from default value)
2021-08-03 19:47:58 AGENT_WAIT_FOR_SERVICE: * (from command line flag)
2021-08-03 19:47:58 AGENT_WAIT_FOR_SERVICE_ORG: (from default value)
2021-08-03 19:47:58 AGENT_REGISTRATION_TIMEOUT: 120 (from command line flag)
2021-08-03 19:47:58 AGENT_OVERWRITE: false (from default value)
2021-08-03 19:47:58 AGENT_SKIP_PROMPT: false (from default value)
2021-08-03 19:47:58 AGENT_ONLY_CLI: false (from default value)
2021-08-03 19:47:58 AGENT_INSTALL_ZIP: agent-install-files.tar.gz (from default value)
2021-08-03 19:47:58 AGENT_DEPLOY_TYPE: device (from default value)
2021-08-03 19:47:58 AGENT_WAIT_MAX_SECONDS: 30 (from default value)
2021-08-03 19:47:58 OS: linux, Distro: ubuntu, Distro Release: 20.04, Distro Code Name: focal, Architecture: armhf
2021-08-03 19:47:58 NODE_ID_MAPPING_FILE: node-id-mapping.csv (from default value)
2021-08-03 19:47:58 PKG_APT_KEY: (from default value)
2021-08-03 19:47:58 APT_REPO_BRANCH: updates (from default value)
2021-08-03 19:47:58 AGENT_IMAGE_TAR_FILE: amd64_anax.tar.gz (from default value)
2021-08-03 19:47:58 WARNING: Using node id from HZN_DEVICE_ID
2021-08-03 19:47:58 Node type: device
2021-08-03 19:47:58 Updating apt package index...
2021-08-03 19:48:51 Installing prerequisites, this could take a minute...
./agent-install.sh: line 1169: netstat: command not found
2021-08-03 19:49:04 Verifying that node node1 in the exchange is type device (if it exists)...
2021-08-03 19:49:05 Updating /etc/default/horizon ...
2021-08-03 19:49:06 Downloading file http://192.168.100.32:9443/api/v1/objects/IBM/agent_files/horizon-agent-linux-deb-armhf.tar.gz/data ...
2021-08-03 19:49:06 ERROR: HTTP code 403 from: downloading http://192.168.100.32:9443/api/v1/objects/IBM/agent_files/horizon-agent-linux-deb-armhf.tar.gz/data, stdout: Unauthorized. The object may not exist or be public.
root@ubuntu:/usr/horizon/bin#

Registering the agent

https://open-horizon.github.io/docs/installing/advanced_man_install.html

...

/
HZN_AGBOT_URL=http://127.0.0.1:3111
HZN_MGMT_HUB_CERT_PATH=
HZN_DEVICE_ID=node1
HZN_AGENT_PORT=8510
ubuntu@ubuntu:~$

Next restart horizon service to apply changed settings.

Code Block
sudo systemctl restart horizon.service
Check configuration
Code Block
ubuntu@ubuntu:~$ hzn version
Horizon CLI version: 2.29.0-537
Horizon Agent version: 2.29.0-537
ubuntu@ubuntu:~$


Code Block
ubuntu@ubuntu:~$ hzn exchange version
2.78.0
ubuntu@ubuntu:~$


Code Block
ubuntu@ubuntu:~$ hzn node list
{
  "id": "node1",
  "organization": "myorg",
  "pattern": "IBM/pattern-ibm.helloworld",
  "name": "node1",
  "nodeType": "device",
  "token_last_valid_time": "2021-08-10 00:15:28 +0000 UTC",
  "token_valid": true,
  "ha": false,
  "configstate": {
    "state": "configured",
    "last_update_time": "2021-08-10 00:15:29 +0000 UTC"
  },
  "configuration": {
    "exchange_api": "http://192.168.100.32:3090/v1/",
    "exchange_version": "2.78.0",
    "required_minimum_exchange_version": "2.44.0",
    "preferred_exchange_version": "2.81.0",
    "mms_api": "http://192.168.100.32:9443",
    "architecture": "arm64",
    "horizon_version": "2.29.0-537"
  }
}
ubuntu@ubuntu:~$ 

Check available patterns

Code Block
ubuntu@ubuntu:~$ hzn exchange pattern list IBM/
[
  "IBM/pattern-ibm.cpu2evtstreams",
  "IBM/pattern-ibm.hello-mms-arm",
  "IBM/pattern-ibm.hello-mms",
  "IBM/pattern-nginx-operator-amd64",
  "IBM/pattern-ibm.helloworld",
  "IBM/pattern-ibm.hello-mms-amd64",
  "IBM/pattern-ibm.hello-mms-arm64"
]
ubuntu@ubuntu:~$ 

Register agent. Instead of

Code Block
hzn register -p IBM/pattern-ibm.helloworld

run

Code Block
hzn register -p IBM/pattern-ibm.helloworld -s ibm.helloworld --serviceorg IBM
from 
https://github.com/open-horizon/examples/blob/master/edge/services/helloworld/README.md#preconditions
Code Block
ubuntu@ubuntu:~$ hzn register -p IBM/pattern-ibm.helloworld -s ibm.helloworld --serviceorg IBM
Horizon Exchange base URL: http://192.168.100.32:3090/v1
Using node ID 'node1' from the Horizon agent
Generated random node token
Updating node token...
Will proceeed with the given pattern IBM/pattern-ibm.helloworld.
Initializing the Horizon node with node type 'device'...
Note: no input file was specified. This is only valid if none of the services need variables set.
However, if there is 'userInput' specified in the node already in the Exchange, the userInput will be used.
Changing Horizon state to configured to register this node with Horizon...
Horizon node is registered. Workload services should begin executing shortly.
Waiting for up to 60 seconds for following services to start:
	IBM/ibm.helloworld
Status of the services you are watching:
	IBM/ibm.helloworld 	Progress so far: agreement proposal has been received
Status of the services you are watching:
	IBM/ibm.helloworld 	Progress so far: agreement is accepted
Status of the services you are watching:
	IBM/ibm.helloworld 	Progress so far: service is created
Status of the services you are watching:
	IBM/ibm.helloworld 	Progress so far: execution is started
Status of the services you are watching:
	IBM/ibm.helloworld 	Success
ubuntu@ubuntu:~$ 


Code Block
ubuntu@ubuntu:~$  hzn agreement list
[
  {
    "name": "pattern-ibm.helloworld_ibm.helloworld_IBM_arm64 merged with pattern-ibm.helloworld_ibm.helloworld_IBM_arm64",
    "current_agreement_id": "8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6",
    "consumer_id": "IBM/agbot",
    "agreement_creation_time": "2021-08-10 00:15:37 +0000 UTC",
    "agreement_accepted_time": "2021-08-10 00:15:40 +0000 UTC",
    "agreement_finalized_time": "2021-08-10 00:15:48 +0000 UTC",
    "agreement_execution_start_time": "2021-08-10 00:15:48 +0000 UTC",
    "agreement_data_received_time": "",
    "agreement_protocol": "Basic",
    "workload_to_run": {
      "url": "ibm.helloworld",
      "org": "IBM",
      "version": "1.0.0",
      "arch": "arm64"
    }
  }
]
ubuntu@ubuntu:~$ 

Check whether docker container is running.

Code Block
ubuntu@ubuntu:~$ docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED         STATUS         PORTS     NAMES
6a8c986c5955   openhorizon/ibm.helloworld_arm64   "/bin/sh -c /service…"   4 minutes ago   Up 4 minutes             8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6-ibm.helloworld

Check logs from running container.

Code Block
ubuntu@ubuntu:~$ hzn service log -f ibm.helloworld
Found service ibm.helloworld with service id 8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6.
Displaying log messages of container ibm.helloworld for service ibm.helloworld with service id 8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6.
Use ctrl-C to terminate this command.
Aug 10 00:15:48 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:15:51 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:15:54 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:15:57 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:16:00 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:16:03 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!
Aug 10 00:16:06 ubuntu workload-8c61ebcabbafcf380758739116cb5603bed33d64984862a910c20c56a6b003b6_ibm.helloworld[1934]: node1 says: Hello World!!


TODO Check what is the procedure for using custom containers.