How to add a file to the Resources directory so that it is accessible at runtime
How can I quickly update the code environment, upload a zipped certificate file to the resources directory, and then make the certificate file accessible during runtime?
I upload the file, modify the script so that an Environment Variable pointing to the folder is included, and grant the folder permissions. The path to the runtime Resources folder is then contained in the environment variable at runtime, but nothing is present in the resources folder.
Where can I get a written illustration of how to add a file to the Code Environment Resources Directory so that it is accessible during runtime?
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,088 Neuron
Hi, could you please clarify exactly what exactly you are trying to achieve? What is this certificate file and why do you need to copy it at run time? Thanks
-
exact same question
https://community.dataiku.com/t5/Using-Dataiku/How-to-load-a-file-to-Resources-directory-and-have-available-at/m-p/32900#M12164
What is the purpose of the "Upload" button in the Code Env > Resources page if after you Update the Code Env, all of the files you uploaded just get deleted and never get put into the Resources directory of the Code Env?Is this a bug?
-
@btsshirt
Looks like you can't have the "Rebuild env" check box checked, as then Dataiku will "Clears the code environment and rebuilds it from scratch." In other words, it clears the Resources Directory and only puts back what you are downloading in the Resources Initialization script (if you have the "Run resources init script" checked). Anything you upload does not get put back and you will have to re-upload it after you re-built (updated) the code environment.
If you are using the code environment in a Containerized Execution on an attached Kubernetes cluster, then you will also need to make sure the Code Env > Containerized Execution > Resources initialization > "Copy resources from local code environment" option is selected. Note that if you changed that after you uploaded your file to the Resources Directory, then you will need to rebuild (update) the code environment again, BUT make sure the "Rebuild env" check box is UN-checked. Otherwise, any file you uploaded into the Resources Directory will be deleted again and will not be copied into the Docker image that runs in the Containerized Execution on Kubernetes. -
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,088 Neuron
Could you please clarify exactly what exactly you are trying to achieve? In general it’s best for you to not mess with the environment files like this for the reason you found and other reasons as well. So why exactly do you need files placed there? Most likely there is a better way of doing this.
-
@Turribeach
No it is not. in any case the problem has been solved.