2

I uploaded many GitHub artifacts, causing the GitHub free storage space (50 GB) to run out.
Most of these artifacts were copies or had very small changes.

Assuming that these were stored in layers as diffs from parent images (like docker images are stored), it was unlikely that 50 GB of space would run out.

Are GitHub artifacts stored as individual files every time a workflow is run ?
Are GitHub packages stored in the same way ?
Is the storage for packages and artifacts the same ?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Harshit Nagar
  • 368
  • 3
  • 16

1 Answers1

2

GitHub's artifacts are usually linked with:

  • release: artifacts could be another term for "assets": files associated with a particular GitHub release (see Update a release asset for instance).
  • or workflow artifacts: An artifact is a file or collection of files produced during a workflow run. It allows you to persist data after a job has completed, and share that data with another job in the same workflow.
    As Edward Thomson (from GitHub) notes: "because they're meant to be used to move data between jobs in a workflow, workflow assets are not permanent".

GitHub Container Registry is dedicated to store and manage Docker and OCI images.

Only the latter benefit from incremental storage through layers.
The former would be uploaded as a all for each file.

From the comments below:

  • A workflow where one authenticates to GHCR (GitHub Container Registry) and push to the registry an image (docker push ghcr.io/OWNER/IMAGE_NAME:tag) will benefit from an incremental layer-by-layer storage.
  • This differ from a regular asset upload, where the artifact is stored as a all.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • GitHub Packages is a platform for hosting and managing packages, including containers and other dependencies. It offers GHCR to for optimized storage of docker and OCI images. So any image pushed to GHCR will benfit from incremental storage through layers. The workflow artifacts will be stored as a all for each file. Can you make the `release` point more clear ? - assets are the files associated with a particular release. But the file associated with a release is the docker file being pushed to ghcr itself. So is this stored as a whole or in layers – Harshit Nagar Nov 09 '21 at 11:22
  • 1
    @HarshitNagar Releases and assets predate GHCR and packages. A Dockerfile is just a text file. But the image produced by a workflow can be stored as layer, if explicitly pushed (`docker push ghcr.io/OWNER/IMAGE_NAME:tag`) to the GHCR, after authentication: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry – VonC Nov 09 '21 at 11:45
  • By file i did not mean Dockerfile. I meant the image. I Should have been clear about that. Thanks for the explanation. Have marked as accepted. – Harshit Nagar Nov 09 '21 at 11:54
  • Also, because they're meant to be used to move data between jobs in a workflow, workflow assets are not permanent. – Edward Thomson Nov 09 '21 at 13:09
  • @EdwardThomson Good point. I have included your comment in the answer for more visibility. – VonC Nov 09 '21 at 13:24