start tests

This commit is contained in:
Josh Yan
2024-07-02 10:41:31 -07:00
parent 0e01da82d6
commit 46b76aeb46
3 changed files with 121 additions and 0 deletions

View File

@@ -277,12 +277,34 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string) (string, er
}
digest := fmt.Sprintf("sha256:%x", hash.Sum(nil))
// Here, we want to check if the server is local
// If true, call, createBlobLocal
// This should find the model directory, copy blob over, and return the digest
// If this fails, just upload it
// If this is successful, return the digest
// Resolve server to IP
// Check if server is local
if client.IsLocal() {
err := createBlobLocal(cmd, client, digest)
if err == nil {
return digest, nil
}
}
if err = client.CreateBlob(cmd.Context(), digest, bin); err != nil {
return "", err
}
return digest, nil
}
func createBlobLocal(cmd *cobra.Command, client *api.Client, digest string) error {
// This function should be called if the server is local
// It should find the model directory, copy the blob over, and return the digest
}
func RunHandler(cmd *cobra.Command, args []string) error {
interactive := true