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
Copy file name to clipboardExpand all lines: README.md
+59-27Lines changed: 59 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ with a JSON payload of the form:
79
79
80
80
The currently supported reducers are `max`, `min`, `mean`, `sum`, `select` and `count`. All reducers return the result using the same datatype as specified in the request except for `count` which always returns the result as `int64`.
81
81
82
+
The proxy adds two custom headers `x-activestorage-dtype` and `x-activestrorage-shape` to the HTTP response to allow the numeric result to be reconstructed from the binary content of the response.
83
+
82
84
[//]: <> (TODO: No OpenAPI support yet).
83
85
[//]: <>(For a running instance of the proxy server, the full OpenAPI specification is browsable as a web page at the `{proxy-address}/redoc/` endpoint or in raw JSON form at `{proxy-address}/openapi.json`.)
84
86
@@ -92,12 +94,53 @@ In particular, the following are known limitations which we intend to address:
92
94
* No support for missing data
93
95
* No support for compressed or encrypted objects
94
96
97
+
## Running
98
+
99
+
There are various ways to run the S3 Active Storage server.
100
+
101
+
### Running in a container
102
+
103
+
The simplest method is to run it in a container using a pre-built image:
104
+
105
+
```sh
106
+
docker run -it --detach --rm --net=host --name s3-active-storage ghcr.io/stackhpc/s3-active-storage-rs:latest
107
+
```
108
+
109
+
Images are published to [GitHub Container Registry](https://github.com/stackhpc/s3-active-storage-rs/pkgs/container/s3-active-storage-rs) when the project is released.
110
+
The `latest` tag corresponds to the most recent release, or you can use a specific release e.g. `0.1.0`.
111
+
112
+
This method does not require access to the source code.
113
+
114
+
### Building a container image
115
+
116
+
If you need to use unreleased changes, but still want to run in a container, it is possible to build an image.
The image may be pushed to a registry, or deployed locally.
130
+
131
+
```sh
132
+
make run
133
+
```
134
+
95
135
## Build
96
136
137
+
If you prefer not to run the S3 Active Storage server in a container, it will be necessary to build a binary.
138
+
Building locally may also be preferable during development to take advantage of incremental compilation.
139
+
97
140
### Prerequisites
98
141
99
142
This project is written in Rust, and as such requires a Rust toolchain to be installed in order to build it.
100
-
The Minimum Supported Rust Version (MSRV) is 1.62.1, due to a dependency on the [AWS SDK](https://github.com/awslabs/aws-sdk-rust).
143
+
The Minimum Supported Rust Version (MSRV) is 1.66.1, due to a dependency on the [AWS SDK](https://github.com/awslabs/aws-sdk-rust).
101
144
It may be necessary to use [rustup](https://rustup.rs/) rather than the OS provided Rust toolchain to meet this requirement.
102
145
See the [Rust book](https://doc.rust-lang.org/book/ch01-01-installation.html) for toolchain installation.
103
146
@@ -125,7 +168,7 @@ cargo run --release
125
168
Or installed to the system:
126
169
127
170
```sh
128
-
cargo install
171
+
cargo install --path . --locked
129
172
```
130
173
131
174
Then run:
@@ -161,7 +204,7 @@ In a separate terminal, set up the Python virtualenv then upload some sample dat
161
204
162
205
```sh
163
206
# Create a virtualenv
164
-
python -m venv ./venv
207
+
python3 -m venv ./venv
165
208
# Activate the virtualenv
166
209
source ./venv/bin/activate
167
210
# Install dependencies
@@ -178,33 +221,22 @@ Proxy functionality can be tested using the [S3 active storage compliance suite]
178
221
179
222
Request authentication is implemented using [Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication) with the username and password consisting of your S3 Access Key ID and Secret Access Key, respectively. These credentials are then used internally to authenticate with the upstream S3 source using [standard AWS authentication methods](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html)
180
223
181
-
A request to an active storage proxy running on localhost with Minio as the S3 source is as simple as:
182
-
183
-
```python
184
-
import json
185
-
import numpy as np
186
-
import requests
187
-
188
-
request_data = {
189
-
'source': 'http://localhost:9000',
190
-
'bucket': 'sample-data',
191
-
'object': 'data-float32.dat',
192
-
'dtype': 'float32',
193
-
# All other fields assume their default values
194
-
}
224
+
A basic Python client is provided in `scripts/client.py`.
225
+
First install dependencies in a Python virtual environment:
The proxy adds two custom headers `x-activestorage-dtype` and `x-activestrorage-shape` to the HTTP response to allow the numeric result to be reconstructed from the binary content of the response.
0 commit comments