Operations¶
Editing files with Code Studio¶
The Code Studios run separately from DSS, in the Kubernetes cluster.
Some files are then synchronized between DSS and the Code Studio, in order for recipes / project libraries / … to be available within each Code Studio.
Files are:
synchronized from DSS to Code Studio when the Code Studio starts
synchronized from Code Studio to DSS when the Code Studio stops
synchronized both ways (with conflict detection) when clicking the “Synchronize files” button in the UI of the Code Studio
Each type of file is synchronized to a particular location in the Code Studio, which is overridable in the template settings.
All versioned files are under control of the DSS instance’s git, so it’s recommended to avoid putting large files or binary files in versioned areas. Instead, large files should preferably go into non-versioned (resources) areas
Project libraries¶
The usual Project libraries (see Reusing Python Code and Reusing R Code) are available to all Code Studios of the project. Project libraries are versioned in the version control of the project.
Project libraries can be edited outside of a Code Studio through the “Code > Libraries” menu
Project libraries are available at /home/dataiku/workspace/project-lib-versioned in the Code Studio by default.
Note
Project libraries can also have non-Python and non-R files, such as stylesheets, small static files, … For large files, use Project resources instead.
Project resources¶
- Project resources are:
non-versioned files that are global to a project, and available to all Code Studios of the project.
useful for storing artifacts that may be used by several Code Studios in the project, and that should not be versioned (usually because they are large), such as images.
available at /home/dataiku/workspace/project-lib-resources in the Code Studio by default.
Code Recipes¶
The code of code recipes (Python, R, SQL, Scala) is available to all Code Studios of the project, with one file per recipe.
The code is exactly what you see when editing a given recipe in the DSS UI, for example after opening it from the Flow.
Code Recipes are available at /home/dataiku/workspace/recipes in the Code Studio by default.
Code Notebooks¶
The source of code recipes (Python, R, SQL, Scala) is available to all Code Studios of the project, with one file per notebook.
The code is exactly what you see when editing a given recipe in the DSS UI, for example after opening it from the notebook menu.
Notebooks are available at /home/dataiku/workspace/notebooks in the Code Studio by default.
Code Agents¶
The source code for Python code agents is available to Code Studios within the project, enabling synchronization of code agent files.
Code agent source code is available at /home/dataiku/workspace/code_agents in the Code Studio by default.
Each code agent version has its own folder in the Code Studio. The agent code can be found in the agent.py file.
The folder also contains:
agent_test_query.json: a test query, as defined in DSS
test_agent.py: a Python script to test the agent in Code Studio using the above test query
Code Agent Tools¶
The source code for Python agent tools is available to Code Studios within the project, enabling synchronization of agent tools files.
Agent tool source code is available at /home/dataiku/workspace/agent_tools in the Code Studio by default.
Each agent tool is in its own Python file within the agent_tools folder.
Code Webapps¶
The source code (Python, JavaScript, HTML, CSS) of every DSS Python-based webapp is available to Code Studios within the project, enabling file synchronization for webapps.
Each webapp is located in its own folder within the /home/dataiku/workspace/webapps folder (by default).
The Python, JavaScript, CSS, HTML code is exactly what you see when editing a given webapp in the DSS UI. In addition, each webapp folder contains:
README.md: a simple README containing dependency information, extendable as needed to facilitate collaboration.
vscode_launch.py: a launcher to enable running and debugging the webapp in Code Studio.
Code Studio versioned files¶
These files are specific to each Code Studio and are not shared between Code Studios.
These files should be used for Code Studios that define an application (such as a Streamlit Application), for the code of the application itself. For example, the default “Streamlit” block for templates puts the code of the application there.
Code Studio versioned files can be edited in DSS, in “Files > Versioned” in the UI of the Code Studio.
Code Studio versioned files are available at /home/dataiku/workspace/code_studio-versioned in the Code Studio by default.
Code Studio resource files¶
These files are specific to each Code Studio and are not shared between Code Studios.
These files should be used for Code Studios that define an application (such as a Streamlit Application), for storing artefacts that are needed by the Code Studio and that should not be versioned (usually because they are large), such as images.
Code Studio resource files can be edited in DSS, in “Files > Resources” in the UI of the Code Studio.
Code Studio resource files are available at /home/dataiku/workspace/code_studio-resources in the Code Studio by default.
User config files¶
These files are shared across all Code Studios of a user and are not shared between users.
They are useful to store user settings.
In the built-in blocks for Visual Studio Code, RStudio Server and JupyterLab, this folder is used to store the IDE configuration.
User config files are available at /home/dataiku/workspace/user-versioned in the Code Studio by default
User resource files¶
These files are shared across all Code Studios of an user, and are not shared between users. They are not versioned.
They are useful to store user artifacts that should not be versioned, such as plugins, tools, …
User resource files are available at /home/dataiku/workspace/user-resources in the Code Studio by default.