Coder Social home page Coder Social logo

kraken-hpc / krakenctl Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 83 KB

krakenctl is a command-line tool for viewing and manipulating running kraken instances.

License: BSD 3-Clause "New" or "Revised" License

Python 96.67% Dockerfile 3.33%
cli kraken python3

krakenctl's Introduction

krakenctl

krakenctl is a command-line tool for viewing and manipulating running kraken instances.

Running

krakenctl is Python3 based. It requires Python >= 3.7.

  1. Verify python version (must be >= 3.7):
    $ python3 --version
    Python 3.9.2
  2. Install dependencies:
    $ pip3 install pyyaml requests rich
    ...
  3. Run
    ./krakenctl.py -h
    usage: krakenctl.py [-h] [-v] [-d] [-i IP_ADDRESS] action ...
    
    positional arguments:
      action                Desired action to perform
        node                Get node details and manipulate node config
        sme                 Control the kraken SME
        runtime             Change kraken runtime settings
    
    optional arguments:
      -h, --help            show this help message and exit
      -v, --verbose         Provides more details (default: False)
      -d, --debug           Provides details of what krakenctl is doing (default: False)
      -i IP_ADDRESS, --ip IP_ADDRESS
                            IP address of Kraken instance (default: 127.0.0.1:3141)

Running with podman (or docker)

Note: instructions are for podman, but should work for docker as well.

  1. Make sure podman is installed and functional.

  2. podman pull docker.io/krakenhpc/krakenctl:latest

  3. alias krakenctl="podman run --rm -it --network=host krakenctl -i 127.0.0.1:3141"

    Replace 127.0.0.1:3141 with the IP/port for your kraken restapi if it's not running on localhost.

  4. Now run it!

       $ krakenctl -h
    usage: krakenctl.py [-h] [-v] [-d] [-i IP_ADDRESS] action ...
    
    positional arguments:
      action                Desired action to perform
        node                Get node details and manipulate node config
        sme                 Control the kraken SME
        runtime             Change kraken runtime settings
    
    optional arguments:
      -h, --help            show this help message and exit
      -v, --verbose         Provides more details (default: False)
      -d, --debug           Provides details of what krakenctl is doing (default: False)
      -i IP_ADDRESS, --ip IP_ADDRESS
                            IP address of Kraken instance (default: 127.0.0.1:3141)

krakenctl's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

krakenctl's Issues

Add a Dockerfile

This would allow us to deploy on, e.g. RHEL7 systems without worrying about python dependencies.

krakenctl node info <non-existent-id> crashes

When you run krakenctl node info on an ID that does not exist, the tool crashes instead of cleanly telling me that ID is invalid.

Example:
krakenctl node info fake-id123

Traceback (most recent call last):
  File "/krakenctl/krakenctl.py", line 335, in <module>
    main()
  File "/krakenctl/krakenctl.py", line 32, in main
    argument_manager.parse_args()
  File "/krakenctl/argument_manager.py", line 342, in parse_args
    args.func(non_defaults)
  File "/krakenctl/krakenctl.py", line 104, in node_list
    dsc_json = get_url(dsc_url, debug, verbose)
  File "/krakenctl/krakenctl.py", line 169, in get_url
    json = r.json()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.