Skip to content

Commit 4c861a3

Browse files
committed
release 1.1.1
1 parent 9ad8fd1 commit 4c861a3

File tree

14 files changed

+299
-171
lines changed

14 files changed

+299
-171
lines changed

README-development.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ If you want to use the SDK with your own programs, see README.rst.
88

99
Getting Started
1010
===============
11-
Assuming that you have Python and `virtualenv` installed, set up your environment and install the required dependencies like this:
11+
Assuming that you have Python and `conda` installed, set up your environment and install the required dependencies like this:
1212

1313
.. code-block:: sh
1414
1515
git clone https://github.com/oracle/ocifs.git
1616
cd ocifs
17-
virtualenv ocifs-env
18-
. ocifs-env/bin/activate
17+
conda create python=3.8 --name ocifs -y
18+
conda activate ocifs
1919
python3 -m pip install -r requirements.txt
20-
python3 -m pip install -e .
20+
python3 -m pip install -r requirements-dev.txt
21+
python3 -m pip install -r docs/requirements.txt
2122
2223
You should also set up your configuration files, see the `SDK and CLI Configuration File`__.
2324

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ python3 -m pip install ocifs
3232
## Software Prerequisites:
3333
Python >= 3.6
3434

35+
## Environment Variables for Authentication:
36+
```bash
37+
export OCIFS_IAM_TYPE=api_key
38+
export OCIFS_CONFIG_LOCATION=~/.oci/config
39+
export OCIFS_CONFIG_PROFILE=DEFAULT
40+
```
41+
42+
Note, if you are operating on OCI with an alternative valid signer, such as resource principal, instead set the following:
43+
```bash
44+
export OCIFS_IAM_TYPE=resource_principal
45+
```
46+
3547
## Documentation:
3648
[ocifs Documentation](https://ocifs.readthedocs.io/en/latest/index.html)
3749
[![PyPI](https://img.shields.io/pypi/v/ocifs.svg)](https://pypi.org/project/ocifs/)

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ nbsphinx
33
pandoc
44
ipython
55
sphinx_rtd_theme
6-
-e .
6+
autodoc
7+
sphinxcontrib-napoleon

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# ones.
2828
extensions = [
2929
"sphinx.ext.autodoc",
30+
"sphinxcontrib.napoleon",
3031
"nbsphinx",
3132
"sphinx_rtd_theme",
3233
]

docs/source/faqs.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Frequently Asked Questions
2+
---------------------------
3+
4+
5+
**Is ocifs asynchronous?**
6+
7+
No. Ocifs currently inherits the AbstractFile and AbstractFileSystem classes, rather than the Async versions of these. This development may happen in the future if there's enough interest.
8+
9+
10+
**Does ocifs use multipart uploads?**
11+
12+
Yes. Ocifs uses multipart uploads to upload files to Object Storage when the file is larger than 5 GB.
13+
14+
15+
**Can I bring my own signer?**
16+
17+
Yes. Whether you want to use Resource Principal, Instance Principal, or some other type of OCI signer, simply pass that signer to the OCIFileSystem init method.
18+
19+
20+
**Can I use ocifs with a different region?**
21+
22+
Yes, pass this region into the OCIFileSystem init method, and ensure your auth credentials work cross-region.
23+
24+
25+
**Can I use ocifs with a different tenancy?**
26+
27+
Yes, pass this tenancy into the OCIFileSystem init method, and ensure your auth credentials work cross-region.
28+
29+
30+
**Can I set auth once and forget?**
31+
32+
Yes, you can use environment variables: `OCIFS_IAM_TYPE`, `OCIFS_CONFIG_LOCATION`, `OCIFS_CONFIG_PROFILE`. Read more in the Getting Connected section.

docs/source/faqs_title.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FAQS
2+
=====
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
faqs

docs/source/getting-connected.ipynb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"id": "5f14c5a8",
6-
"metadata": {},
7-
"source": [
8-
"Copyright (c) 2021, 2022 Oracle and/or its affiliates.\n",
9-
"Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/"
10-
]
11-
},
123
{
134
"cell_type": "markdown",
145
"id": "serial-equivalent",
@@ -85,7 +76,7 @@
8576
"metadata": {},
8677
"source": [
8778
"### Using Environment Variables\n",
88-
"From version 1.1.0, users can provide default authentication configuration details as enviornment variables.\n",
79+
"Users can provide default authentication configuration details as enviornment variables.\n",
8980
"The following environment variables are inspected:\n",
9081
"\n",
9182
"* `OCIFS_IAM_TYPE`: which can be any of: [\"api_key\", \"resource_principal\", \"instance_principal\", \"unknown_signer\"]\n",

docs/source/getting-started.ipynb

Lines changed: 1 addition & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "909f1aef",
65
"metadata": {},
76
"source": [
8-
"Copyright (c) 2021, 2022 Oracle and/or its affiliates.\n",
9-
"Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/"
10-
]
11-
},
12-
{
13-
"cell_type": "markdown",
14-
"metadata": {},
15-
"source": [
16-
"## Getting Started with ocifs\n",
7+
"## Getting Started\n",
178
"\n",
189
"The Oracle Cloud Infrastructure (OCI) Object Storage filesystem (ocifs) is an fsspec implementation for use with Object Storage."
1910
]
@@ -95,85 +86,6 @@
9586
"The `storage_options` parameter contains a dictionary of arguments that are passed to the underlying `OCIFileSystem` method. The following `docstring` lists the valid arguments to storage options:"
9687
]
9788
},
98-
{
99-
"cell_type": "code",
100-
"execution_count": 5,
101-
"metadata": {},
102-
"outputs": [
103-
{
104-
"data": {
105-
"text/plain": [
106-
"\u001b[0;31mInit signature:\u001b[0m \u001b[0mocifs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOCIFileSystem\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
107-
"\u001b[0;31mDocstring:\u001b[0m \n",
108-
"Access oci as if it were a file system.\n",
109-
"This exposes a filesystem-like API (ls, cp, open, etc.) on top of oci\n",
110-
"storage.\n",
111-
"Parameters\n",
112-
"----------\n",
113-
"config : Union[dict, str, None]\n",
114-
" Config for the connection to OCI. \n",
115-
" If a dict, it should be returned from oci.config.from_file\n",
116-
" If a str, it should be the location of the config file\n",
117-
" If None, user should have a Resource Principal configured environment\n",
118-
"profile : str\n",
119-
" The profile to use from the config (If the config is passed in)\n",
120-
"default_block_size: int (None)\n",
121-
" If given, the default block size value used for ``open()``, if no\n",
122-
" specific value is given at all time. The built-in default is 5MB.\n",
123-
"config_kwargs : dict of parameters passed to the OCI Client upon connection\n",
124-
" This will first scan for `profile` (in the case of a passed in config)\n",
125-
" Or `resource_principal_token_path_provider` (in the case of no config)\n",
126-
" The rest will be passed to the ObjectStorageClient\n",
127-
" more info here: oci.object_storage.ObjectStorageClient.__init__\n",
128-
"oci_additional_kwargs : dict of parameters that are used when calling oci api\n",
129-
" methods. Typically used for things like \"retry_strategy\" or .\n",
130-
"kwargs : other parameters for oci session\n",
131-
" This includes default parameters for tenancy, namespace, and region\n",
132-
" Any other parameters are passed along to AbstractFileSystem's init method.\n",
133-
"Examples\n",
134-
"--------\n",
135-
">>> fs = OCIFileSystem(config=config) # doctest: +SKIP\n",
136-
">>> fs.ls('my-bucket@my-namespace/') # doctest: +SKIP\n",
137-
"['my-file.txt']\n",
138-
">>> with fs.open('my-bucket@my-namespace/my-file.txt', mode='rb') as f: # doctest: +SKIP\n",
139-
"... print(f.read()) # doctest: +SKIP\n",
140-
"b'Hello, world!'\n",
141-
"\u001b[0;31mInit docstring:\u001b[0m\n",
142-
"Create and configure file-system instance\n",
143-
"\n",
144-
"Instances may be cachable, so if similar enough arguments are seen\n",
145-
"a new instance is not required. The token attribute exists to allow\n",
146-
"implementations to cache instances if they wish.\n",
147-
"\n",
148-
"A reasonable default should be provided if there are no arguments.\n",
149-
"\n",
150-
"Subclasses should call this method.\n",
151-
"\n",
152-
"Parameters\n",
153-
"----------\n",
154-
"use_listings_cache, listings_expiry_time, max_paths:\n",
155-
" passed to ``DirCache``, if the implementation supports\n",
156-
" directory listing caching. Pass use_listings_cache=False\n",
157-
" to disable such caching.\n",
158-
"skip_instance_cache: bool\n",
159-
" If this is a cachable implementation, pass True here to force\n",
160-
" creating a new instance even if a matching instance exists, and prevent\n",
161-
" storing this instance.\n",
162-
"asynchronous: bool\n",
163-
"loop: asyncio-compatible IOLoop or None\n",
164-
"\u001b[0;31mFile:\u001b[0m ~/ocifs/ocifs/core.py\n",
165-
"\u001b[0;31mType:\u001b[0m _Cached\n",
166-
"\u001b[0;31mSubclasses:\u001b[0m \n"
167-
]
168-
},
169-
"metadata": {},
170-
"output_type": "display_data"
171-
}
172-
],
173-
"source": [
174-
"ocifs.OCIFileSystem?"
175-
]
176-
},
17789
{
17890
"cell_type": "markdown",
17991
"metadata": {},

docs/source/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ Contents
177177
getting-started.ipynb
178178
getting-connected.ipynb
179179
unix-operations.ipynb
180-
:maxdepth: 2
180+
modules.rst
181+
faqs_title.rst
182+
:maxdepth: 4
181183

182184

183185
Indices and tables

docs/source/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API Reference
2+
=============
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
ocifs

0 commit comments

Comments
 (0)