Home › Forums › FABRIC General Questions and Discussion › When attempting to create a new slice, an error occurs.
- This topic has 7 replies, 2 voices, and was last updated 2 years, 5 months ago by Paul Ruth.
-
AuthorPosts
-
June 18, 2022 at 12:31 pm #2147
When I attempt to make a new slice, I receive the following error:
any advice? (this is from Create and Submit a Slice notebook)
try:
slice = fablib.new_slice(name=”MySlice”)
node = slice.add_node(name=”Node1″)
slice.submit()
except Exception as e:
print(f”Exception: {e}”)
Exception: ‘NoneType’ object has no attribute ‘resources’June 18, 2022 at 1:18 pm #2148This is likely due to an update to the FABRIC control framework software that now requires you to specify the ID of the project that you want to use to create your slice. We understand that this error message is not very descriptive and are will update it soon.
Try adding the following to the first cell of your notebook:
os.environ[‘FABRIC_PROJECT_ID’]=<your_project_id>
The project ID can be found in the portal by selecting your project from the projects tab.
Also note that the example notebooks have been updated to include this environment variable. You may want to update your examples notebooks. The easiest way to do this is to delete the jupyter-examples folder in your Jupyter container and then stop/start your container (select File->Hub Control Panel)
Paul
June 18, 2022 at 4:17 pm #2149Thank you; that pretty much solved my problem. I also wondered how I could select the ISO (select ubuntu instead of RedHat) or even upload my preconfigured ISO file.
June 18, 2022 at 4:33 pm #2150There are few different images available. Ubuntu20 is one that is commonly used although 18, 21, and 22 are also available.
The example notebook called “Create Node” shows some extra parameters that can be used to customize a node. That notebook is in your JupyterHub container but you can also reference it here: https://github.com/fabric-testbed/jupyter-examples/blob/master/fabric_examples/fablib_api/create_node.ipynb
You just need to add a parameter to the call to
slice.add_node()
like this:node = slice.add_node(name='Node1', image='default_ubuntu_20')
We currently do not support uploading custom images. We might support it in the future. However, it is easy to create a notebook that automates starting a slice and running the
node.execute()
method to configure the nodes. We are working on some example notebooks the demonstrate best practices in deploying and configuring slices but they are not ready yet.Paul
June 18, 2022 at 10:20 pm #2151Thank you. Do you have any suggestions for transferring my Python file and running it on the node? (With JupyterLab)
The file is already on my jupyterLab.
June 19, 2022 at 6:19 am #2152Yes, look at the “node.upload_file()” method.
You can do the following:
my_node.upload_file(local_file_path='/path/to/file/in/jupyter/environment', remote_file_path='/destination/path/to/file/in/vm')
There is also a ‘download_file’ method and many more extras in FABlib. Checkout the Sphinx docs: https://learn.fabric-testbed.net/docs/fablib/fablib.html
- This reply was modified 2 years, 5 months ago by Paul Ruth.
June 19, 2022 at 3:25 pm #2154Yes, Thank you
still I am getting an error, (I checked both paths and everything looks good.)
try:
node1 = slice.get_node(name=node1_name)
node1.upload_file(local_file_path=os.environ[‘HOME’]+’/work/Server.py’, remote_file_path=’/home/ubuntu/’)except Exception as e:
print(f”Exception: {e}”)SCP upload fail. Slice: ArashTest3, Node: Node1, trying again
Fail: Failure
SCP upload fail. Slice: ArashTest3, Node: Node1, trying again
Fail: Failure
Exception: FailureJune 19, 2022 at 4:12 pm #2155I think the error is that it is trying to overwrite the /home/ubuntu dir in the VM. Try including the file name in the remote path like this:
node1.upload_file(local_file_path=os.environ[‘HOME’]+’/work/Server.py’, remote_file_path=’/home/ubuntu/Server.py’)
-
AuthorPosts
- You must be logged in to reply to this topic.