Civis Studio provides a development environment within the secure context of Civis Platform. Use it to edit multiple files, perform git operations, and debug your code before productionalizing in a script or workflow!
Civis Studio also facilitates secure access to Civis Platform databases and credentials via Parameters.
To view a short video explaining this feature, visit this link.
What is Civis Studio?
Civis Studio is a secure virtual development environment built with the open source version of Visual Studio Code. Civis Studio allows you to write, run, and commit code to Github.
Civis Studio offers a customized development environment with a broad number of available extensions and configuration options, similar to local VS Code installations. However, some extensions may not be available to the open source version of VS Code.
Persistence
Most changes, installs, and configuration will persist between Civis Studio deployments. This includes:
- Uncommitted code changes
- Cloned repositories
- VS Code extensions
- VS Code settings
- System packages installed to the HOME directory
- Python packages installed in a virtual environment (e.g. uv or pyenv)
Some installations and variables will not be persisted:
- Global python package installations (e.g. not installed using a virtual environment)
- System packages installed outside the HOME directory
- Manually set environment variables
Please note that there is a 10 GB storage limit per studio.
Version Control
To initialize a Civis Studio with a git repository, use the “Repository” selector in the “Settings” dropdown. Changing this selector between deployments will add additional repositories to your studio. Repositories may also be cloned (or removed) from the built in terminal.
Civis Studio will persist unsaved changes between user sessions. However, we recommend committing and pushing all code changes to GitHub so that those changes can be used by other teammates and in other areas of Civis Platform, e.g. scripts.
Connecting to GitHub
Civis Studio will use your pre-existing Civis Platform GitHub Credential to connect to GitHub and perform git operations.
If you do not yet have a GitHub Credential in Civis Platform, we recommend you create one. You can do so by going to the Profile Page and clicking the "Git Repos" tab, then “Connect to Github.”
Parameters: Defining Environment Variables
Define persistent environment variables for your Civis Studio using parameters. Although similar to Script Parameters, studio parameters feature a new inline creation and editing process.
To add parameters to your studio, open the “Settings” dropdown menu and click “Add Parameter”.
Set a type, name, and optional description using the modal, then click “Add”.
Once you’ve created the parameter, you can set a value for it. Once you’re finished modifying parameters, click “Save” to save your changes.
To edit an existing parameter, click the pencil icon.
To view what environment variables the parameter will generate, click the caret. Civis Studio parameters follow the same naming convention as script and notebook parameters to allow for easy code portability between Civis Platform objects.
By default, all Civis Studios have a CIVIS_API_KEY and CIVIS_STUDIO_ID environment variable available.
AI Integration
Civis Studio includes a beta version of the open-source Copilot Chat extension. This extension can be used to code collaboratively with a Large Language Model (LLM). To learn more about this feature, please see our Copilot Chat Documentation.
Compute Usage
Similar to Notebooks and Services, Civis Studios run on Kubernetes resources. You can configure the memory and CPU available to your studio from the “Settings” dropdown.
If you do not shut down your studio before exiting the page, it will continue to run and consume computing resources. To limit unintended usage, unused studios will automatically shut down after they’ve been unviewed for 1 hour.
Organization Admins can view, and if necessary cancel, studios running on their cluster from the Platform Usage Overview.
Best Practices
- Use a virtual environment like uv or pyenv for managing python versions and packages.
- Shut down your studio promptly after usage to conserve compute resources.
FAQs
Can I run dbt in a Civis Studio?
Yes! We enjoy using the dbt Power User extension to help with dbt development in Civis Studio. It can be installed from the Extensions pane (building block icon) on the left side of the studio.
The paste command isn’t working in the terminal - how do I fix it?
Permissions will need to be set to allow Civis Studio to read from your clipboard. The first time you try to paste something into the terminal, you should see this popup in the address bar:
Click “Allow” in the address bar popup to allow the paste command to work.
If you miss the popup the first time, or want to manage the permission later, click the settings icon in the far left of the address bar and toggle the “Clipboard” permission.
Can robot users use Civis Studio?
Yes, Civis Studio can be used when assuming roles, including robot user roles. However, please be aware that Civis Studio is not built for concurrent use by multiple users. If two or more users use Civis Studio at the same time, they may run into saving issues. Users cannot edit the same files at the same time; one user’s changes will need to take priority over the others and you may see a warning like in the screenshot below.
For this reason, we recommend being careful when using Civis Studio while assuming a role.
Can I use a custom docker image to back my Civis Studio?
No, we currently don’t support custom docker images with Civis Studio. If you need access to system packages which are not persisting across deployments, we recommend checking to see if the package installation location can be customized. If so, then set the installation location to the HOME directory and it should persist. If not, creation of a package installation script may be helpful.
I just saw a popup warning that “The git repository in the current folder is potentially unsafe” - what does that mean?
If you manually clone a repository from a studio terminal, rather than via the Repository selector in the UI, this message may appear. Feel free to add the repository to git’s list of safe repositories by clicking “Manage Unsafe Repositories.” Repositories cloned via Civis Studio settings are automatically trusted.
Civis Studio is built with the open source version of Visual Studio Code. Microsoft Visual Studio Code is a trademark of the Microsoft Corporation.
Comments
0 comments
Article is closed for comments.