GithubHelp home page GithubHelp logo

pmbanugo / crow-registry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chainguard-dev/crow-registry

0.0 1.0 0.0 113 KB

an OCI Registry on Cloudflare Workers🏋️‍♀️

License: Apache License 2.0

JavaScript 2.72% TypeScript 97.28%

crow-registry's Introduction

🏋️‍♂️CRoW: an OCI Registry on Cloudflare Workers🏋️‍♀️

Build

This is an experimental prototype OCI registry on Cloudflare Workers, aiming to use Cloudflare's R2 for egress-cost-free image distribution.

This is an unsupported prototype

This repo was used to assess the feasibility of using Cloudflare R2 as the basis for an OCI registry, running the serving components on Cloudflare Workers written in TypeScript.

The experiment worked (yay!!), but we don't expect to proceed with this code, so it's available as open source for anybody interested in trying it out.

Feel free to send PRs -- there are some notable TODOs! -- but also feel free to fork it and use it however you want.

👩 💻 Developing

You must use wrangler to develop this.

npm install -g wrangler

Getting Started

Create a Cloudflare account, and purchase a pay-as-you-go R2 plan.

...and update wrangler.toml to set your account ID.

Create two KV namespaces, for tags and manifests:

wrangler kv:namespace create TAGS
wrangler kv:namespace create MANIFESTS

...and update wrangler.toml as described.

Create an R2 bucket:

wrangler r2 bucket create crow-testing-${USER}

...and update wrangler.toml to bind to that bucket.

🧪 Testing

There are some jest tests. npm install -g jest and run npm test to run them.

✏️ Formatting

This template uses prettier to format the project. To invoke, run npm run format.

👀 Previewing and Publishing

wrangler dev for local preview.

crane cp alpine 127.0.0.1:8787/alpine
crane manifest 127.0.0.1:8787/alpine

wrangler publish to deploy for real.

crane cp alpine crow.MY-USER.workers.dev/alpine
crane manifest crow.MY-USER.workers.dev/alpine

🚮 Teardown

wrangler delete
wrangler r2 bucket delete crow-testing-${USER}
wrangler kv:namespace delete TAGS
wrangler kv:namespace delete MANIFESTS

TODOs

  • Auth! Currently anybody can push or pull.
  • Cross-repo blob mounting
  • Observability / monitoring / alerting
  • Blob GC? TTL?
  • OCI conformance
  • Backups?

Note: the R2 bindings for Cloudflare Workers don't support redirecting to presigned URLs served by Cloudflare directly, so this serves blob contents through the Worker, meaning it's billed for CPU-seconds used while serving blobs.

crow-registry's People

Contributors

imjasonh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.