> For the complete documentation index, see [llms.txt](https://docs.rhinofcp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rhinofcp.com/creating-and-running-code-objects/creating-and-running-interactive-container-code.md).

# Creating and Running Interactive Container Code

Explains how to create and run code in an interactive container.

## What is an Interactive Container Code Object?

Interactive Container Code lets you run pre-built container images with interactive apps or graphical interfaces. You can use tools like Jupyter Notebooks directly on your on-premises data while keeping that data secure.

### Key Attributes of Interactive Container Code

* **Interactive GUIs:** Unlike other Code Objects, Interactive Containers enable you to execute containers with interactive graphical user interfaces. This facilitates real-time interaction and data visualization within the FCP environment.
* **On-Premises Interaction:** Interactive Containers offer the capability to interact with on-premises data while leveraging the computational power of the FCP. This integration is particularly useful for scenarios where data remains within internal networks.
* **Third-Party Applications:** With Interactive Container Code Objects, you can run third-party applications that are containerized and can be executed within the FCP ecosystem, with no need to install them at each site.

{% hint style="info" %}
NOTE: This capability is limited to third-party applications that can run within a single Linux-based container with no internet connectivity.
{% endhint %}

### Use Cases of Interactive Containers

* **Real-Time Data Exploration:** Utilize interactive visualizations and tools to explore and analyze on-premises healthcare data within the FCP ecosystem.
* **Third-Party Applications:** Run containerized third-party applications such as medical image annotation tools or specialized analysis software.
* **Collaborative Workshops:** Conduct collaborative workshops or training sessions that involve hands-on exercises and interactive activities.

### Benefits of Interactive Containers

* **Interactive Experience:** Gain the ability to interact with GUIs and applications in real-time, fostering dynamic exploration of your data.
* **On-Premises Compatibility:** Execute containerized applications on your on-premises data while utilizing the computational resources of the FCP.
* **Secure Collaboration:** Enable secure collaboration by running third-party tools and applications within the FCP environment, ensuring data privacy.

### Summary

In summary, Interactive Containers offer an innovative pathway to engage with interactive graphical interfaces and applications within the Rhino FCP. By merging on-premises data with containerized interactivity, you can delve deeper into data exploration, collaboration, and visualization while maintaining the highest levels of security and privacy.

## Creating New Interactive Container Code

{% stepper %}
{% step %}
**Go to the main project's page and select your project.**
{% endstep %}

{% step %}
**Select `Code` from the menu on the left to open the `Code Objects` page.**

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/S6VrI53xhcaCFoo43FAa/24602867570973)
{% endstep %}

{% step %}
**Select the `Create New Code Object` button to open the `Create New Code Object` page.**

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/vqlIXEvqbCL9OWgOCALN/24602898072093)
{% endstep %}

{% step %}
**Select the Interactive Container as the Code Object Type.**

The page changes to show the fields needed for this object type.

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/WOX2ueyYDuIE0CWZuOXd/24602867572893)
{% endstep %}

{% step %}
**Enter information in the following fields.**

*Before you enter information in the fields (see table below), read the following about input and outputs*

*Code objects usually require that you know the number of inputs and outputs your code needs. Those inputs and outputs are provided as data schemas. For example, if your code splits one dataset into two (like a train/test split), you will have to create a code object with one input schema and two output schemas. For more detail into how to structure your code to run on FCP, see* [*Accessing your datasets in Code Objects*](/creating-and-running-code-objects/accessing-your-datasets-in-code-objects.md)*.*

*Multiple input and output datasets are supported in Python, Generalized, and Interactive Container Code Objects. While NVFlare Code Objects do not support multiple datasets, they can still be used as before for learning and inference across multiple sites.*

{% hint style="info" %}
**NOTE:** If you don't need this level of control, you can:

* Set any input or output as optional, which will allow to provide or generate no datasets respectively
* Set any input or output as a list, which will allow to select 1 or more datasets
* Select "ANY" as input schema, which will allow code object re-use across any input dataset schema.
* Let the system automatically determine the output schemas with [Auto-Generated Data Schemas](/data-schemas/auto-generated-data-schemas.md).
  {% endhint %}

<table><thead><tr><th width="264.5390625">Field/Button</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>Indicates the name you want to provide for the code object.</td></tr><tr><td>Description</td><td>Provides a brief summary of what the code object does.</td></tr><tr><td>Input (including three-dot menu items)</td><td>Indicates the file(s) needed for the code object to run properly. Your selection here will affect which Dataset(s) can be selected as input when triggering a Code Run with this Code Object. You can enter one or more input files, such as schemas, configuration files, or others. File(s) can be in DICOM, JSON, and or text formats.<br>- If your input doesn't require a schema, select Any.<br>- Select the Add button to the right of the input entry to add another input. You can add as many as you like.<br>- If your input includes more than a single dataset, select the three dot menu to the right of the Input field, then select Input is a list.<br>- If the input is optional, select the three-dot menu to the right of the Input field, then select Optional Input.</td></tr><tr><td>Output</td><td>Indicates the output file(s) produced when the code object run. You can enter one or more output files. Files can be in DICOM, JSON, and or text formats.<br>- You can also select the option to <em>[ Auto-generate Data Schema from Data ]</em>. For more information about Auto-generating Data Schemas, please refer to <a href="/data-schemas/auto-generated-data-schemas.md">Auto-Generated Data Schemas</a>.<br>- Select the Add button to the right of the output entry to add another output. You can add as many as you like.<br>- If your output includes more than a single dataset, select the three dot menu to the right of the Output field, then select Output is a list.<br>- If the output is optional, select the three-dot menu to the right of the Output field, then select Optional Output.</td></tr><tr><td>Container</td><td>Specifies the name of the Docker container you would like to execute when running this Code Object. This will either be a container image created by someone from your workgroup that is available on your ECR or an image provided by Rhino. If you need a refresher on pushing containers to your ECR, please refer to <a href="/getting-started/quick-start-guide/pushing-containers-to-the-ecr.md">Pushing Containers to the ECR</a>.</td></tr></tbody></table>
{% endstep %}

{% step %}
**After you've completed your details, you can choose to set required compute resources.**

If you want to do this, see [Autoscaling and Compute Resources](/creating-and-running-code-objects/autoscaling-and-compute-resources.md) for more information.
{% endstep %}

{% step %}
**Select the Create New Code button to create the new Code Object.**
{% endstep %}

{% step %}
**The Code Object appears in the Code Object page.**

When you have completed adding all your Interactive Container *Code* details, click the **Create New Code** button to create your new *Code Object.*
{% endstep %}
{% endstepper %}

## Viewing a Code Object's Configuration

To get an object's configuration, make sure you are on the page containing the original object you would like to view the configuration of. In the box where your original object is, there should be a row for each version. Navigate to the version you would like to view the configuration for and select the three-dot menu button, shown below:

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/BgQM5mGOLbhuUwL3JgI0/13002096256797)

The menu button is on the right-hand side of the row, click it to view a new menu. The new menu should have an option to show that object's configuration, click on that to see the object's configuration.

For Code Objects and Code Runs, if you chose the Use VM Pool option, you will use the pool that was indicated during the Code Object or Code Run configurations.  Selecting this option shows the resources, including the number of VMs and vCPUs that will be allocated, as well as the amount of RAM, the size of the disk, the number of GPUs, the GPU type/mode&#x6C;*,* and the amount of VRAM.

## Creating a New Interactive Container Code Version

1. Go to the page that has the original object you want to create a new version of.
2. In the upper right corner of the box where your original object is, select the **+ New Version** button.
3. A new window appears that allows you to create a new version of your object.

## Removing a Code Object

To remove a code object, complete the following steps.

{% stepper %}
{% step %}
**Open the Code Objects page**

Go to the page that lists your code objects.
{% endstep %}

{% step %}
**Find the code object version**

If needed, use the search fields at the top right.

* Use **Search Name** to search by code object name.
* Use **Search Description** to search by code object description.

Each code object appears with a row for each version. Find the version you want to delete.
{% endstep %}

{% step %}
**Open the menu for the version**

Select the three-dot menu on the right side of the version row, shown below.

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/4DgRiNLSEzRn8aP9B9FL/13002670465821)
{% endstep %}

{% step %}
**Remove the code object version**

Select **Remove code object**.

Repeat these steps for each version you want to remove. When you delete the last version, the code object is fully deleted.
{% endstep %}
{% endstepper %}

To run interactive container code, you'll need to go to the Code Objects page, then fill out the run details.

## Running Interactive Container Code

After you have created a Interactive Container code object, do the following to run the interactive container code.

{% stepper %}
{% step %}
**Go to the main project's page and select your project.**
{% endstep %}

{% step %}
**Select `Code` from the menu on the left to open the `Code Objects` page.**

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/sRTn5V6pmIH93vQq2fGm/35166644483357)
{% endstep %}

{% step %}
**Select the Run button for the code object you'd like to run.**
{% endstep %}

{% step %}
**In the Code Object Interactive Settings page, specify the Input Dataset(s).**

This is one or more Datasets to be used as input to your Code Run. If multiple Datasets are selected, each will be run separately. If a Dataset happens to be a collaborator's Dataset, the code will be run on that collaborator's Rhino Client. In other words, the data never moves outside your collaborator's Rhino Client.

{% hint style="info" %}
Interactive containers require Secure Access to be enabled on the input dataset. For more information about Secure Access, please refer to [What is Secure Access?](/secure-access/what-is-secure-access.md)
{% endhint %}
{% endstep %}

{% step %}
**Add the Output Dataset Template.**

Indicate the output dataset template for the session.
{% endstep %}

{% step %}
**Add a Description**\
Add a description for the interactive session.&#x20;
{% endstep %}

{% step %}
**Indicate the Timeout in Seconds.**\
The number of seconds that must elapse before a Code Run is automatically killed. This is to avoid zombie tasks that run perpetually within a Rhino client.
{% endstep %}

{% step %}
**Specify the Run Parameters (Optional).**

Here you can paste a JSON object that defines additional parameters to be provided to your Code Run. This can be used for specifying hyper-parameters for *model* validation or any parameter provided to the code. Run parameters are made available to the container code in a file located at `/input/run_params.json`.
{% endstep %}

{% step %}
**Specify Run Secrets (Optional).**

Here you can paste a JSON object that defines the run secret; it is optional.
{% endstep %}

{% step %}
**Include runtime files and extra data (Optional).**

{% hint style="info" %}
Files that you want to run at run-time should be uploaded to the Rhino Orchestrator.
{% endhint %}

Select the runtime files that you would like to include in the run.  To add run time files to your code run, select the run time files from the list of the workgroup run files that appears. You will want to only include the ones you need for the code run, like in the example that follows.  For more information on this, see Selecting Run Time Files during Code Run Setups.\
\
When complete, add the metadata in the Extra Data section if needed.
{% endstep %}
{% endstepper %}

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/14uXGkKA0nlDd3pxgaCJ/30678413082013)

*Selecting Run Time Files During Code Run Set Ups*

If you are part of a workgroup that has collaborators, you will be able to see files that are 1) in your active workgroup that are part of the project, whether they are published or not and 2) from a collaborator’s workgroup that are part of the project only *if they are published*.

To better understand this, let's take a look at the following scenario. **Project PRIME** is led by **workgroup Alpha**. **Workgroup Beta** has been added as a collaborator. Each workgroup has uploaded run time files.

* **If YOUR active workgroup is Alpha**, here is what you see when you open the Run Time Files screen in Project PRIME.
  * **All Workgroup Alpha's files are shown.** This is because Project PRIME is led by workgroup Alpha, so all of workgroup Alpha’s files that are part of the project are shown whether they are published or not.
  * **Only Workgroup Beta’s published files are shown.** Workgroup Beta’s files that are not part of the project or that are unpublished are not shown.
* **If YOUR active workgroup is Beta**, here is what happens when you open the Run Time Files screen in Project PRIME.
  * **Workgroup Beta's files are all shown.** This is because Beta members can see their own workgroup’s files that are part of the project, whether there are published or not.
  * **Only Workgroup Alpha’s files that have been published to PRIME are shown.** Workgroup Alpha’s unpublished files that are not part of the project are not shown.

{% hint style="info" %}
NOTE: See [Managing Run Time Files](/creating-and-running-code-objects/managing-run-time-files.md) to learn how to manage, publish and unpublish run time files.
{% endhint %}

When you have completed adding all your Code Run details, either set the required compute resources by following the instructions in [Autoscaling and Compute Resources](/creating-and-running-code-objects/autoscaling-and-compute-resources.md), or click the **Run** button to run your code.

## Reviewing Code Run Logs

Code run logs provide details about what happened during a run, as well as the outcome. &#x20;

To view these logs, complete the following steps.

{% stepper %}
{% step %}
**Select Code Run.**

In the Code Runs page, select the code run that you want to see logs for.  (If you cannot find the code run, enter the name, UID, or description of the code run in the boxes in the top right corner of the page.)

<figure><img src="https://2949362692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FydySyCBmy6F7NnGn4bPa%2Fuploads%2FD5E5es8xp9I0KtrEzrJB%2FScreenshot%202026-09-17%20at%202.34.59%E2%80%AFPM.png?alt=media&amp;token=a020a9d3-9ade-4605-8a5b-689492ac729e" alt=""><figcaption></figcaption></figure>

The logs page for the Code Run is shown.  The start and finish time and date of the run, as well as the status of the run appears.  Logs can be accessed while the Code Run is active and after the Code Run has completed. While the code is running, an auto-refresh option is available. Details are shown under the details tab; reports (if any) are shown under the reports tab.  Reports are generated using the Rhino SDK.&#x20;
{% endstep %}

{% step %}
**Select the Details Tab.**

Select the Details tab if needed (it should be selected by default).

<figure><img src="https://2949362692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FydySyCBmy6F7NnGn4bPa%2Fuploads%2FNllxhZsZ3389w7O8lMYr%2FScreenshot%202026-08-20%20at%2010.43.42%E2%80%AFAM.png?alt=media&amp;token=be89985c-7b2e-4bd3-afaa-08f409d41a2b" alt=""><figcaption></figcaption></figure>

The Details tab provides the following:

* General Info - information about the Code Run, including
  * Code Object name and type
  * Code Object version
  * Code Object description
  * Input and Output Datasets
  * Compute Resources Mode including the requested resources at run time (if applicable).&#x20;
  * Show Code Object Configuration button.  Click this button to see the code object configuration.\
    Show Code Run Configuration button.  Click this button to see the code run configuration.
  * View in TensorBoard button. Click this button to view results in TensorBoard.
* System Logs.  These can include errors or warnings that occurred from the FCP side, e.g. Dataset import errors.
* FL server logs (for NVIDIA FLARE runs)
* FL client logs (for NVIDIA FLARE runs)
  * Each federated client's logs will appear separately
* Client-specific logs (for all other run types).
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
The Reports tab is a workspace associated with the run where you can output performance metrics you care about. Reports are blank by default as they are created using the Rhino SDK. &#x20;
{% endhint %}

### Troubleshooting Code Runs

**Error Message that Usage Limit Has Been Exceeded**

If you get an error message indicating that the usage limit has been exceeded, your administrator has set usage limits on the number of input rows a workgroup can process per model within a certain timeframe. Getting this message means that the entire run has been cancelled. Please contact your administrator for more details and help with resolving the issue.

## Viewing a Code Run's Configuration

To get an object's configuration, make sure you are on the page containing the original object you would like to view the configuration of. In the box where your original object is, there should be a row for each version. Navigate to the version you would like to view the configuration for and select the three-dot menu button, shown below:

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/BgQM5mGOLbhuUwL3JgI0/13002096256797)

The menu button is on the right-hand side of the row, click it to view a new menu. The new menu should have an option to show that object's configuration, click on that to see the object's configuration.

For Code Objects and Code Runs, if you chose the Use VM Pool option, you will use the pool that was indicated during the Code Object or Code Run configurations.  Selecting this option shows the resources, including the number of VMs and vCPUs that will be allocated, as well as the amount of RAM, the size of the disk, the number of GPUs, the GPU type/mode&#x6C;*,* and the amount of VRAM.

## Deleting a Code Run

Follow these steps to delete a code run.

{% stepper %}
{% step %}
**Open the Code Runs page**

Go to the page that lists your code runs.
{% endstep %}

{% step %}
**Find the code run**

If needed, use the search fields at the top right.

* Use **Search Name, UID** to search by code run name or the UID.
* Use **Search Description** to search by code run description.

Find the code run you want to delete.
{% endstep %}

{% step %}
**Open the menu for the code run**

Select the three-dot menu on the right side of the row, shown below.

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/2zj9RDThMEzCyZ4nwExT/13002586504093)
{% endstep %}

{% step %}
**Remove the code run**

Select **Remove code run**.
{% endstep %}
{% endstepper %}

## Running an Interactive Container and Accessing Workspace Files

Interactive Containers allow you to run entire containerized applications such as Jupyter Notebook (and not just containerized code) remotely and interact with them. You can use Jupyter Notebook, QuPath, 3D Slider, R Studio and LibreOffice. R Studio and LibreOffice require more custom setup information: if you choose to use them, please contact us for help.

An Interactive Container similar to connecting to a remote desktop, but you do not have the ability to exfiltrate any data. (This is governed by permissions policies, requires approval from the data owner, and is logged and auditable.)

### Running an Interactive Container

{% stepper %}
{% step %}
**In the Code Runs page, select a code run that has the row of type "IC" and shows a status of "Running".**
{% endstep %}

{% step %}
**Connect to the active session by clicking the arrow icon.**

It appears under the Type column for interactive container entries.

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/c5RI7b4R5rMGDRYGqbsG/35550620057757)
{% endstep %}

{% step %}
**A new tab opens with the interactive session.**

This tab runs your Interactive Container on the remote client.
{% endstep %}

{% step %}
**Click the desktop icon and interact with the application as you would normally.**

![](https://content.gitbook.com/content/ydySyCBmy6F7NnGn4bPa/blobs/XBH5U27LtrKHU9ZfvR9E/35764979165213)
{% endstep %}
{% endstepper %}

### Working with Files in the Workspace Folder

In your interactive session, files such as code run outputs are stored in the `/workspace` folder, by default. This folder keeps your work saved across multiple interactive sessions, so you don’t have to manually save and import files as input/output datasets.

{% stepper %}
{% step %}
**If you are unfamiliar with the Rhino FCP Workspace, review the steps below before continuing.**
{% endstep %}

{% step %}
**Navigate to the `/workspace` folder using the file explorer or navigator for your IC platform.**

If you performed a code run, results are stored, by default, in this folder.
{% endstep %}

{% step %}
**If you do not want the files to be overwritten, copy them in another folder so that you can interact with them.**

Note that if you overwrite a file in the `/workspace` folder, the changes will be in any other Interactive Container session that you have running (provided it is under your account and it is in the same workgroup).
{% endstep %}
{% endstepper %}

### Saving Output Data&#x20;

With the Interactive Container running do the following.

* Save the data file.  For tabular data, the output is saved to `/output/0/dataset.csv`.  For file data, save the output to `/output/0/file_data/`. &#x20;
* After you have saved all your files, click the desktop icon named Create Output Dataset. This will run a local script that looks for files under `/output/0/file_data/` and populates a new `/output/0/dataset.csv` file with the file names so they can be imported as a dataset.

{% hint style="info" %}
NOTE: If you save a data file (or other data files) multiple times, each time files are generated they are written to a new folder named with the next number in the sequence (0, 1, 2, ...).  Example:   `/output/1/dataset.csv`.
{% endhint %}

When you terminate the interactive session, the FCP will attempt to import the output dataset defined in the `/output/0/dataset.csv` file. If you did not create this file, the Code Run will show an “Error: failure to import dataset” message.

### Exporting Files from the Workspace Folder

After you've saved your output data using the directions in [Saving Output Data](#saving-output-data), you can extract files from your `/workspace` folder to a location outside the Rhino Client.  To do this, export the dataset(s) to client-mounted storage or to `/rhino_data` by following the instructions in [Importing and Exporting Datasets to and from Your Network Storage](/getting-started/quick-start-guide/importing-and-exporting-datasets-to-and-from-your-network-storage.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rhinofcp.com/creating-and-running-code-objects/creating-and-running-interactive-container-code.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
