Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix naming #1849

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,16 @@ def publish_file_in_ipfs(file_url, file_dir, ipfs_client, wrap_with_directory=Tr
file_type = os.path.splitext(filename)[1]
logger.info(f" file type is = '{file_type.lower()}` ")
if file_type.lower() == ".zip":
return publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ingored_files=ignored_files)
return publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ignored_files=ignored_files)
#todo , you need to tar the folder and add that to the ipfs hash
logger.info(f"writing the file on ipfs {file_dir}/{filename} ")
ipfs_hash = ipfs_client.write_file_in_ipfs(f"{file_dir}/{filename}", wrap_with_directory)
return ipfs_hash


def publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ingored_files=[]):
def publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ignored_files=[]):
logger.info(f"publish_zip_file_in_ipfs {file_dir}/{filename} ")
file_in_tar_bytes = convert_zip_file_to_tar_bytes(file_dir=file_dir, filename=filename, ingored_files=ingored_files)
file_in_tar_bytes = convert_zip_file_to_tar_bytes(file_dir=file_dir, filename=filename, ignored_files=ignored_files)
logger.info(f"file_in_tar_bytes {file_in_tar_bytes} ")
return ipfs_client.ipfs_conn.add_bytes(file_in_tar_bytes.getvalue())

Expand Down
2 changes: 1 addition & 1 deletion registry/application/services/service_publisher_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def publish_service_data_to_ipfs(self):
filename=filename,
file_dir=f"{ASSET_DIR}/{service.org_uuid}/{service.uuid}",
ipfs_client=IPFSUtil(IPFS_URL['url'], IPFS_URL['port']),
ingored_files=["pricing.proto", "training.proto"]
ignored_files=["pricing.proto", "training.proto"]
)
service.proto = {
"model_ipfs_hash": asset_ipfs_hash,
Expand Down
Loading