Code Ocean User Guide
v3.6.0
v3.6.0
  • Welcome to Code Ocean
  • Onboarding
    • Quick Start Guides
      • Create a Capsule in 5 minutes
      • Create a Pipeline in 5 minutes
    • Video Library
  • Key Concepts
  • Capsule Guide
    • The Capsule Interface
      • File Navigation/App Builder Panel
      • Editor Panel
      • Reproducibility Panel
    • The Structure of a Capsule
      • Metadata
      • Environment
      • Code
      • Data
      • .codeocean
      • Scratch
      • Results
    • Reproducible Runs
    • Version Control
      • Importing a Capsule from a Git Provider
      • Clone via Git...
    • Managing Capsules
      • Sharing a Capsule with Secrets
      • Exporting Capsules to your Local Machine
    • Secret Management Guide
      • Setting a Secret in the Account Settings Page
      • Accessing a Secret in a Capsule
  • Setting up the Environment
    • Selecting a Starter Environment
    • Package Managers and Adding Packages
    • Installing R packages
    • Environment Variables
    • Build Log
    • Post-Install Script
    • Compute Resources
  • Working in a Cloud Workstation
    • Launching a Cloud Workstation
      • Running RShiny in Code Ocean
      • Running Streamlit in Code Ocean
      • Using Terminal in Code Ocean
      • Using Ubuntu Desktop in Code Ocean
      • Using MATLAB in Code Ocean
      • Using VS Code in Code Ocean
    • Exiting a Cloud Workstation Session
  • Data Assets Guide
    • Types of Data Assets
    • Creating a New Data Asset
    • Capturing a Result
      • Provenance of the Result Data Asset
    • Using Data Assets in a Capsule
    • Managing Data Assets
      • Finding Data Assets
        • Custom Metadata
  • Pipeline Guide
    • The Pipeline UI
      • File Tree System
      • Pipeline App Panel
      • Timeline
    • Components of a Pipeline
      • Nextflow File
      • Capsules
      • Data
      • Results Bucket
      • Map Paths
      • Capsule Settings
      • Pipeline Settings
      • .codeocean
    • Managing Pipelines
      • Exporting Pipelines to your Local Machine
    • Capsule vs Pipeline Differences
    • How to Run Code in Parallel
    • Nextflow Configurations
    • Pipeline Monitoring
      • Monitoring Dashboard
      • Task Details
    • Nextflow Artifacts
    • nf-core Pipelines
      • Import nf-core pipelines
      • nf-core RNASeq Tutorial
        • iGenomes
    • Pipeline Tutorial
  • Release Capsules and Pipelines
    • Creating and Using Release Capsules
    • Creating Release Pipelines
    • Internal Releases
  • Collections
  • Code Ocean Apps
    • Genomics
    • Cheminformatics
    • Visualization
    • Machine Learning
    • Data Connectors
    • Quality Control
    • Use Cases and Examples
      • CombFold Pipeline
      • Data Connector Example
      • Gene Set Enrichment Overview
      • RNASeq Quantification Pipeline
  • App Panel Guide
    • App Builder User Interface
      • Validation pattern for strings
    • Passing App Panel's Parameters to the Script
    • Releasing an App Panel Capsule
    • Executing an App Panel Capsule
  • MLflow Guide
    • Enable MLflow Tracking
    • MLflow UI
    • Creating Models
    • MLflow Permissions
  • Models Guide
    • Creating Models
    • Managing Models
  • Git Provider Integration Guide
    • Setting up the Integration
    • Using Git Provider Integration
  • Code Ocean API
    • Authentication
    • Errors
    • Capsule
    • Computation
    • Data Asset
    • Python SDK
  • More Support
Powered by GitBook
On this page
  • Hold
  • Shut Down
  • Hold and Resume a Cloud Workstation
  • Edit a 'CW on Hold' Capsule
  • Resume or Discard a 'CW on Hold' Capsule
  • Collaborating on a Held Capsule
  • Shut Down a Cloud Workstation
  • Package Suggestions
  • Behavior of a Capsule Upon Cloud Workstation Hold/Pause and Shutdown

Was this helpful?

  1. Working in a Cloud Workstation

Exiting a Cloud Workstation Session

PreviousUsing VS Code in Code OceanNextData Assets Guide

Was this helpful?

There are two mechanisms to exit a Cloud Workstation session - Hold and Shut Down. Both options sync new content created in the Cloud OWrkstation back to the Capsule. The primary difference lies in how they handle session preservation and installed packages.

Hold

  • Retains all installed packages and folders created during the session

  • When you return to the session, you can resume working without resintalling or recreating anything.

Shut Down

  • Does not preserve installed packages.

  • When the Cloud Workstation session is shutdown the system will display which packages were installed during the session and prompt you to add them to the Capsule's environment via the Package Managers.

    • If you want the packages available in the Cloud Workstation, you need to add them to the Capsule environment and rebuild the Capsule first.

Hold and Resume a Cloud Workstation

When exiting a Cloud Workstation via Hold, the system will suspend the docker container from the Capsule. This will preserve all working spaces at the time when you leave the Cloud Workstation. The next time you access the Capsule, it will resume the Cloud Workstation session with all the command history, the files or folders you created, and the packages you installed in the previous session.

A Cloud Workstation on Hold will not save anything that would be lost when the kernel is shut down. This includes anything in memory (i.e., previously run Jupyter cells, etc.)

To Exit a Cloud Workstation with Hold

  1. Click the Shut Down button.

  2. Click Hold to return to the Capsule and close the Cloud Workstation.

  3. After the Cloud Workstation is held, the system redirects you to the Capsule view.

    On the Capsule dashboard, you can see the status of the Capsule is 'CW on hold' when you hover over the Capsule.

Edit a 'CW on Hold' Capsule

You can edit a Capsule with a 'CW on Hold' status. You can add new files, execute a Reproducible Run, attach a secret and a Data Asset.

You can add packages in the Environment Editor, but since the Cloud Workstation is on hold (the Docker container for the computation is on hold), the changes will be effective when the Docker container is rebuilt.

Resume or Discard a 'CW on Hold' Capsule

In the Capsule view under the Reproducible Run button, you can choose to either Resume or Discard a held Cloud Workstation.

  • Resume: Restores the Cloud Workstation to its previous state and allows you to continue the session.

  • Discard: Shuts down the Cloud Workstation, ending the session entirely.

Collaborating on a Held Capsule

Collaborators with edit permissions can:

  • View files synced from a held Cloud Workstation session.

  • Resume the held Cloud Workstation to continue working from the previous session as shown below.

Shut Down a Cloud Workstation

When exiting a Cloud Workstation via Shut Down, the system turns off the Docker container associated with the Capsule and syncs back all the content under the ~/capsule directory, which includes the following folders:

  • /metadata

  • /environment

  • /code

  • /data

  • /scratch

  • /results

This means that it will not preserve any content created outside the "Capsule" folder, or any packages installed during the session. Installed packages will be suggested via a reminder in Package Suggestions, and you can choose to add them to the environment editor.

Content saved outside the ~/capsule directory or within the /results folder will not be synced back to the Capsule and will be lost in future sessions.

Note: A Cloud Workstation can be shut down, or put on hold either directly from the Cloud Workstation or from the Capsule Dashboard as shown below

Package Suggestions

The system detects new packages installed during your Cloud Workstation session. When you shut down the Cloud Workstation and return to the Capsule view, a reminder will appear indicating the new packages that were installed in the Cloud Workstation.

Behavior of a Capsule Upon Cloud Workstation Hold/Pause and Shutdown

A Cloud Workstation session will be paused when it has run idle (<2% CPU usage) for 2 hours and the browser tab is inactive. Scenarios that will result in an inactive browser tab include: closing the tab, shutting down the browser, and shutting down the computer. Note that a computer’s sleep state doesn’t always result in an inactive browser tab as networking is still taking place. A Cloud Workstation session will continue running if the browser tab is active, even if it has run idle for over 2 hours.

Capsule Component
Restored after Cloud Workstation termination
Restored after Cloud Workstation hold/pause

Changes made to files written to /scratch, /code, and /data

Changes made to files written to /results

Data Assets attached in CW

Data Assets detached in CW

Occupied root volume

Installed Packages

Loaded Packages (R)

Created virtual environments

Linux environment variables set

Variable values

Output of previous Jupyter cells

R environment states/previously run lines

Unsaved changes written to R scripts

Note: the version of the file is subject to change

VSCode active debug sessions

Previous Actions in no-code app

VSCode - installed extensions

Preferences set in RStudio (Font size, theme color, etc.)

Preferences set in Jupyterlab (Dark/Light mode, UI Font size)

For reproducibility, it is strongly recommended to install packages using the .

To reproduce the environment that you created in the Cloud Workstation, review the package suggestions and add the appropriate packages to via the Environment Editor. Refer to to learn more about installing packages in the Capsule view.

Environment Editor
Package Managers and Adding Packages
✅
✅
❌
❌
✅
✅
✅
✅
❌
✅
❌
✅
❌
❌
❌
✅
❌
❌
❌
❌
❌
❌
❌
❌
❌
✅
❌
❌
❌
❌
❌
✅
❌
✅
❌
✅