Skip to content

Commit d55e08a

Browse files
authored
Merge pull request #58 from dotmesh-io/fix_model_uploads
direct upload
2 parents 5a1864b + 5653925 commit d55e08a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

dotscience/__init__.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def _publish_remote_run(self, build, deploy):
390390

391391
self._get_project_or_create(self._project_name, verbose=True)
392392

393-
print("* Uploading output/model files", end="")
393+
print("* Uploading output/model files\n", end="")
394394
self._upload_output_files()
395395
# - Craft the commit metadata for the run and call the Commit() API
396396
# directly on dotmesh on the hub
@@ -546,21 +546,9 @@ def _uploadArchive(self, archiveFile, path):
546546
'Extract' : 'true',
547547
}
548548

549-
scheme, hostname = self._hostname.split("://")
550-
if scheme == "http":
551-
conn = http.client.HTTPConnection(hostname)
552-
elif scheme == "https":
553-
conn = http.client.HTTPSConnection(hostname)
554-
else:
555-
raise Exception("Unsupported scheme %s", scheme)
556-
557549
try:
558-
R = conn.request(
559-
"PUT",
560-
self._hostname+f"/v2/dotmesh/s3/{self._auth[0]}:{dotName}/{path}",
561-
f,
562-
headers, # {"Content-Type": "application/json", "Accept": "application/json"},
563-
)
550+
R = requests.put(self._hostname+f"/v2/dotmesh/s3/{self._auth[0]}:{dotName}/{path}", f, headers=headers)
551+
564552
# Success, return - otherwise we'll retry
565553
return
566554
except Exception as e:

0 commit comments

Comments
 (0)