open-horizon-services / service-edgelake

Deployment of EdgeLake using OpenHorizon
0 stars 4 forks source link

pattern-based deployment doesn't connect to agent when looking at `hzn agreement list` #11

Open oshadmon opened 6 months ago

oshadmon commented 6 months ago

OpenHorzon Version: v2.30.0-1476_amd64 Machine: Ubuntu 22.04 LTS (jammy) on amd64

Prepare Machine:

  1. Add params to ~/.bashrc & execute ~/.bashrc & execute

    export HZN_ORG_ID=alog
    # export HZN_DEVICE_TOKEN= # specify a string value for a token
    export HZN_DEVICE_ID=alog-edgelake-node 
    export HZN_EXCHANGE_USER_AUTH=
    export HZN_EXCHANGE_URL=http://132.177.125.232:3090/v1
    export HZN_FSS_CSSURL=http://132.177.125.232:9443/
    export HZN_AGBOT_URL=http://132.177.125.232:3111/
    export HZN_SDO_SVC_URL=http://132.177.125.232:9008/api
    source ~/.bashrc
  2. create agent-install.cfg

    HZN_EXCHANGE_URL=http://132.177.125.232:3090/v1
    HZN_FSS_CSSURL=http://132.177.125.232:9443/
    HZN_AGBOT_URL=http://132.177.125.232:3111/
    HZN_SDO_SVC_URL=http://132.177.125.232:9008/api
    HZN_FDO_SVC_URL=http://132.177.125.232:9008/api 
  3. Install Agent - Timeouts, however service does get installed Look at HelloWorld Issue for details

    curl -sSL https://github.com/open-horizon/anax/releases/latest/download/agent-install.sh | bash -s -- -i anax: -k ./agent-install.cfg -c css: -p IBM/pattern-ibm.helloworld -w '*' -T 120
  4. Install make and clone repo

    sudo apt-get -y install make 
    git clone https://github.com/open-horizon-services/service-anylog/
  5. Unregister node

    hzn unregister -f

Deploy EdgeLake: The following steps are found in Deploy via OpenHorizon Pattern

  1. cd into service-anylog

  2. Publish service

    make publish-service EDGELAKE_TYPE=master 

    Expect / Actual: Success

  3. Publish service policy

    make publish-service-policy EDGELAKE_TYPE=master 

    Expect / Actual: Success

  4. Publish deployment policy

    make publish-deployment-policy EDGELAKE_TYPE=master 

    Expect / Actual: Success

  5. agent-run

    make agent-run EDGELAKE_TYPE=master 

    Expect: Success Actual: Everything looks correct, but nothing is happening as part of the agreement list - waited for over an hour

    
    root@alog-edgelake-node:~/service-anylog# make agent-run EDGELAKE_TYPE=master 
    ================
    REGISTERING NODE
    ================
    Note: No properties and constraints are specified under 'deployment' attribute in the node policy file hzn/node.policy.master.json. The top level properties and constraints will be used.
    Horizon Exchange base URL: http://132.177.125.232:3090/v1
    Using node ID 'alog-edgelake-node' from the Horizon agent
    Generated random node token
    Updating node token...
    Will proceed with the given node policy.
    Updating the node policy...
    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 agreement negotiation should begin shortly. Run 'hzn agreement list' to view.

root@alog-edgelake-node:~/service-anylog# hzn agreement list []

oshadmon commented 6 months ago

Steps:

  1. Rebuilt the machine
  2. In os-dev branch, I updated service and deployment configurations to not include empty values.
  3. Re-ran steps 1-5

Behavior: Policy Incompatible

root@alog-edgelake-node:~/service-anylog# make deploy-check EDGELAKE_TYPE=master 
Warning: environment variable 'LOCAL_SCRIPTS' is referenced in input file, but not defined in the environment.
Neither node id nor node user input file is specified. Getting node user input from the local node.
ERROR: logging before flag.Parse: E0405 01:16:37.417388    3026 service.go:400] Exchange RPC expecting 1 service service-edgelake alog 1.3.2403 response: &{map[] 0}
{
  "compatible": false,
  "reason": {
    "alog/service-edgelake_1.3.2403_amd64": "Policy Incompatible: Failed to find definition for dependent services of . Compatability of openhorizon.allowPrivileged cannot be fully evaluated until all services are in the Exchange."
  }
}