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

Archive builds #1049

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Archive builds #1049

wants to merge 11 commits into from

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Jan 16, 2025

Fixes #947

Depends on #1047 and #1048

Description

This PR adds the ability to archive builds. To archive a build means to:

  • delete all artifacts except the build log and the lockfile
  • marks the build status as ARCHIVED
  • sets the build archived_on field

Using the REST api

$ export CS_TOKEN=<get a conda-store api token>

# look at existing builds
$ curl  --header "Authorization: bearer ${CS_TOKEN}" http://localhost:8080/conda-store/api/v1/build/ | jq

# choose a build from the output above to archive
$ curl -X POST  --header "Authorization: bearer ${CS_TOKEN}" http://localhost:8080/conda-store/api/v1/build/<build_id>/archive/ | jq

# inspect the build to verify that artifacts have been deleted + metadata has been updated
$ curl  --header "Authorization: bearer ${CS_TOKEN}" http://localhost:8080/conda-store/api/v1/build/<build_id>/ | jq

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for conda-store ready!

Name Link
🔨 Latest commit ff43c19
🔍 Latest deploy log https://app.netlify.com/sites/conda-store/deploys/67885685ac57d700080eea95
😎 Deploy Preview https://deploy-preview-1049--conda-store.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for conda-store canceled.

Name Link
🔨 Latest commit 41d0aaa
🔍 Latest deploy log https://app.netlify.com/sites/conda-store/deploys/67893ea826ae040008ee751b

with conda_store.session_factory() as db:
build = api.get_build(db, build_id)

archive_save_artifacts = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a setting to allow users to configure what artifacts should be deleted when a build is deleted. Should we add a setting that allows users to customize what artifacts are deleted on archive as well?

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

Successfully merging this pull request may close these issues.

[ENH] - Implement archiving of old builds
1 participant