Is it possible to run a shell script stored in the git cloned project in Dataiku Library?

Hi,
I am new to Dataiku so not much experience yet. I am trying to use a module the code of which I have cloned from git into the Dataiku Library. The cloned project contains a .sh file that I need to run to be able to use the module. I tried this code:
import subprocess
script_path = "full path to .sh file"
try:
result = subprocess.run([script_path], capture_output=True, text=True, check=True, shell=True)
print("Script executed successfully:")
print(result.stdout)
except subprocess.CalledProcessError as e:
print(f"Error executing script: {e}")
print(e.stderr)
But I keep getting this error:
Error executing script: Command '['path to sh file']' returned non-zero exit status 126./bin/sh: 1: path to sh file: Permission denied
Is this just a user permission issue, or it is not possible to run sh files stored in Dataiku library?
Best Answers
-
Never mind, apparently I needed to set execution permission on that sh file:)
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,501 Neuron
You may also want to use the Shell Code Recipe which will allow you execute Shell code directly without using Python.