Skip to content
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

### Added

* Support for JuliaHub instances using MinIO as datasets storage backend.
* Support for JuliaHub instances using MinIO as datasets storage backend. ([#107], [#112])

### Fixed

Expand Down Expand Up @@ -208,3 +208,6 @@ Initial package release.
[#99]: https://github.com/JuliaComputing/JuliaHub.jl/issues/99
[#100]: https://github.com/JuliaComputing/JuliaHub.jl/issues/100
[#103]: https://github.com/JuliaComputing/JuliaHub.jl/issues/103
[#107]: https://github.com/JuliaComputing/JuliaHub.jl/issues/107
[#111]: https://github.com/JuliaComputing/JuliaHub.jl/issues/111
[#112]: https://github.com/JuliaComputing/JuliaHub.jl/issues/112
27 changes: 14 additions & 13 deletions src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -868,15 +868,15 @@ function _write_rclone_config(
access_key_id::AbstractString,
secret_access_key::AbstractString,
session_token::AbstractString,
provider::AbstractString="AWS",
endpoint::AbstractString="",
vendor::AbstractString,
endpoint::AbstractString,
)
if lowercase(provider) == "aws"
provider = "AWS"
elseif lowercase(provider) == "minio"
provider = "Minio"
provider = if vendor == "aws"
"AWS"
elseif vendor == "minio"
"Minio"
else
throw(JuliaHubError("Unknown storage backend $(provider)"))
throw(JuliaHubError("Unknown storage backend $(vendor)"))
end

write(
Expand Down Expand Up @@ -904,10 +904,10 @@ function _write_rclone_config(io::IO, upload_config::Dict)
access_key_id = upload_config["credentials"]["access_key_id"]
secret_access_key = upload_config["credentials"]["secret_access_key"]
session_token = upload_config["credentials"]["session_token"]
provider = upload_config["vendor"]
vendor = upload_config["vendor"]
endpoint = get(upload_config["credentials"], "endpoint_url", "")
_write_rclone_config(
io; region, access_key_id, secret_access_key, session_token, provider, endpoint
io; region, access_key_id, secret_access_key, session_token, vendor, endpoint
)
end

Expand Down Expand Up @@ -1002,9 +1002,10 @@ function download_dataset(
throw(InvalidRequestError("Dataset '$(dataset.name)' does not have version 'v$version'"))

credentials = Mocking.@mock _get_dataset_credentials(auth, dataset)
provider = credentials["vendor"]
provider in ("aws", "minio") ||
throw(JuliaHubError("Unknown 'vendor': $(credentials["vendor"])"))
vendor = credentials["vendor"]
if !(vendor in ("aws", "minio"))
throw(JuliaHubError("Unknown 'vendor': $(vendor)"))
end
credentials = credentials["credentials"]
endpoint = get(credentials, "endpoint_url", "")

Expand Down Expand Up @@ -1035,7 +1036,7 @@ function download_dataset(
access_key_id=credentials["access_key_id"],
secret_access_key=credentials["secret_access_key"],
session_token=credentials["session_token"],
provider=provider,
vendor=vendor,
endpoint=endpoint,
)
close(rclone_conf_io)
Expand Down
Loading