Home › Forums › FABRIC General Questions and Discussion › Not able to create slice
- This topic has 10 replies, 4 voices, and was last updated 10 months, 2 weeks ago by Paul Ruth.
-
AuthorPosts
-
January 2, 2024 at 7:07 pm #6234
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
- This topic was modified 10 months, 3 weeks ago by Amanda Tomlinson.
January 2, 2024 at 7:13 pm #6236The 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).
January 2, 2024 at 7:14 pm #6237FABRIC is under maintenance. Details are on https://learn.fabric-testbed.net/forums/topic/multi-day-fabric-maintenance-january-1-5-2024/
January 8, 2024 at 3:23 pm #6262Thank 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?
January 8, 2024 at 3:57 pm #6263Hello 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) ?
January 8, 2024 at 4:11 pm #6265One 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
January 9, 2024 at 1:16 pm #6272Thanks 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.
I have also tried restarting the kernel and restarting the jupiter notebook..
January 9, 2024 at 1:33 pm #6277Can you try adding back in the following line and report the output?
fablib.show_config()
- This reply was modified 10 months, 2 weeks ago by Paul Ruth.
January 9, 2024 at 1:37 pm #6279January 9, 2024 at 1:39 pm #6282Also, 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.
January 10, 2024 at 7:53 am #6287I 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 10 months, 2 weeks ago by Paul Ruth.
-
AuthorPosts
- You must be logged in to reply to this topic.