Minio

This package provides Julia tools for working with the min.io data storage program. Min.io is an open source tool fully compatible with the AWS S3 interface, so interaction with a min.io service is achieved through AWSS3.jl. This package simply contains some convenient constructors for a configuration allowing min.io to be used with AWSS3.jl, as well as some simple terms for managing min.io servers.

Note

This package is unofficial. It does not link to any min.io library, but rather calls a separate min.io process, either through a shell or HTTP. If you are a min.io maintainer and are interested in moving this package to an official repository, please open an issue.

Installation

The package itself can be installed with

Pkg.add("Minio")

or ]add Minio in the REPL.

Minio.jl uses minio_jll to provide the minio binary.

Client

This package provides a AbstractAWSConfig object appropraite for use with a min.io service.

Minio.MinioConfig โ€” Type
MinioConfig

A configuration object allowing the AWS S3 interface from AWS.jl and AWSS3.jl for min.io.

Constructors

MinioConfig(endpoint, creds; region="")
MinioConfig(endpoint; region="", username, password, token="", user_arn="")

Arguments

  • endpoint: The URL of the min.io server as either a String or a URI.
  • creds: An AWSCredentials object providing the credentials to access the min.io server.
  • region: The region string. This is AWS functionality and not likely to be relevant for min.io.
  • username: A username with which to access the min.io server. This will use AWS_ACCESS_KEY_ID if available, otherwise default to "minioadmin".
  • password: A password with which to access the min.io server. This will use AWS_SECRET_ACCESS_KEY if available, otherwise default to "minioadmin".
  • token: Token to provide to the server.
  • user_arn: A user ARN string to provide to the server.

Examples

using Minio

cfg = MinioConfig("http://localhost:9000")

# using the AWS S3 API
s3_list_buckets(cfg)

# using the S3Path interface
path = S3Path("s3://bucket-name", config=cfg)
readdir(path)

Server

This package provides some convenient tools for managing a min.io server from Julia.

Minio.Server โ€” Type
Server

A data structure for managing a min.io server process. By default, running this will execute the min.io binary as identified during the initialization of the Minio module.

The launched server will use the environment in which the Julia process was launched, so one should set environment variables for the server just as one would set them when running the server from the command line.

Note that the Server object does NOT provide any additional functionality not already available in the min.io command line interface apart from convenient Julia bindings. It was included in this package because the functionality was going to be needed for the sake of testing and CI/CD anyway, so it made sense to include it as user facing functionality as well.

Constructors

Server(cmd, addr::URI; detach=false)
Server(dirs; detach=false, address="localhost:9000", certs_dir="", quiet=false, anonymous=false, json=false)
Server(dirs; detach=false, address="localhost:9000", certs_dir="", quiet=false, anonymous=false, json=false)
Server(cmd, dirs; kw...)
Server(cmd, dir; kw...)

Arguments

  • cmd::Cmd the minio command (e.g. minio on a typical install). By defualt this will use the binary provided via minio_jll.
  • dirs: The directory or directories to host with the server, as they would be provided to the minio server command.
  • detach::Bool: Whether or not to run the server process detached from the Julia process. Setting this to true allows the server process to outlive the Julia process which spawned it.
  • address: Specifies the address and port of the server. Can be passed as it would be to the minio server command or as a full http or https URL.
  • certs_dir: Path to certification directory. If empty, will use minio default.
  • quiet::Bool: Run in quiet mode, with no information or logging output.
  • aononymous::Bool: Hide sensitive information from logging.
  • json::Bool: Whether to output logs and startup information as JSON.

Examples

s = Minio.Server(".", address="localhost:9001")  # create a server which views the current directory

# start the server. if `wait=false`, it will be run asynchronously.
run(s, wait=false)

kill(s)  # kill the running server. will not work if `detach=true` as in this case Julia loses control of the child process