Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenchrist committed Jan 1, 2025
1 parent fb8efd4 commit c724253
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: datameshmanager/datamesh-manager-agent-databricks:latest
tags: datameshmanager/datamesh-manager-connector-databricks:latest
sbom: true
cache-from: type=gha
cache-to: type=gha,mode=max
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Data Mesh Manager Agent for Databricks
Data Mesh Manager Connector for Databricks
===

The agent for databricks is a Spring Boot application that uses the [datamesh-manager-sdk](https://github.com/datamesh-manager/datamesh-manager-sdk) internally, and is available as a ready-to-use Docker image [datameshmanager/datamesh-manager-agent-databricks](https://hub.docker.com/repository/docker/datameshmanager/datamesh-manager-agent-databricks) to be deployed in your environment.
The connector for databricks is a Spring Boot application that uses the [datamesh-manager-sdk](https://github.com/datamesh-manager/datamesh-manager-sdk) internally, and is available as a ready-to-use Docker image [datameshmanager/datamesh-manager-connector-databricks](https://hub.docker.com/repository/docker/datameshmanager/datamesh-manager-connector-databricks) to be deployed in your environment.

## Features

Expand All @@ -10,7 +10,7 @@ The agent for databricks is a Spring Boot application that uses the [datamesh-ma

## Usage

Start the agent using Docker. You must pass the API keys as environment variables.
Start the connector using Docker. You must pass the API keys as environment variables.

```
docker run \
Expand All @@ -22,7 +22,7 @@ docker run \
-e DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_ACCOUNTID='your-account-id' \
-e DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_CLIENTID='your-account-client-id' \
-e DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_CLIENTSECRET='your-account-client-secret' \
datameshmanager/datamesh-manager-agent-databricks:latest
datameshmanager/datamesh-manager-connector-databricks:latest
```

## Configuration
Expand All @@ -38,16 +38,16 @@ docker run \
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_ACCOUNTID` | | The databricks Account ID. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_CLIENTID` | | The client ID of a an account service principal with Account admin role. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCOUNT_CLIENTSECRET` | | The client secret of a an account service principal with Account admin role. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCESSMANAGEMENT_AGENTID` | `databricks-access-management` | Identifier for the Databricks access management agent. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCESSMANAGEMENT_CONNECTORID` | `databricks-access-management` | Identifier for the Databricks access management connector. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ACCESSMANAGEMENT_ENABLED` | `true` | Indicates whether Databricks access management is enabled. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ASSETS_AGENTID` | `databricks-assets` | Identifier for the Databricks assets agent. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ASSETS_CONNECTORID` | `databricks-assets` | Identifier for the Databricks assets connector. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ASSETS_ENABLED` | `true` | Indicates whether Databricks asset tracking is enabled. |
| `DATAMESHMANAGER_CLIENT_DATABRICKS_ASSETS_POLLINTERVAL` | `PT10M` | Polling interval for Databricks asset updates, in ISO 8601 duration format. |


## Access Management Flow

When an Access Request has been approved by the data product owner, and the start date is reached, Data Mesh Manager will publish an `AccessActivatedEvent`. When an end date is defined and reached, Data Mesh Manager will publish an `AccessDeactivatedEvent`. The agent listens for these events and grants access to the data consumer in Databricks.
When an Access Request has been approved by the data product owner, and the start date is reached, Data Mesh Manager will publish an `AccessActivatedEvent`. When an end date is defined and reached, Data Mesh Manager will publish an `AccessDeactivatedEvent`. The connector listens for these events and grants access to the data consumer in Databricks.

### Consumer Type: Data Product

Expand All @@ -58,7 +58,7 @@ Example:
- Consumer is a data product with ID `c-300`.
- Access ID is `a-100`.

Agent Actions on `AccessActivatedEvent`:
Connector Actions on `AccessActivatedEvent`:

- Create a new service principal `dataproduct-c-300`, if it does not exist. (if a custom field `databricksServicePrincipal` is defined in the data product, the value will be used as the service principal name instead of the ID)
- Create a new group `access-a-100` for this access.
Expand All @@ -68,7 +68,7 @@ Agent Actions on `AccessActivatedEvent`:
- Add the group `team-t-300` to the group `access-a-101`.
- Grant permissions `USE SCHEMA` and `SELECT` on the schema `my_catalog.schema_220` to group `access-a-100`

Agent Actions on `AccessDeactivatedEvent`:
Connector Actions on `AccessDeactivatedEvent`:

- Delete the group `access-a-100`

Expand All @@ -82,15 +82,15 @@ Example:
- Consumer is a team with ID `t-400`.
- Access ID is `a-101`.

Agent Actions on `AccessActivatedEvent`:
Connector Actions on `AccessActivatedEvent`:

- Create a new group `team-t-400`, if it does not exist. (if a custom field `databricksGroupName` is defined in the team, the value will be used as the group name instead of the ID)
- Add all members of the team `t-400` to the group `team-t-400`.
- Create a new group `access-a-101` for this access.
- Add the group `team-t-400` to the group `access-a-101`.
- Grant permissions `USE SCHEMA` and `SELECT` on the schema `my_catalog.schema_220` to group `access-a-101`

Agent Actions on `AccessDeactivatedEvent`:
Connector Actions on `AccessDeactivatedEvent`:

- Delete the group `access-a-101`

Expand All @@ -104,13 +104,13 @@ Example:
- Consumer is an individual user with username `alice@example.com`.
- Access ID is `a-102`.

Agent Actions on `AccessActivatedEvent`:
Connector Actions on `AccessActivatedEvent`:

- Create a new group `access-a-102` for this access.
- Add the user `alice@example.com` to the group `access-a-102` (the agent currently assumes that the username in Data Mesh Manager and Databricks are equal).
- Add the user `alice@example.com` to the group `access-a-102` (the connector currently assumes that the username in Data Mesh Manager and Databricks are equal).
- Grant permissions `USE SCHEMA` and `SELECT` on the schema `my_catalog.schema_220` to group `access-a-102`

Agent Actions on `AccessDeactivatedEvent`:
Connector Actions on `AccessDeactivatedEvent`:

- Delete the group `access-a-102`

Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.datamesh-manager</groupId>
<artifactId>datamesh-manager-agent-databricks</artifactId>
<artifactId>datamesh-manager-connector-databricks</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>datamesh-manager-agent-databricks</name>
<description>Data Mesh Manager Agent for Databricks Integration</description>
<name>datamesh-manager-connector-databricks</name>
<description>Data Mesh Manager Connector for Databricks Integration</description>

<dependencies>

Expand All @@ -27,7 +27,7 @@
<dependency>
<groupId>com.datamesh-manager</groupId>
<artifactId>datamesh-manager-sdk</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
</dependency>
<dependency>
<groupId>com.databricks</groupId>
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/datameshmanager/databricks/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public DataMeshManagerEventListener dataMeshManagerEventListener(
WorkspaceClient workspaceClient,
AccountClient accountClient,
TaskExecutor taskExecutor) {
var agentid = databricksProperties.accessmanagement().agentid();
var connectorid = databricksProperties.accessmanagement().connectorid();
var eventHandler = new DatabricksAccessManagementHandler(client, workspaceClient, accountClient);
var stateRepository = new DataMeshManagerStateRepositoryRemote(agentid, client);
var dataMeshManagerEventListener = new DataMeshManagerEventListener(agentid, client, eventHandler, stateRepository);
var stateRepository = new DataMeshManagerStateRepositoryRemote(connectorid, client);
var dataMeshManagerEventListener = new DataMeshManagerEventListener(connectorid, "accessmanagement", client, eventHandler, stateRepository);
taskExecutor.execute(dataMeshManagerEventListener::start);
return dataMeshManagerEventListener;
}
Expand All @@ -75,10 +75,10 @@ public DataMeshManagerAssetsSynchronizer dataMeshManagerAssetsSynchronizer(
DataMeshManagerClient client,
WorkspaceClient workspaceClient,
TaskExecutor taskExecutor) {
var agentid = databricksProperties.assets().agentid();
var stateRepository = new DataMeshManagerStateRepositoryRemote(agentid, client);
var connectorid = databricksProperties.assets().connectorid();
var stateRepository = new DataMeshManagerStateRepositoryRemote(connectorid, client);
var assetsSupplier = new DatabricksAssetsSupplier(workspaceClient, stateRepository, databricksProperties);
var dataMeshManagerAssetsSynchronizer = new DataMeshManagerAssetsSynchronizer(agentid, client, assetsSupplier);
var dataMeshManagerAssetsSynchronizer = new DataMeshManagerAssetsSynchronizer(connectorid, client, assetsSupplier);
if (databricksProperties.assets().pollinterval() != null) {
dataMeshManagerAssetsSynchronizer.setDelay(databricksProperties.assets().pollinterval());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public record AccountProperties(

public record AssetsProperties(
Boolean enabled,
String agentid,
String connectorid,
Duration pollinterval
) {

}

public record AccessmanagementProperties(
Boolean enabled,
String agentid
String connectorid
) {

}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ datameshmanager.client.databricks.account.account-id=your-account-id
datameshmanager.client.databricks.account.client-id=your-account-service-principal-client-id
datameshmanager.client.databricks.account.client-secret=your-account-service-principal-client-secret

datameshmanager.client.databricks.accessmanagement.agentid=databricks-access-management
datameshmanager.client.databricks.accessmanagement.connectorid=databricks-access-management
datameshmanager.client.databricks.accessmanagement.enabled=true

datameshmanager.client.databricks.assets.agentid=databricks-assets
datameshmanager.client.databricks.assets.connectorid=databricks-assets
datameshmanager.client.databricks.assets.enabled=true
datameshmanager.client.databricks.assets.pollinterval=PT10M
datameshmanager.client.databricks.assets.tables.include=*
Expand Down

0 comments on commit c724253

Please sign in to comment.