Adding bitbucket library in code environment UI

ak12
Adding bitbucket library in code environment UI

I am looking to add an R library in a private repo in bitbucket to a code env, I have tested adding it as a project level library as per this document (https://knowledge.dataiku.com/latest/courses/governance/collaboration/git-projects.html) which is working fine.

However ideally I would have the package in the code env so it is more widely available. I have successfully installed packages in the code env from github using this syntax: git+https://github.com/<package>.git but I cannot seem to get it to work with a bitbucket link. The error I am getting just says that it is not available. For reference I am using Dataiku version 9.0.5

Is there anything I am overlooking? Or is this only available through github?

0 Kudos
2 Replies
AlexT
Dataiker

Hi @ak12 ,

Is your bitbucket repo public or private? If it's private repo you may need to create an app password:

https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/

And include this in your URL: 

git+https://USER_NAME:APP_PASSWORD@GIT_URL/PATH_TO_YOUR_REPO.git

 

Thanks,

0 Kudos
sergeyd
Dataiker

Hi, 

If we are talking about R code envs, the quick answer is no, it's not possible to install R packages from the git repositories from DSS UI.

In R, to install the package from Git, you need to do this manually from the CLI using either "devtools" or "remotes" R packages. This will require something like this: 

install.packages('devtools')
require(devtools)
devtools::install_github("dmlc/xgboost")
# or:
library(devtools)
install_github("dmlc/xgboost")
which is not possible from DSS UI as we search for packages only within the R CRAN mirror set in the code env config. 
 

The syntax for the package:

git+https://github.com/<package>.git
works for python code env as you can use this syntax in pip install commands but this doesn't work for R.