1. Not able to create slice

Not able to create slice

Home Forums FABRIC General Questions and Discussion Not able to create slice

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #6234
    Amanda Tomlinson
    Participant

      I have a simple notebook where I create the fablib_manager, check to see the environment variables are loaded with fablib.show_config(), then I try to create a slice with:

      slice = fablib.new_slice(name=slice_name)

      Which does not fail. However, trying to add nodes or manipulate the slice fails with the error message: “Exception: ‘NoneType’ object has no attribute ‘project_id'”

      When I call slice.show(), I get the following stack trace:

      ---------------------------------------------------------------------------
      AttributeError                            Traceback (most recent call last)
      Cell In[5], line 1
      ----> 1 slice.show()
      
      File ~/fabric/venv/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/slice.py:170, in Slice.show(self, fields, output, quiet, colors, pretty_names)
          141 def show(
          142     self, fields=None, output=None, quiet=False, colors=False, pretty_names=True
          143 ):
          144     """
          145     Show a table containing the current slice attributes.
          146 
         (...)
          167     :rtype: Object
          168     """
      --> 170     data = self.toDict()
          172     def state_color(val):
          173         if val == "StableOK":
      
      File ~/fabric/venv/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/slice.py:488, in Slice.toDict(self, skip)
          476 def toDict(self, skip=[]):
          477     """
          478     Returns the slice attributes as a dictionary
          479 
          480     :return: slice attributes as dictionary
          481     :rtype: dict
          482     """
          483     return {
          484         "id": str(self.get_slice_id()),
          485         "name": str(self.get_name()),
          486         "lease_end": str(self.get_lease_end()),
          487         "lease_start": str(self.get_lease_start()),
      --> 488         "project_id": str(self.get_project_id()),
          489         "state": str(self.get_state()),
          490     }
      
      File ~/fabric/venv/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/slice.py:864, in Slice.get_project_id(self)
          857 def get_project_id(self) -> str:
          858     """
          859     Gets the project id of the slice.
          860 
          861     :return: project id
          862     :rtype: String
          863     """
      --> 864     return self.sm_slice.project_id
      
      AttributeError: 'NoneType' object has no attribute 'project_id'

       

      It looks like all of my environment variables are correct. I generated a token right before running the code. My notebook is:

      from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
      
      fablib = fablib_manager(fabric_rc="/path/to/fabric_rc")
      fablib.show_config() # looks correct
      
      try:
      slice = fablib.new_slice(name=slice_name)
      except Exception as e:
      print(e)
      
      slice.show() # error

       

      #6236
      yoursunny
      Participant

        The entire FABRIC is red this week: https://portal.fabric-testbed.net/resources/all

        See notice here: https://learn.fabric-testbed.net/forums/topic/multi-day-fabric-maintenance-january-1-5-2024/

        Look at this part:

        On other sites, slices will continue running, and slivers will be accessible during the maintenance, however, we will place the testbed in maintenance mode between Jan 1-5, therefore it will not be possible to perform slice operations (create, extend, delete).

        #6237
        Mert Cevik
        Moderator
          #6262
          Amanda Tomlinson
          Participant

            Thank you both. I’m still unable to create slices today. I’ve re-generated my fabric token but I’m getting the same error as above. Is there anything else I need to do now that the maintenance is complete?

            #6263
            Mert Cevik
            Moderator

              Hello Amanda,

              Can you check the information on https://learn.fabric-testbed.net/forums/topic/fabric-testbed-is-open-and-ready-for-use/

              about the requirements.txt file and fablib update (fabrictestbed-extensions) ?

              #6265
              Paul Ruth
              Keymaster

                One thing to check…. Does your notebook contain an unmodified version of this line?:

                fablib = fablib_manager(fabric_rc="/path/to/fabric_rc") 

                If it does, you need to modify the path to point to your actual fabric_rc file.

                Paul

                #6272
                Amanda Tomlinson
                Participant

                  Thanks for the responses. I have updated to the latest version of fablib extensions, and I don’t have a requirements.txt in my environment (that I saw). And I do point to my fabric_rc. I attached a screenshot of my jupiter notebook.

                  Screenshot-from-2024-01-09-10-12-26

                  I have also tried restarting the kernel and restarting the jupiter notebook..

                  #6277
                  Paul Ruth
                  Keymaster

                    Can you try adding back in the following line and report the output?

                    fablib.show_config()

                    • This reply was modified 1 year, 1 month ago by Paul Ruth.
                    #6279
                    Amanda Tomlinson
                    Participant

                      Screenshot-from-2024-01-09-10-36-56

                      #6282
                      Amanda Tomlinson
                      Participant

                        Also, it looks like I am able to create slices on JupiterHub, which is on version 1.6.0. I can try upgrading if there is a newer release.

                        #6287
                        Paul Ruth
                        Keymaster

                          I think I see the issue now.

                          In your example you have something like:

                          from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
                          fablib = fablib_manager()
                          slice = fablib.new_slice(name='MySlice')
                          slice.show()

                          The problem is that when you are calling slice.show() the slice does not yet exist.  You need to create the slice first.  Add some nodes/networks something like the following:

                          from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
                          fablib = fablib_manager()
                          slice = fablib.new_slice(name='MySlice')
                          node = slice.add_node(name='node1', site='STAR', image="default_rocky_8" )
                          slice.submit()
                          slice.show()

                          This should work.  That said, I think you should be able to slice.show() a slice that is only half built and has not been submitted yet.  This is a bug that we will look into.

                          Let me know if this works for you.

                          • This reply was modified 1 year, 1 month ago by Paul Ruth.
                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.
                        FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

                        KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)
                        FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

                        KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)