Skip to content

Commit

Permalink
Upload zip file. (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang authored Dec 31, 2024
1 parent 3bd0ea4 commit 02b8e24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gateways/storage/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *GCPStorageService) GenerateSignedURL(bucketName, objectName string) (st

expires := time.Now().Add(15 * time.Minute)
url, err := client.Bucket(bucketName).SignedURL(objectName, &storage.SignedURLOptions{
ContentType: "application/gzip",
ContentType: "application/zip",
Method: "PUT",
Expires: expires,
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/registry_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func TestRegistryNodeVersion(t *testing.T) {
node := randomNode()
nodeVersion := randomNodeVersion(0)
signedUrl := "test-url"
downloadUrl := fmt.Sprintf("https://storage.googleapis.com/comfy-registry/%s/%s/%s/node.tar.gz", *pub.Id, *node.Id, *nodeVersion.Version)
downloadUrl := fmt.Sprintf("https://storage.googleapis.com/comfy-registry/%s/%s/%s/node.zip", *pub.Id, *node.Id, *nodeVersion.Version)
var createdNodeVersion drip.NodeVersion

impl.mockStorageService.On("GenerateSignedURL", mock.Anything, mock.Anything).Return(signedUrl, nil)
Expand Down Expand Up @@ -794,7 +794,7 @@ func TestRegistryNodeVersion(t *testing.T) {
t.Run("Scan Node", func(t *testing.T) {
node := randomNode()
nodeVersion := randomNodeVersion(0)
downloadUrl := fmt.Sprintf("https://storage.googleapis.com/comfy-registry/%s/%s/%s/node.tar.gz", *pub.Id, *node.Id, *nodeVersion.Version)
downloadUrl := fmt.Sprintf("https://storage.googleapis.com/comfy-registry/%s/%s/%s/node.zip", *pub.Id, *node.Id, *nodeVersion.Version)

impl.mockStorageService.On("GenerateSignedURL", mock.Anything, mock.Anything).Return("test-url", nil)
impl.mockStorageService.On("GetFileUrl", mock.Anything, mock.Anything, mock.Anything).Return("test-url", nil)
Expand Down
4 changes: 2 additions & 2 deletions services/registry/registry_svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ func (s *RegistryService) CreateNodeVersion(
}

// Create a new storage file for the node version
objectPath := fmt.Sprintf("%s/%s/%s/%s", publisherID, nodeID, *nodeVersion.Version, "node.tar.gz")
objectPath := fmt.Sprintf("%s/%s/%s/%s", publisherID, nodeID, *nodeVersion.Version, "node.zip")
storageFile := tx.StorageFile.Create().
SetBucketName(bucketName).
SetFilePath(objectPath).
SetFileType("zip").
// Sample URL: https://storage.googleapis.com/comfy-registry/james-test-publisher/comfyui-inspire-pack/1.0.0/node.tar.gz
// Sample URL: https://storage.googleapis.com/comfy-registry/james-test-publisher/comfyui-inspire-pack/1.0.0/node.zip
SetFileURL(fmt.Sprintf("https://storage.googleapis.com/%s/%s", bucketName, objectPath)).
SaveX(ctx)
signedUrl, err := s.storageService.GenerateSignedURL(bucketName, objectPath)
Expand Down

0 comments on commit 02b8e24

Please sign in to comment.