1

I have Bluemix Spark notebooks that I want to share with others. I'd like them to be able to run the notebooks using data on the object storage associated with my Spark instance (so they don't need to load the data themselves).

I'm using the following to configure object storage in a Scala notebook (this code was taken from another stackoverflow post).

def setConfig(name:String, dsConfiguration:String) : Unit = {
val pfx = "fs.swift.service." + name
val settings:Map[String,String] = dsConfiguration.split("\\n").
    map(l=>(l.split(":",2)(0).trim(), l.split(":",2)(1).trim()))(breakOut)

val conf = sc.getConf
conf.set(pfx + "auth.url", settings.getOrElse("auth_url",""))
conf.set(pfx + "tenant", settings.getOrElse("tenantId", ""))
conf.set(pfx + "username", settings.getOrElse("username", ""))
conf.set(pfx + "password", settings.getOrElse("password", ""))
conf.set(pfx + "apikey", settings.getOrElse("password", ""))
conf.set(pfx + "auth.endpoint.prefix", "endpoints")
}

setConfig("spark", YOUR_DATASOURCE)

I'm able to successfully access data on my own object storage using the following in Scala notebooks running on my ownluemix Spark service.

val data = sc.textFile("swift://notebooks.spark/mydata.data")

However, others who I've shared the notebook with are not able to access the data on my object storage, using the same object storage configuration shown above, when running the notebook in their own Bluemix Spark service.

How can others running Spark notebooks on their own Bluemix Spark service access data on object storage associated with my Bluemix Spark service.

Rich Tarro
  • 41
  • 2
  • Have you tried to generate new credentials and share those credentials for each user you share your notebook with?(i have not tried this) Just Open your object storage service and then go under service crdentials and click Add Credentials and that will generate new credentials. See if using a new credentials for each user helps. – charles gomes May 05 '16 at 23:23
  • Do you pass this function to another user with or without your credentials for your associated Bluemix Object Storage V3 ? – Sven Hafeneger May 11 '16 at 12:59