-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: python/go grpc interface for async uploads
Signed-off-by: Andreas Jansson <[email protected]>
- Loading branch information
1 parent
d977c74
commit fceb76b
Showing
64 changed files
with
7,078 additions
and
1,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/replicate/replicate/go/pkg/shared" | ||
"github.com/replicate/replicate/go/pkg/cli" | ||
"github.com/replicate/replicate/go/pkg/console" | ||
) | ||
|
||
func main() { | ||
shared.Serve() | ||
cmd := cli.NewDaemonCommand() | ||
if err := cmd.Execute(); err != nil { | ||
console.Fatal("%s", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cli | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/replicate/replicate/go/pkg/project" | ||
"github.com/replicate/replicate/go/pkg/shared" | ||
) | ||
|
||
func NewDaemonCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "replicate-daemon <socket-path>", | ||
RunE: runDaemon, | ||
} | ||
setPersistentFlags(cmd) | ||
addRepositoryURLFlag(cmd) | ||
return cmd | ||
} | ||
|
||
func runDaemon(cmd *cobra.Command, args []string) error { | ||
socketPath := args[0] | ||
|
||
projectGetter := func() (proj *project.Project, err error) { | ||
repositoryURL, projectDir, err := getRepositoryURLFromFlagOrConfig(cmd) | ||
if err != nil { | ||
return nil, err | ||
} | ||
repo, err := getRepository(repositoryURL, projectDir) | ||
if err != nil { | ||
return nil, err | ||
} | ||
proj = project.NewProject(repo, projectDir) | ||
return proj, err | ||
} | ||
|
||
if err := shared.Serve(projectGetter, socketPath); err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.