-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interface: azure #215
Draft
theoctober19th
wants to merge
1
commit into
canonical:main
Choose a base branch
from
theoctober19th:azure-storage-credentials
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+196
−0
Draft
Add interface: azure #215
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# `azure` | ||
|
||
## Usage | ||
|
||
This relation interface describes the expected behaviour of any charm claiming to be able to interact with Azure Storage protocol. | ||
This relation interface should be used for both Azure Blob Storage and Azure Data Lake Storage (Gen 2). This interface will be accomplished using the provider library, although charm developers are free to provide alternative libraries as long as they fulfil the behavioural and schematic requirements described in this document. | ||
|
||
## Direction | ||
|
||
```mermaid | ||
flowchart TD | ||
Provider -- container, storage-account, secret-key, connection-protocol, endpoint, path --> Requirer | ||
``` | ||
|
||
As with all Juju relations, the `azure` interface consists of two parties: a Provider (object storage charm) and a Requirer (application charm). The Provider will be expected to provide new unique credentials (along with `storage-account`, `container`, `connection-protocol` and other fields), which can be used to access the actual object storage. | ||
|
||
## Behaviour | ||
|
||
Both the Requirer and the Provider must adhere to criteria to be compatible with this interface. | ||
|
||
### Provider | ||
- It is expected to provide `storage-account`, `container` and `secret-key` fields corresponding to a storage account, container and the secret key corresponding to an Azure Storage account when a relation joins. As of now, the container is not automatically created when the relation is joined. | ||
- It is expected to provide the `endpoint` field containing a URL (eg, abfss://containername.accountname.dfs.core.windows.net/). | ||
- It is expected to provide the `connection-protocol` field that may be one of `wasb`, `wasbs`, `abfs` or `abfss`; which signifies which connection protocol should be used to connect to the storage account and the container. | ||
- It is expected to provide the optional `path` field that contains the relative path inside the container which is to be used for storage. | ||
|
||
### Requirer | ||
- Is expected to provide a container name in the `container` field. Field value should be generated on Requirer side if no particular value set in Requirer juju config. | ||
- Is expected to tolerate that the Provider may ignore the `container` field in some cases (e.g. Azure Storage Integrator) and instead use the container name received. | ||
- Is expected to allow multiple different Juju applications to access the same container name. | ||
- Is expected to have unique credentials for each relation. Therefore, different instances of the same Charm (juju applications) will have different relations with different credentials. | ||
- Is expected to have different relations names on Requirer with the same interface name if Requirer needs access to multiple buckets. | ||
|
||
## Relation Data | ||
|
||
### Provider | ||
|
||
[\[JSON Schema\]](./schemas/provider.json) | ||
|
||
The Provider provides credentials, endpoints, TLS info and database-specific fields. It should be placed in the **application** databag. | ||
|
||
|
||
#### Example | ||
```yaml | ||
application-data: | ||
container: test-container | ||
storage-account: test-storage-account | ||
connection-protocol: abfss | ||
secret-key: RANDOM | ||
path: spark-events/ | ||
endpoint: abfss://[email protected]/ | ||
``` | ||
|
||
### Requirer | ||
|
||
[\[JSON Schema\]](./schemas/requirer.json) | ||
|
||
Requirer provides container name. Should be placed in the **application** databag in the Requirer. | ||
|
||
#### Example | ||
|
||
```yaml | ||
application-data: | ||
container: test-container | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: azure | ||
version: 0 | ||
status: draft | ||
|
||
providers: | ||
- name: azure-storage-integrator | ||
url: https://github.com/canonical/object-storage-integrators | ||
|
||
requirers: | ||
- name: spark-integration-hub-k8s | ||
url: https://github.com/canonical/spark-integration-hub-k8s-operator | ||
|
||
maintainer: data-platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"$id": "https://canonical.github.io/charm-relation-interfaces/interfaces/azure/schemas/provider.json", | ||
"title": "`azure` provider schema", | ||
"description": "The `azure` root schema comprises the entire provider databag for this interface.", | ||
"type": "object", | ||
"default": {}, | ||
"required": [ | ||
"container", | ||
"connection-protocol", | ||
"storage-account", | ||
"secret-key" | ||
], | ||
"additionalProperties": true, | ||
"properties": { | ||
"container": { | ||
"title": "Container name", | ||
"description": "The name of the Azure Storage container delivered by the provider.", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"test-container" | ||
] | ||
}, | ||
"storage-account": { | ||
"title": "Storage account name", | ||
"description": "The name of the storage account in Azure Cloud.", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"test-storage-account" | ||
] | ||
}, | ||
"connection-protocol": { | ||
"title": "Connection protocol", | ||
"description": "The connection protocol to use to connect to Azure Storage.", | ||
"type": "string", | ||
"default": "abfss", | ||
"examples": [ | ||
"wasb", | ||
"wasbs", | ||
"abfs", | ||
"abfss" | ||
] | ||
}, | ||
"secret-key": { | ||
"title": "Secret Key", | ||
"description": "Secret ID (password) corresponding to the storage account for connecting to the object storage.", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"random-secret-key" | ||
] | ||
}, | ||
"path": { | ||
"title": "Path", | ||
"description": "The path inside the container to store objects.", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"foo/bar" | ||
] | ||
}, | ||
"endpoint": { | ||
"title": "Endpoint URL", | ||
"description": "The endpoint corresponding to the specific container and storage account.", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"abfss://[email protected]/" | ||
] | ||
} | ||
}, | ||
"examples": [ | ||
{ | ||
"container": "test-container", | ||
"storage-account": "test-storage-account", | ||
"path": "spark-events/", | ||
"connection-protocol": "abfss", | ||
"secret-key": "DUMMY+ACCESS+KEY+FOR+EXAMPLE+1234567890abcdefghijklmnopqrstuvwxyz==", | ||
"endpoint": "abfss://[email protected]/" | ||
}, | ||
{ | ||
"container": "my-container", | ||
"storage-account": "my-storageacc", | ||
"path": "foo/bar/", | ||
"connection-protocol": "wasb", | ||
"secret-key": "EXAMPLE-KEY+1234567890abcdefghijklmnopqrstuvwxyz==", | ||
"endpoint": "wasb://[email protected]/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"$id": "https://canonical.github.io/charm-relation-interfaces/interfaces/azure/schemas/requirer.json", | ||
"title": "`azure` requirer schema", | ||
"description": "The `azure` root schema comprises the entire requirer databag for this interface.", | ||
"type": "object", | ||
"default": {}, | ||
"required": [ | ||
"container" | ||
], | ||
"additionalProperties": true, | ||
"properties": { | ||
"container": { | ||
"title": "Container Name", | ||
"description": "The name of the container requested by the requirer", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"test-container" | ||
] | ||
} | ||
}, | ||
"examples": [{ | ||
"container": "myapp" | ||
}] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this name should be more specific, perhaps
azure-storage
or similar?