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

Fetch RSE info from Rucio and save to a file #892

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

d-ylee
Copy link
Contributor

@d-ylee d-ylee commented Feb 18, 2025

Would close #770

Currently in progress.

The script can first fetch RSE settings and attributes from Rucio. Will have to use the RSEClient to update settings with update_rse and attributes with delete_rse_attribute and then add_rse_attribute.

The json looks like this:

{
    "settings": {
        "setting1": "1",
        "setting2": "2",
    },
    "attributes": {
        "attribute1": "1",
        "attribute2": "2"
    }
}

The question is where should we store the settings file. As with consistency checker and protocols, we could also use SITECONF in the CERN Gitlab instance.

@d-ylee d-ylee marked this pull request as draft February 18, 2025 21:15
Copy link
Member

@ericvaandering ericvaandering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a good start for a draft PR


returns a dict of settings and attributes
'''
rseinfo = client.get_rse(rse=rse)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res_info

usage and limits are unused, right?


def set_rse_settings(rse: str, config: dict, dry_run: bool = True):
'''
Setts RSE settings and attributes from a config dict
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sets

current_settings, current_attrs = get_info_from_rucio(rse)

# update settings
# TODO: Handle KeyError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

except Duplicate:
print(f'{attribute} already exists')


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings is still coming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Sync RSE setting from a git repository
2 participants