1. Timothy Middelkoop

Timothy Middelkoop

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: fabric-cli does not produce valid JSON #3150
    Timothy Middelkoop
    Participant

      I just pushed an update to the PR

      Thanks for the comments.  I think I address most of the issues (I did not get mypy to work in the time I had allocated for this) but I added some conditions that should make a static checker happy and some other fixes.

      I also just fixed fabric-cli slices delete – I did not test yesterday due to the workshop 😀

       

      in reply to: Unable to manage slivers with fabric-cli #3143
      Timothy Middelkoop
      Participant
        in reply to: fabric-cli does not produce valid JSON #3142
        Timothy Middelkoop
        Participant
          in reply to: fabric-cli does not produce valid JSON #3125
          Timothy Middelkoop
          Participant

            I use Python directly most of the time but sometimes it’s nice to have a simple script to grab the IP of a slice/node from the command line.  This is what I would do in the past to grab the management IP to then kick off some ssh based tools as follows (yes, I could write this in python but bash/jq is my hammer of choice):

            SLICEID=$(fabric-cli slices query --state=StableOK | jq -r '.[0].slice_id') ; echo $SLICEID
            IP=$(fabric-cli slivers query --sliceid=$SLICEID | jq -r '.[0].sliver' | jq -r '.MgmtIp') ; echo $IP
            

            Would you consider a pull request that did a json.dumps() to format the output?

            Thanks.

             

            in reply to: slice.submit(wait=True) fails #2123
            Timothy Middelkoop
            Participant

              I am still able to replicate it. Here is the code.

              ## Dump Config
              for i in ['FABRIC_PROJECT_ID']:
                  print(f'{i}={os.environ}')
              
              ## Ping auth test
              print(fablib.get_site_names())
              
              ## Create slice
              slice = fablib.new_slice(name="oneslice")
              node = slice.add_node(name="node1", image="default_ubuntu_22")
              
              slice.submit(wait=True) # Change to False to run correctly.
              
              print(slice)
              slice.wait_ssh()
              slice.test_ssh()
              
              print(node)
              

              The environment is built via the following:

              python3 -m venv .venv
              . .venv/bin/activate
              python3 -m pip install --upgrade pip
              python3 -m pip install git+https://github.com/fabric-testbed/fabric-cli.git
              python3 -m pip install git+https://github.com/fabric-testbed/fabrictestbed-extensions.git
              

              All config-values are set via env. I have a complete example w/ docs if you want.

              It’s run on MACOS, tools installed via brew.

              (.venv) tmiddelkoop@tmiddelkoopsMBP fabric % python3 --version
              Python 3.9.13
              
              in reply to: Fablib threading/concurrency #2121
              Timothy Middelkoop
              Participant

                Great – I’ll port my change back to that when it’s released (it ended up being not so hard to do it on the node). (I did and do not expect a fully thread-safe version of the library – I know how hard that can be).

                in reply to: Installing software in jupyter instance? #2100
                Timothy Middelkoop
                Participant

                  I would also be interested in adding curl and jq

                Viewing 7 posts - 1 through 7 (of 7 total)