You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add docstrings to Julia API
* WIP README
* WIP README design notes
* Update test to more specific exception types
* More readme
* fixup! More readme
* Update README.md
RustyObjectStore.jl is a Julia package for getting and putting data in cloud object stores, such as Azure Blob Storage and AWS S3.
6
+
It is built on top of the Rust [object_store crate](https://docs.rs/object_store/).
7
+
It provides a minimal API and focusses on high throughput.
8
+
9
+
_The package is under active development. Currently only Azure Blob Storage is supported._
10
+
11
+
## Usage
12
+
13
+
The object_store runtime must be started before any requests are sent.
14
+
15
+
```julia
16
+
using RustyObjectStore
17
+
init_object_store()
18
+
```
19
+
20
+
Requests are sent via calling `blob_put` or `blob_get!`, providing the location of the object to put/get, either the data to send or a buffer that will receive data, and credentials.
21
+
For `blob_put` the data must be a vector of bytes (`UInt8`).
22
+
For `blob_get!` the buffer must be a vector into which bytes (`UInt8`) can be written.
The Rust [object_store](https://github.com/apache/arrow-rs/tree/master/object_store) crate does not provide a C API, so we have defined a C API in [object_store_ffi](https://github.com/relationalAI/object_store_ffi).
43
+
RustyObjectStore.jl depends on [object_store_ffi_jll.jl](https://github.com/JuliaBinaryWrappers/object_store_ffi_jll.jl) to provides a pre-built object_store_ffi library, and calls into the native library via `@ccall`.
44
+
45
+
#### Rust/Julia Interaction
46
+
47
+
Julia calls into the native library providing a libuv condition variable and then waits on that variable.
48
+
In the native code, the request from Julia is passed into a queue that is processed by a Rust spawned task.
49
+
Once the request to cloud storage is complete, Rust signals the condition variable.
50
+
In this way, the requests are asynchronous all the way up to Julia and the network processing is handled in the context of native thread pool.
51
+
52
+
For a GET request, Julia provides a buffer for the native library to write into.
53
+
This requires Julia to know a suitable size before-hand and requires the native library to do an extra memory copy, but the upside is that Julia controls the lifetime of the memory.
54
+
55
+
#### Threading Model
56
+
57
+
Rust object_store uses the [tokio](https://docs.rs/tokio) async runtime.
58
+
59
+
TODO
60
+
61
+
#### Rust Configuration
62
+
63
+
TODO
64
+
65
+
## Developement
66
+
67
+
When working on RustyObjectStore.jl you can either use [object_store_ffi_jll.jl](https://github.com/JuliaBinaryWrappers/object_store_ffi_jll.jl) or use a local build of [object_store_ffi](https://github.com/relationalAI/object_store_ffi).
68
+
Using object_store_ffi_jll.jl is just like using any other Julia package.
69
+
For example, you can change object_store_ffi_jll.jl version by updating the Project.toml `compat` entry and running `Pkg.update` to get the latest compatible release,
70
+
or `Pkg.develop` to use an unreleased version.
71
+
72
+
Alternatively, you can use a local build of object_store_ffi library by setting the `OBJECT_STORE_LIB` environment variable to the location of the build.
73
+
For example, if you have the object_store_ffi repository at `~/repos/object_store_ffi` and build the library by running `cargo build --release` from the base of that repository,
74
+
then you could use that local build by setting `OBJECT_STORE_LIB="~/repos/object_store_ffi/target/release"`.
75
+
76
+
The `OBJECT_STORE_LIB` environment variable is intended to be used only for local development.
77
+
The library path is set at package precompile time, so if the environment variable is changed RustyObjectStore.jl must recompile for the change to take effect.
78
+
You can check the location of the library in use by inspecting `RustyObjectStore.rust_lib`.
79
+
80
+
Since RustyObjectStore.jl is the primary user of object_store_ffi, the packages should usually be developed alongside one another.
81
+
For example, updating object_store_ffi and then testing out the changes in RustyObjectStore.jl.
82
+
A new release of object_store_ffi should usually be followed by a new release of object_store_ffi_jll.jl, and then a new release RustyObjectStore.jl.
83
+
84
+
#### Testing
85
+
86
+
Tests use the [ReTestItems.jl](https://github.com/JuliaTesting/ReTestItems.jl) test framework.
87
+
88
+
Run tests using the package manager Pkg.jl like:
89
+
```sh
90
+
$ julia --project -e 'using Pkg; Pkg.test()'
91
+
```
92
+
or after starting in a Julia session started with `julia --project`:
93
+
```julia
94
+
julia># press ] to enter the Pkg REPL mode
95
+
96
+
(RustyObjectStore) pkg> test
97
+
```
98
+
Alternatively, tests can be run using ReTestItems.jl directly, which supports running individual tests.
If `OBJECT_STORE_LIB` is set, then running tests locally will use the specified local build of the object_store_ffi library, rather than the version installed by object_store_ffi_jll.jl.
107
+
This is useful for testing out changes to object_store_ffi.
108
+
109
+
Adding new tests is done by writing test code in a `@testitem` in a file suffixed `*_tests.jl`.
110
+
See the existing [tests](./test) or the [ReTestItems documentation](https://github.com/JuliaTesting/ReTestItems.jl/#writing-tests) for examples.
111
+
112
+
#### Release Process
113
+
114
+
New releases of RustyObjectStore.jl can be made by incrementing the version number in the Project.toml file following [Semantic Versioning](semver.org),
115
+
and then commenting on the commit that should be released with `@JuliaRegistrator register`
116
+
(see [example](https://github.com/RelationalAI/RustyObjectStore.jl/commit/1b1ba5a198e76afe37f75a1d07e701deb818869c#comments)).
117
+
The [JuliaRegistrator](https://github.com/JuliaRegistries/Registrator.jl) bot will reply to the comment and automatically open a PR to the [General](https://github.com/JuliaRegistries/General/) package registry, that should then automatically be merged within a few minutes.
118
+
Once that PR to General is merged the new version of RustyObjectStore.jl is available, and the TagBot Github Action will make add a Git tag and a GitHub release for the new version.
119
+
120
+
RustyObjectStore.jl uses the object_store_ffi library via depending on object_store_ffi_jll.jl which installs pre-built binaries.
121
+
So when a new release of object_store_ffi is made, we need there to be a new release of object_store_ffi_jll.jl before we can make a release of RustyObjectStore.jl that uses the latest object_store_ffi.
0 commit comments