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

CI add cron job to CI #56

Merged
merged 4 commits into from
Jul 26, 2022
Merged

CI add cron job to CI #56

merged 4 commits into from
Jul 26, 2022

Conversation

adrinjalali
Copy link
Member

Fixes #49

Only delete repos which haven't been touched for the past week, every night.

@adrinjalali
Copy link
Member Author

I think we need to merge this and then test if it works. cc @skops-dev/maintainers

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Agree, let's just try if it works and adjust if not. What's the worst that can happen :)

print(f"deleting {model_info.modelId}")
info = client.model_info(model_info.modelId, token=token)
age = (
datetime.datetime.now(datetime.timezone.utc) - pd.to_datetime(info.lastModified)
Copy link
Collaborator

@BenjaminBossan BenjaminBossan Jul 26, 2022

Choose a reason for hiding this comment

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

If you don't want a pandas dependency to run the script, you could parse the time info as:

datetime.datetime.fromisoformat(info.lastModified.rsplit('.', 1)[0])

Copy link
Member Author

Choose a reason for hiding this comment

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

That actually reminded me that I was missing the huggingface_hub dependency here. Added that.

I changed to your version, but it's not the same as before, since it's now ignoring timezone info. Not a big deal in this case though.

Happy for this to be merged.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, we could add the tz back but it's not that important.

@BenjaminBossan BenjaminBossan merged commit c73f635 into skops-dev:main Jul 26, 2022
@adrinjalali adrinjalali deleted the clean branch July 26, 2022 10:45
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.

Run the clean script regularly to remove old stale repos
2 participants