npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oh-android

v0.1.9

Published

The goal is to simplify and to reduce the amount of manual steps in creating and updating configurations and other system files.

Downloads

1

Readme

Anax NodeJS toolkit for application deployment and workload placement on Android devices

The goal is to simplify and to reduce the amount of manual steps in creating and updating configurations and other system files.

We have created templates in /templates directories to help automate the deployment process by extracting all the hardcoded values and needed envirnoment variables into this /hzn-config/.env-local.json file which should not be checked into Github. If for some reason /hzn-config/.env-local.json did not get created, you can create copying env-template.json and fill in the appropriate values.

These templates/anax.json, templates/horizon, templates/hzn.json, dockerfile-template files use tokenized placeholders and are to be used to generate needed configuration files at run-time. The output files for each environment are placed in dist folder

With .env-local.json in place, we now can manage as many environments as needed by providing the needed values in .env-local.json. Please see env-template.json for example.

Install oh-android

npm install -g oh-android

Available commands

action  Available actions: adbPush adbPushDreamAgent buildImage ibmLogin
        makeAll makeAnaxJson makeDeploy makeDirectories makeDockerFile
        makeDreamAgentYaml makeHorizon makeNodePolicy makeSystemFiles
        pushImage  

Examples

oha deploy -h
oha deploy ibmLogin   
oha deploy makeAll --org=samsung
oha deploy makeDeploy --org=samsung  
// Note: creates neccessary files to start agent container without build/push docker image

Notes

Typically, the following command is usually what you need to run to generate the config files and push application.yaml to the phone if all the needed values are provided in /hzn-config/.env-local.json file for a particular device.

oha deploy makeDeploy --org=samsung-device-name
--org=<the-key-of-the-json-object> in the /hzn-config/.env-local.json file as shown below
{
  "samsung-device-name": {
    "CONTAINER_NAME": "samsung-horizon2",
    "ARCH": "arm64",
    "REGISTRY": "us.icr.io",
    "NAME_SPACE": "ieam-samsung-colab",
    "IAMUSER": "iamapikey",
    "IAMAPIKEY": "",
    "SERVICE_NAME": "ieam-samsung",
    "ANAX_VERSION": "v2.30.0-1194",
    "HORIZON_AGENT": "horizon-agent-linux-deb-arm64.tar.gz",
    "REDHAT_VERSION": "9.1",
    "LABEL_STAGE": "stage=builder",
    "LABEL_VENDOR": "IBM",
    "LABEL_SUMMARY": "The agent in a general purpose container.",
    "LABEL_DESCRIPTION": "A container which holds the edge node agent, to be used in environments where there is no operating system package that can install the agent natively.",
    "HZN_EXCHANGE_URL": "https://cp-console.ieam42-edge-8e873dd4c685acf6fd2f13f4cdfb05bb-0000.us-south.containers.appdomain.cloud/edge-exchange/v1",
    "HZN_FSS_CSSURL": "https://cp-console.ieam42-edge-8e873dd4c685acf6fd2f13f4cdfb05bb-0000.us-south.containers.appdomain.cloud/edge-exchange/edge-css/",
    "HZN_ORG_ID": "samsung",
    "HZN_DEVICE_ID": "samsung-device-name",
    "HZN_EXCHANGE_USER_AUTH": "",
    "HZN_MGMT_HUB_CERT_PATH": "/etc/horizon/agent-install.crt",
    "HZN_AGENT_PORT": "8510",
    "HZN_AGBOT_URL": "https://cp-console.ieam42-edge-8e873dd4c685acf6fd2f13f4cdfb05bb-0000.us-south.containers.appdomain.cloud/edge-exchange/edge-agbot/",
    "HZN_SDO_SVC_URL": "https://cp-console.ieam42-edge-8e873dd4c685acf6fd2f13f4cdfb05bb-0000.us-south.containers.appdomain.cloud/edge-exchange/edge-sdo-ocs/api",
    "HZN_NODE_POLICY": "/etc/default/node.policy.json",
    "HZN_VAR_RUN_BASE": "/data/var/tmp/horizon",
    "PROVIDE_CERT": "/Users/jeff/sandbox/samsung/credential/agent-install-samsung.crt",
    "NODE_POLICY": {
      "properties": [
        {
          "name": "openhorizon.allowPrivileged",
          "value": true
        }
      ],	    
      "deployment": {
        "properties": [
          {"name": "auto-dock", "value": "Auto Dock"}
        ]
      }
    }
  }
}

After the command completed:

  • go to the DreamAgent on your phone and press the blue down arrow icon to start the container.

Alt text

  • Then select horizon container and select init from the dropdown and click SEND to generate the node policy
  • Then select register to register this device with the generated node policy

Alt text

  • The containerized applications/services should be up and running once the agreement is reached and deployment is complete.
  • Docker ps or from DreamAgent UI should show the apps that are running

Screen recording of Samsung Demo web app to showcase different use cases