MinIO is a lightweight S3-compliant object-store. Although it has many nice features, here we focus only on local deployment, which is very useful if you wish to quickly test your TileDB-S3 programs locally. See the MinIO quickstart guide for installation instructions. Here is what we do to run MinIO on port 9999:
Once you get MinIO server running, you need to set the S3 configurations as follows (below, <port> stands for the port on which you are running the MinIO server, equal to 9999 if you run the MinIO docker as shown above):
The Configuration page explains in detail how to set configuration parameters in TileDB. Below is a quick example for the minio specific parameters.
// Create a configuration objecttiledb_config_t*config;tiledb_config_alloc(&config,NULL);// Set configuration parameterstiledb_config_set(config,"vfs.s3.scheme","http",&error);tiledb_config_set(config,"vfs.s3.region","",&error);tiledb_config_set(config,"vfs.s3.endpoint_override","<minio address>",&error);tiledb_config_set(config,"vfs.s3.use_virtual_addressing","false",&error);// Create contextiledb_ctx_t* ctx;tiledb_ctx_alloc(&config,&ctx);// Pass CTX to read/write of array// Clean uptiledb_config_free(&config);tiledb_ctx_free(&ctx);
// Create a configuration objectConfig config;// Set a configuration parameterconfig["vfs.s3.scheme"] ="http";config["vfs.s3.region"] ="";config["vfs.s3.endpoint_override"] ="<minio address>";config["vfs.s3.use_virtual_addressing"] ="false";// Create contexCtxctx(config);// Pass CTX to read/write of array
# Create a configuration objectconfig = tiledb.Config()# Set configuration parametersconfig["vfs.s3.scheme"]="http"config["vfs.s3.region"]=""config["vfs.s3.endpoint_override"]="<minio address>"config["vfs.s3.use_virtual_addressing"]="false"# Create contexctx = tiledb.Ctx(config)# Pass CTX to read/write of arraywith tiledb.open(array_uri, ctx=ctx)as A:# Read or write and context with minio is applied
# Create a configuration objectconfig <-tiledb_config()# Set a configuration parameterconfig["vfs.s3.scheme"] = "http"config["vfs.s3.region"] = ""config["vfs.s3.endpoint_override"] = "<minio address>"config["vfs.s3.use_virtual_addressing"] = "false"ctx <-tiledb_ctx(config)# Pass CTX to read/write of array
try(Config config =newConfig()) {// Set configuration parametersconfig.set("vfs.s3.scheme","http");config.set("vfs.s3.region","");config.set("vfs.s3.endpoint_override","<minio address>");config.set("vfs.s3.use_virtual_addressing","false");// set config on contexttry(Context ctx =newContext(config)) {// Pass CTX to read/write of array }}
// Create a configuration objectconfig, _ := tiledb.NewConfig()// Set configuration parametersconfig.Set("vfs.s3.scheme", "http")config.Set("vfs.s3.region", "")config.Set("vfs.s3.endpoint_override", "<minio address>")config.Set("vfs.s3.use_virtual_addressing", "false")// set config on contextctx, _ := tiledb.NewCtx(&config)// Pass CTX to read/write of array// Clean upconfig.Free()ctx.Free()