Giter Site home page Giter Site logo

globus / globus-automate-client Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 5.0 1.97 MB

Client CLI and Python SDK for the Globus Automate Suite of Services

Home Page: https://globus-automate-client.readthedocs.io

License: Apache License 2.0

Makefile 0.69% Python 99.31%

globus-automate-client's People

Contributors

ada-globus avatar dependabot[bot] avatar jakeglobus avatar jimpruyne avatar joshbryan-globus avatar kurtmckee avatar lei514 avatar leiglobus avatar nickolausds avatar rudyardrichter avatar seren avatar sirosen avatar urimandujano avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

globus-automate-client's Issues

Flows fail when using a non-advertised auth scope

Flows fail when using a non-advertised auth scope. The error is "For RunAs value User, unable to get tokens for scopes". Below are the steps to reproduce.

  1. Create an app on developers.globus.org Screenshot from 2022-07-08 08-52-38
  2. Create an auth scope definition Screenshot from 2022-07-08 09-03-35
  3. Create the scope Screenshot from 2022-07-08 09-03-55
  4. Add the new scope and client id/secret to the action provider code
  5. Running a single action using the new action provider will work Screenshot from 2022-07-08 09-23-53 Screenshot from 2022-07-08 09-36-53
  6. Create a flow that uses the action Screenshot from 2022-07-08 09-43-35
  7. Deploy the flow Screenshot from 2022-07-08 09-41-44 Screenshot from 2022-07-08 09-42-56
  8. Run the flow. This will trigger the error and prevent it from running Screenshot from 2022-07-08 09-44-58 Screenshot from 2022-07-08 09-46-20

Flow will not run after updating with a new ActionScope

Version: globus-automate 0.16.1.post1

If you update a flow with globus-automate flow update, and your update references a new ActionScope, the flow will not run. It will throw this error:

{
  "error": {
    "code": "FLOW_INPUT_ERROR",
    "detail": "For RunAs value User, unable to get tokens for scopes {'https://auth.globus.org/scopes/5fac2e64-c734-4e6b-90ea-ff12ddbf9653/notification_notify'}"
  },
  "debug_id": "8991ab0f-05a0-4382-9e7c-5f259cbe5da7"
}

I think perhaps this is a bug, and it should ask for the new permissions instead of throwing an error. As a workaround, resetting everything withglobus-automate session logout and then providing a globus authorization code twice seems to do the trick.

Support User-Supplied Authorizers for Action and Flows Clients

The toolkit's current implementation uses the fair-research native login package to handle retrieving and storing tokens and creating an authorizer on behalf of the caller. On every call to Flow methods, the library will attempt to lookup the appropriate tokens and create an authorizer for that call.

The requested use case is to allow SDK users to perform various Flow/Action operations with their own client credentials and authorizer. This should be supported directly in the SDK to support scenarios where there is no local filesystem to store/load tokens or scenarios in which it isn't desirable to trigger an authorization flow as part of the Flow operation.

[ch5252]

globus-automate-client doesn't install using pip on python 3.10 or 3.11

Tried to install globus-automate-client in a clean virtual environment using the following commands;

pip install --upgrade pip setuptools wheel
pip install globus-automate-client

This results in a failure. Any ideas?

└─(14:38:58)──> pip install globus-automate-client                                                                                                                                                                                                                                                                                                                         ──(Wed,Jul19)─┘
Collecting globus-automate-client
  Using cached globus_automate_client-0.17.0-py3-none-any.whl (54 kB)
Collecting PyYAML<6.0.0,>=5.3.1 (from globus-automate-client)
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [62 lines of output]
      /tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!

              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/home/allsoppj/Repositories/temp/test_loading_globus_automate_client/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/allsoppj/Repositories/temp/test_loading_globus_automate_client/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/allsoppj/Repositories/temp/test_loading_globus_automate_client/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 314, in run
          self.find_sources()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
          mm.run()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 551, in run
          self.add_defaults()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
        File "<string>", line 201, in get_source_files
        File "/tmp/pip-build-env-nvbf18tv/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Unable to display flows in 0.13.0b1

I've installed globus-automate version 0.13.0b1 via pip. When I try to display any of the flows I've created, I get the following traceback:

$ globus-automate flow display 34164209-7d50-4fbc-8549-d0f9db70e8cc

Traceback (most recent call last):
  File "/home/david/venvs/cfde/bin/globus-automate", line 8, in <module>
    sys.exit(app())
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/flows.py", line 526, in flow_display
    rr.render_as_result(flow_dict)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 435, in render_as_result
    globus_resp = GlobusHTTPResponse(resp)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_sdk/response.py", line 62, in __init__
    raise ValueError("Missing client with normal response")
ValueError: Missing client with normal response

Verbose mode breaks some commands

Using the -v flag breaks some commands (tested with 0.13.0b1 installed via pip)

For example, the commands below result in a traceback:

$ globus-automate flow get 23392c51-17b6-4558-bb56-dc915e1faf39 -v
$ globus-automate flow list -v
Traceback (most recent call last):
  File "/home/david/venvs/cfde/bin/globus-automate", line 8, in <module>
    sys.exit(app())
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/flows.py", line 459, in flow_list
    RequestRunner(
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 441, in run_and_render
    self.render(result)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 421, in render
    Renderer(
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 370, in render
    d = self.details_as_text
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 309, in details_as_text
    return Text(self.result.details, style=self.detail_style)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/rich_helpers.py", line 247, in details
    return get_http_details(self.result)
  File "/home/david/venvs/cfde/lib/python3.8/site-packages/globus_automate_client/cli/helpers.py", line 40, in get_http_details
    base_request = result.data["request"]
KeyError: 'request'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.