-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add support for OCI engine #914
base: master
Are you sure you want to change the base?
Conversation
49c2e66
to
ba9255f
Compare
require 'minitar' | ||
require 'zlib' | ||
|
||
class ProcessDockerImageWorker < BaseWorker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worker should be in a high_memory
queue.
576478c
to
39740c4
Compare
reverts commit 04dabba.
7758cb0
to
a4c8292
Compare
app/controllers/api/v1/release_engines/oci/manifests_controller.rb
Outdated
Show resolved
Hide resolved
a4c8292
to
306a26c
Compare
- oci expects any manifest to be referenceable not just the index
ff1fc3e
to
f106a2c
Compare
db/migrate/20241114163421_add_content_attributes_to_release_manifests.rb
Show resolved
Hide resolved
@buffer.clear | ||
end | ||
|
||
buffer.empty? ? nil : buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buffer.presence
should suffice?
# a Minitar::Reader, and that closes an entry's reader io after | ||
# reading the entry. This lets us avoid buffering entries into | ||
# memory, since some of the blobs could be large layers. | ||
io.each do |entry| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move all this outside of initializer?
io.rewind | ||
end | ||
|
||
def each(&) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add return to_enum(:each) unless block_given?
?
db/migrate/20241114163421_add_content_attributes_to_release_manifests.rb
Outdated
Show resolved
Hide resolved
disable_ddl_transaction! | ||
|
||
def change | ||
add_column :release_manifests, :content_path, :string, null: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually make these not-null.
|
||
class ProcessOciImageWorker < BaseWorker | ||
MIN_TARBALL_SIZE = 512.bytes # to avoid processing empty or invalid tarballs | ||
MAX_TARBALL_SIZE = 512.megabytes # to avoid downloading excessive tarballs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unlikely to be sufficient for some applications, but I feel like it's a good default. Maybe bumping it up to 1GB would be fine, since I've seen quite a few 800MB images. I think we should eventually add a max artifact size to accounts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E.g. Sentry is 250MB, Plausible is 50MB, Keygen is 90MB, Cal.com is 1.4GB, Caddy on Windows is 2.2GB and 80MB on Linux, and PostHog is 1.5GB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add max_upload
for individual uploads, and max_ingress
and max_egress
for monthly ingress/egress limits (which can be handled like max_reqs
).
04e8ccb
to
8a3a382
Compare
Closes #911. In the end, it should be as simple as
docker save keygen/api:1.0.0 > keygen-1.0.0.tar
andkeygen upload keygen-1.0.0.tar
— the rest should be automatically handled by the OCI engine.Like with npm and friends,
docker push
will not be supported right away.Prereqs
docker buildx
.OCI_TEST_PULL=1
).1Subreqs
oci.pkg.keygen.sh
subdomain.Footnotes
Results from OCI conformance test can be found here. ↩