1. Can’t make first slice using Portal interface

Can’t make first slice using Portal interface

Home Forums FABRIC General Questions and Discussion Can’t make first slice using Portal interface

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #2054
    Nicholas Bastin
    Participant

      The docs (https://learn.fabric-testbed.net/knowledge-base/portal-slice-builder-user-guide/) lead me to believe that I should see a “Create Slice” button on the “Experiments” tab. However, all I get is a nice warning box that says it can’t find my slice, sending me to a bunch of places to learn how to make one (screenshot attached).

      I can hopefully just make one using the API, so this isn’t a pressing issue for me.

      #2056
      Paul Ruth
      Keymaster

        Try the JupyterHub tab/link.  After it opens, click the “start_here”  notebook in the “jupyter_examples”  folder.  Then click the “Hello, FABRIC” example notebook.

        After you get that running, try all the more advanced networking-focused notebooks.

        Paul

        #2057
        Nicholas Bastin
        Participant

          So I tried that, now I’m getting:

          SliceManagerException: (invalid_grant) invalid refresh token

          I thought perhaps this was because apparently I’m not a member of projects I create by default, so I added myself as a member, but that didn’t make a difference (or at least, I’m not sure if it would – this might be something that has to sync up somehow, I have no idea…).

          #2058
          Paul Ruth
          Keymaster

            The token should have been created when you authenticated against cilogon when logging into JupyterHub. By default only one token is live in a JupyterLab session and you can’t run multiple notebooks concurrently (there are work arounds but by default it won’t work).

            Try hitting the “restart kernel” button in the JupyterNotebook (or select Kernel->Restart Kernel from the menu bar).   This should re-read the token in the current notebook.  If that doesn’t work you might have a corrupted token and will need to log out/in to re-authenticate and get a new token.

            #2059
            Nicholas Bastin
            Participant

              I may have tried to hack around this in a bad way…I uploaded tokens that I generated from the portal. Things have changed, possibly not for the better – now I’m getting:


              /opt/conda/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/resources.py in update(self)
              423
              424 """
              --> 425 return_status, topology = fablib.get_slice_manager().resources()
              426 if return_status != Status.OK:
              427 raise Exception("Failed to get advertised_topology: {}, {}".format(return_status, topology))
              AttributeError: 'NoneType' object has no attribute 'resources'

              It did however let me make a slice…

              #2060
              Nicholas Bastin
              Participant

                That may have been optimistic – it returned me a slice object and I can introspect it a very little bit, but the sm_slice attribute is None, so nothing works.

                #2061
                Paul Ruth
                Keymaster

                  It should work as long as your FABRIC_TOKEN_LOCATION env var is pointed at a valid token before you import the fablib library.   By default, when you log into the JupyterHub, a new token will be put at ~/.tokens.json and FABRIC_TOKEN_LOCATION will point there.

                  You can grab another token from the portal you can use it in another notebook by setting the FABRIC_TOKEN_LOCATION env var in the top cell of the other notebook.  Also, if you want to install the fablib library somewhere else (like your laptop) you will need to explicitly set the token location to wherever you put the token.

                  We tried to make this really transparent to the user but I think we will need to add an explicit call to set the token in a notebook to make it more clear.

                   

                  #2062
                  Nicholas Bastin
                  Participant

                    I actually did this – the commented out lines in the os.environ section of the notebook had the token location, so I changed mine to os.environ['FABRIC_TOKEN_LOCATION']=os.environ['HOME']+'/portal-tokens.json', but it’s pretty unhappy about this. Changing it back to .tokens.json doesn’t generate a new file either… I tried logging all the way out of both jhub and the portal, but it didn’t change anything.

                    #2065
                    Paul Ruth
                    Keymaster

                      Also, the example notebooks are automatically pulled from the following link when you start your JupyterHub container.

                      https://github.com/fabric-testbed/jupyter-examples

                      If you want to fully reset your JupyterHub container you can “rm -rf ~/work/jupyter-examples”, then stop/start your container (File->Hub Control Panel), then log out/in.

                      Restarting the container with a missing ~/work/jupyter-examples dir will re-pull the github repo.  Logging out/in will get a new token.

                      Of course, you can do all that manually by using git commands and pulling a new token from the portal.

                      #2066
                      Paul Ruth
                      Keymaster

                        Ah… you need to think about a Jupyter notebook like a live Python app that is that is in a debugger.  Even if you go back the the top cell, all the values remain. If you want to reset all the vars and env vars (i.e. if you comment out the token path), then you need to restart the notebook kernel.  Otherwise residual values will be in subsequent runs.

                        Try setting all the tokens values, then restarting the notebook’s kernel, then start from the top.

                         

                        #2067
                        Nicholas Bastin
                        Participant

                          We use jupyter a lot, so I’m familiar with resetting the kernel and such.. 🙂

                          That being said, it’s working now – I had to go to the hub control panel and manually kill my server. Possibly you have to wait some time period after logging out before logging back in to get it to refresh otherwise?

                          #2069
                          Paul Ruth
                          Keymaster

                            I wonder if this has to do with the project you just created.  We just added some permission limiting to the projects and yours has the default (i.e. minimal permissions).

                            I just added you to the “FABRIC Tutorial” project.  Try using that one and see if that works.

                            Paul

                            #2079
                            Yaxue Guo
                            Keymaster

                              Hi Nick,

                              Thanks for pointing out this usability issue! Your opinion is insightful and really matters to us.  I’ve updated the user guide for now to include screenshots and guidance for users with no project/ no slice. In the callout message you mentioned saying “We couldn’t find your slice. Please create slices from Portal or JupyterHub …” The links to portal slice builder and JupyterHub are clickable and will lead you to corresponding pages. I’ll also update this callout message to include an obvious “Create Slice” button soon as a request added to this Github issue, then update the guide article accordingly.

                              Yaxue

                              #2084
                              Nicholas Bastin
                              Participant

                                The portal builder is clickable to documentation, but you cannot follow those instructions, as I noted above, if you don’t already have at least one slice. Your new documentation does not work if you have never created a slice – even in your screenshots you have a slice, which is a requirement for the create slice button to appear and work.

                                #2087
                                Yaxue Guo
                                Keymaster

                                  This screenshot has been added to the guide article. And clicking the link of “Portal” in the red square will lead you to the slice builder page(same effect as clicking on “Create Slice” button in the other case for users with existing slices). This UI will be improved soon by adding buttons “Create Slice in Portal” and “Create Slice in JupyterHub” (Github ticket). But for now could you please click the link and try slice builder? Thanks!

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