Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
16 stars 4 forks source link

Make script/command/something that can turn a published DLHub model into a Garden entrypoint #401

Closed WillEngler closed 5 months ago

WillEngler commented 5 months ago

We'll need a script or utility in Garden to do the core part of the migration.

Given a published funcx function id for a DLHub model plus metadata, create a Garden entrypoint that calls the already-registered function.

Assumptions:

1. 2.

Acceptance Criteria

Given..., when..., then...

kjschmidt913 commented 5 months ago

scripts for migrating past DLHub models, updating models, etc: https://github.com/blaiszik/dlhub_publish/tree/main/utils

kjschmidt913 commented 5 months ago

For testing models: if any of the models are mentioned in this repo, there will be a testing cell with test input in one of the notebooks. If they import data or pre process the data in some way, just take the dimensions of the input and call it with numpy.zeros to simplify. The important part is calling it with the correct input shape

WillEngler commented 5 months ago

Here's a working proof of concept. Given a working DLHub model, we can make it invokable as a Garden entrypoint like so. (This is a method on GardenClient)

def make_entrypoint_from_function_id(self, fid: str, entrypoint_metadata: EntrypointMetadata) -> str:
        kludge_entrypoint = RegisteredEntrypoint(
            **entrypoint_metadata.dict(), 
            func_uuid=fid, 
            container_uuid=fid
        )
        local_data.put_local_entrypoint(kludge_entrypoint)
        print("Added")
WillEngler commented 5 months ago

Calling this done now that we have this ingredient - moving on to containers