cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Private Python Package in Serverless Job

vinitkhandelwal
New Contributor III

I am trying to create a Databricks Job using Serverless Compute. I am using wheel file to run the Python Job.

Screenshot 2024-07-03 at 8.50.30โ€ฏPM.png

The wheel file has setup.py file using which all dependencies are installed. One of the package dependency is a private package hosted on Gitlab Python Package Registry. โ€ƒNow this package installation needs some access details to be provided to the compute. Earlier when I was not using Serverless compute, I was able to add init_script to compute and that would run before setup.py, thereby giving access to private registry to install the private package.

The init_script added registry login details to /etc/pip.conf file as follows:

 

 

 

#!/bin/bash
if [[ $GITLAB_TOKEN ]]; then
use $GITLAB_TOKEN 
fi
echo $PYPI_TOKEN
printf "[global]\n" > /etc/pip.conf
printf "extra-index-url =\n" >> /etc/pip.conf
printf "\thttps://__token__:$GITLAB_TOKEN@gitlab.com/api/v4/projects/12345678/packages/pypi/simple\n" >> /etc/pip.conf

 

 

 

 But now with Serverless, there is no option to add init scripts, so how do I allow the compute to be able to install private package?

2 REPLIES 2

@Retired_mod  Can you guide, how can I achieve your goal of installing a private package hosted on Gitlab Python Package Registry?

djhs
New Contributor III

With a pre-signed URL you mean that I need to expose my Gitlab token in a the index URL? Is there a way inject the Gitlab token without exposing it? I haven't found one thus far.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group