Skip to content

Networking#

In order for Spark to communicate with the Feature Store from Databricks, networking needs to be set up correctly. This includes deploying the Hopsworks Instance to either the same VPC or enable VPC/VNet peering between the VPC/VNet of the Databricks Cluster and the Hopsworks Cluster.

AWS#

Step 1: Ensuring network connectivity#

The Spark DataFrames API needs to be able to connect directly to the IP on which the Feature Store is listening. This means that if you deploy the Feature Store on AWS you will either need to deploy the Feature Store in the same VPC as your Databricks cluster or to set up VPC Peering between your Databricks VPC and the Feature Store VPC.

Option 1: Deploying the Feature Store in the Databricks VPC

When deploying the Feature Store Hopsworks instance, select the Databricks VPC and Availability Zone as the VPC and Availability Zone of your Feature Store cluster. Identify your Databricks VPC by searching for VPCs containing Databricks in their name in your Databricks AWS region in the AWS Management Console:

Identifying the Databricks VPC
Identifying the Databricks VPC

Hopsworks installer

If you are performing an installation using the Hopsworks installer script, ensure that the machines you are going to install Hopsworks on are configured with the respective VPC.

Hopsworks.ai

If you are working on Hopsworks.ai, you can directly deploy the Hopsworks instance to the Databricks VPC, by simply selecting it at the VPC selection step during cluster creation.

Option 2: Setting up VPC peering

Follow the guide VPC Peering to set up VPC peering between the Feature Store cluster and Databricks. Get your Feature Store VPC ID and CIDR by searching for thr Feature Store VPC in the AWS Management Console:

Identifying the Feature Store VPC
Identifying the Feature Store VPC

Step 2: Configuring the Security Group#

The Feature Store Security Group needs to be configured to allow traffic from your Databricks clusters to be able to connect to the Feature Store.

Hopsworks.ai

If you deployed your Hopsworks Feature Store instance with Hopsworks.ai, it suffices to enable outside access of the Feature Store and Online Feature Store services.

Open your feature store instance under EC2 in the AWS Management Console and ensure that ports 443, 9083, 9085, 8020 and 50010 are reachable from the Databricks Security Group:

Hopsworks Feature Store Security Group
Hopsworks Feature Store Security Group

Connectivity from the Databricks Security Group can be allowed by opening the Security Group, adding a port to the Inbound rules and searching for dbe-worker in the source field. Selecting any of the dbe-worker Security Groups will be sufficient:

Hopsworks Feature Store Security Group details
Hopsworks Feature Store Security Group details

Azure#

Step 1: Setting up VNet peering between Hopsworks and Databricks#

VNet peering between the Hopsworks and the Databricks virtual network is required to be able to connect to the Feature Store from Databricks.

In the Azure portal, go to Azure Databricks and go to Virtual Network Peering:

Azure Databricks
Azure Databricks

Select Add Peering:

Add peering
Add peering

Name the peering and select the virtual network used by your Hopsworks cluster. The virtual network is shown in the cluster details on Hopsworks.ai (see the next picture). Ensure to press the copy button on the bottom of the page and save the value somewhere. Press Add and create the peering:

Configure peering
Configure peering

The virtual network used by your cluster is shown under Details:

Check the Hopsworks virtual network
Check the Hopsworks virtual network

The peering connection should now be listed as initiated:

Peering connection initiated
Peering connection initiated

On the Azure portal, go to Virtual networks and search for the virtual network used by your Hopsworks cluster:

Virtual networks
Virtual networks

Open the network and select Peerings:

Select peerings
Select peerings

Choose to add a peering connection:

Add a peering connection
Add a peering connection

Name the peering connection and select I know my resource ID. Paste the string copied when creating the peering from Databricks Azure. If you haven't copied that string, then manually select the virtual network used by Databricks and press OK to create the peering:

Configure peering
Configure peering

The peering should now be Updating:

Cloud account settings
Cloud account settings

Wait for the peering to show up as Connected. There should now be bi-directional network connectivity between the Feature Store and Databricks:

Cloud account settings
Cloud account settings

Step 2: Configuring the Network Security Group#

The Network Security Group of the Feature Store on Azure needs to be configured to allow traffic from your Databricks clusters to be able to connect to the Feature Store.

Ensure that ports 443, 9083, 9085, 8020 and 50010 are reachable from the Databricks cluster Network Security Group.

Hopsworks.ai

If you deployed your Hopsworks Feature Store instance with Hopsworks.ai, it suffices to enable outside access of the Feature Store and Online Feature Store services.

Next Steps#

Continue with the Hopsworks API Key guide to setup access to a Hopsworks API Key from the Databricks Cluster, in order to be able to perform requests to the Hopsworks Feature Store.