1. When attempting to create a new slice, an error occurs.

When attempting to create a new slice, an error occurs.

Home Forums FABRIC General Questions and Discussion When attempting to create a new slice, an error occurs.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2147
    Arash SARABI
    Participant

      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’

      #2148
      Paul Ruth
      Keymaster

        This 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

        #2149
        Arash SARABI
        Participant

          Thank 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.

          #2150
          Paul Ruth
          Keymaster

            There 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

            #2151
            Arash SARABI
            Participant

              Thank 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.

              #2152
              Paul Ruth
              Keymaster

                Yes, 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, 6 months ago by Paul Ruth.
                #2154
                Arash SARABI
                Participant

                  Yes, 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: Failure

                  #2155
                  Paul Ruth
                  Keymaster

                    I 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’)

                     

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.