Skip to content

Adding GenericBundle #687

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

Merged
merged 3 commits into from
May 15, 2025
Merged

Adding GenericBundle #687

merged 3 commits into from
May 15, 2025

Conversation

brnstz
Copy link
Collaborator

@brnstz brnstz commented May 13, 2025

Issue #, if available:

Description of changes:

Replace CodeRepoBundle with GenericBundle.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@brnstz brnstz requested review from rhernandez35 and adwsingh May 13, 2025 19:38
install: String
command: String
args: StringList

Choose a reason for hiding this comment

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

should we include a metadata field? We can use that to include codeRepo or other fields into it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could.... but why not model these fields directly when we need them?

Choose a reason for hiding this comment

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

I prefer not to model these fields directly since we're unsure if they'll be required for all generic bundles. A metadata map gives us more flexibility while we're still discovering what fields are truly core to all bundles. Once our bundle model becomes more defined and we better understand which fields are consistently needed, we can then move them into direct fields in the model

Copy link
Collaborator Author

@brnstz brnstz May 14, 2025

Choose a reason for hiding this comment

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

Hey Steven, this is the second time you mentioned this metadata field, so I don't want to discount it entirely since you've done most of the API work.

Still it looks like Richard and I both don't see the utility of having unmodeled metadata.

My main concern is that we're going to end up storing important data in metadata, people will start depending on it, then will will be stuck with it because we don't even have a way to deprecate a particular field.

As far as codeRepoUrl, I don't think we have a reason to store this currently.

Is there something I'm missing here?

structure GenericBundle with [CommonBundleConfig] {
binary: Blob
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't put the blob inside the bundle. It's going to be inflated by up to 33% during b64 encoding, and the resulting artifacts are going to be gigantic. I'd like to make this field a union to capture the two cases we have in mind right now:

union GenericArtifact {
  /// We need to call the registry again to download this artifact.
  binary: ArtifactId
  /// There's nothing to download. The bundle already contains everything we need
  /// to install and run the binary.
  empty: Unit
}

/// Describes an artifact stored in the registry
structure ArtifactId {
  version: String
  name: String
}

operation GetArtifact {
   input := {
     @required
     artifactId: ArtifactId
  }
  output := {
    @required
    payload: StreamingBlob
  }
}

We can add the download stuff later.

Copy link
Contributor

@adwsingh adwsingh May 14, 2025

Choose a reason for hiding this comment

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

+1. You can have something like the Location union we use in the MCP CLI. It isn't even necessary we might download the artifact from the registry service, it could also be something like a S3 Presigned URL or just null.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed we shouldn't expose the blob here.

Can we get away with.... ?

structure GenericBundle with [CommonBundleConfig] {
    artifactLocation: Location
    ....
}

union Location {
    /// A presigned S3 URL to download the artifact
    url: String
    /// If no download is necessary
    empty: Unit
}

And not need the GetArtifact operation?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have two problems with the presigned url:

  1. It directly exposes S3 as our storage medium when it should be an implementation detail. That would prevent us from doing something like adding caching for hot bundles in the future.
  2. Presigned URLs expire but we may need to re-download the artifact at any time (for example, if the user manually deletes the downloaded binary)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. I pushed another commit with this in mind. Main difference from what's posted here is that ArtifactId is simply an opaque string rather than a name/version. I am thinking we can generate unique strings for artifact download rather than requiring the user pass in the name/version structure

Comment on lines +41 to +42
union GenericArtifact {
empty: Unit
Copy link
Collaborator Author

@brnstz brnstz May 15, 2025

Choose a reason for hiding this comment

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

In interest of time, support only the "empty" format.

@franco2002lu franco2002lu merged commit 39966cd into main May 15, 2025
2 checks passed
@franco2002lu franco2002lu deleted the generic-bundle branch May 15, 2025 19:26
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.

5 participants