Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Python client without configuration file #6410

Closed
SergeyYakubov opened this issue Dec 7, 2023 · 1 comment · Fixed by #6520
Closed

Using Python client without configuration file #6410

SergeyYakubov opened this issue Dec 7, 2023 · 1 comment · Fixed by #6520
Assignees
Milestone

Comments

@SergeyYakubov
Copy link
Contributor

Description

Currently, the Rucio client requires the presence of a configuration file to make it work properly. It would be very useful if that was not the case and the library worked properly without it.

Motivation

We at Oak Ridge National Laboratory are trying to create a Rucio storage plugin for Galaxy (https://galaxyproject.org/). It works nicely, but we have to put a Rucio configuration file at a known location. This makes it hardly possible to use with dynamical parameters, in tests, etc. Even if the client allows to add some parameters during the constructor call, it still wants to read the config file and fails when it is not there. In some situations even from rucio.client import Client wants to read config file to get logging info (sometimes it works, though, I'm not sure what the difference is - probably depends on log configuration).

Change

Add an option to get rid of the config file and use only constructor parameters. Get rid of using config file during import calls, pass config parameters used during client construction to inner functions/classes, ...

@bari12
Copy link
Member

bari12 commented Dec 22, 2023

Hi @SergeyYakubov

I believe we looked into that already once, but I cannot find the issue/reference now. In any way, I agree it is a good idea.

@voetberg voetberg self-assigned this Jan 9, 2024
voetberg added a commit to voetberg/rucio that referenced this issue Feb 28, 2024
Changes:
	* Change verification of "is_client" to not rely on finding a
	  config file
	* Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
	  Error
	* Added typing for baseclient, initialization broken into
	  functions to avoid typing conflicts for optionals.
	* Aded test to run multiple client commands without
	  configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Feb 28, 2024
Changes:
            * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
              Error, config_get correctly handles those and returns a
default client config
            * Added typing for baseclient, initialization broken into
              functions to avoid typing conflicts for optionals.
            * Aded test to run multiple client commands without
              configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Feb 29, 2024
Changes:
            * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
              Error, config_get correctly handles those and returns a
default client config
            * Added typing for baseclient, initialization broken into
              functions to avoid typing conflicts for optionals.
            * Aded test to run multiple client commands without
              configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Feb 29, 2024
Changes:
            * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
              Error, config_get correctly handles those and returns a
default client config
            * Added typing for baseclient, initialization broken into
              functions to avoid typing conflicts for optionals.
            * Aded test to run multiple client commands without
              configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Mar 22, 2024
Changes:
            * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
              Error, config_get correctly handles those and returns a
default client config
            * Added typing for baseclient, initialization broken into
              functions to avoid typing conflicts for optionals.
            * Aded test to run multiple client commands without
              configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Mar 22, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Mar 25, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
voetberg added a commit to voetberg/rucio that referenced this issue Mar 26, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
@bari12 bari12 closed this as completed in ab8dfce Apr 8, 2024
bari12 pushed a commit that referenced this issue Apr 8, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
@bari12 bari12 linked a pull request Apr 8, 2024 that will close this issue
@bari12 bari12 added this to the 34.2.0 / 34.1.1 milestone Apr 8, 2024
voetberg added a commit to voetberg/rucio that referenced this issue Apr 15, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
Thysk pushed a commit to Thysk/rucio that referenced this issue Apr 17, 2024
    Changes:
                * Change `RuntimeError(Config Not Found)` to `ConfigNotFound`
                  Error, config_get correctly handles those and returns a
    default client config
                * Added typing for baseclient, initialization broken into
                  functions to avoid typing conflicts for optionals.
                * Aded test to run multiple client commands without
                  configuration file in place, include func dectorator for extended testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants