Development in the Data Studio and Custom Environments
If you are developing an app within the Data Studio RStudio environment, for example, you would have access to our SB File system and could read project files or export data to projects.
Moreover, you will be able to save your environment with installed dependencies using the Custom Environments feature. This functionality allows users to save the image of their environment and continue where they left off.
By using Data Studio for development, you do not have to assume the existence of the sbgenomics directory and mock it, since it will be present on the instance for accessing the project files or exporting them. Next, by using the Custom environments, you do not have to worry about tracking the required dependencies, since the whole environment would be saved. It is important to note that only files (and installed packages) outside of the /sbgenomics
folder will be saved in the Custom environment.
However, there are some rules you must follow to save the app project properly and setup everything for publishing:
- By default, when starting a new Data Studio analysis, the working directory on the instance is set to
sbgenomics/workspace
. You can create a project, develop the app within this directory, and save the environment as Custom environment during the app development. - If the interaction with the Platform is needed (importing and exporting files), setting the paths in the app to project-files, output-files or workspace directories should be absolute:
/sbgenomics/project-files
/sbgenomics/output-files
/sbgenomics/workspace
- When you are ready to publish the app, depending on the approach you have chosen, most probably you would have to move the app project directory from the sbgenomics/workspace to the root directory (using sudo terminal commands) for example:
cd /
- go back to root directorysudo mv sbgenomics/workspace/<myAppName> /<myAppName>
- If the app is created via golem, then you would have to build the tar.gz file, move it to the root directory and install it like any other package from source.
- Next, you would have to create a bash file
init-shiny
that would contain the run app command (as explained before). - It is important to set the port to 3838 in the run command. This is where the app will be running in the container.
- When everything is ready, you should save the environment as a new Custom Environment.
- Finally, you should create a publishing request for our Support team specifying the name of the Custom environment you have created that contains your app.
Updated about 2 months ago