# Setting Up the Development Environment

Creating a custom channel for Rendered.ai is a Python-based development task. The channels are Docker containers and the development process is simplified by Rendered.ai maintained _Development Containers_ that can be used with VSCode's Remote-Containers extension. This document will take you through installing Docker and the VSCode Remote-Containers extension so you can begin channel development on your local machine.

This process has been tested on several Linux distributions and Windows 11 with [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install), there have been reported issues with M1 Macbooks with Docker – if you do have issues we recommend using [Remote Development with AWS EC2](https://dadoes.atlassian.net/wiki/spaces/DG/pages/1673723905) for a better experience.

If you run into any issues or need additional help, email the Support team at [_support@rendered.ai_](mailto:support@rendered.ai).

* [Installing Docker](#installing-docker)
* [Installing VSCode and Extensions](#installing-vscode-and-extensions)
  * [Extension Marketplace](#extension-marketplace)
* [Testing Dev Containers](#testing-dev-containers)
* [Troubleshooting](#troubleshooting)

## Installing Docker <a href="#installing-docker" id="installing-docker"></a>

To install Docker for your local machine, follow the official installation instructions at [![](https://docs.docker.com/assets/favicons/docs@2x.ico)Install Docker Engine](https://docs.docker.com/engine/install/).

After installing, we recommend running the hello-world test command to ensure Docker is running as expected. The following command will pull a test Docker image and print out hello world message.

```bash
docker run hello-world
```

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FwSNCRKamAXNmjzeF7ETS%2F81887dc3-0bea-4a25-a665-f333d3afd2ec.png?alt=media&#x26;token=b183e318-ce47-4c98-b21f-53e8a1624af1" alt=""><figcaption><p>Successful Test of Docker Engine</p></figcaption></figure>

## Installing VSCode and Extensions <a href="#installing-vscode-and-extensions" id="installing-vscode-and-extensions"></a>

Visual Studio Code is free code editor that allows users to install extensions from an extension marketplace. The Rendered.ai Development Environment uses several extensions from the marketplace to simplify the developer experience. VSCode can be installed by following the official installation guide at [https://code.visualstudio.com/Download](https://code.visualstudio.com/Download).

#### Extension Marketplace <a href="#extension-marketplace" id="extension-marketplace"></a>

To reach the Extension Marketplace, click the Extensions symbol on the left-hand side of the window.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FxJVTo7B4up9vQpawBYx5%2F0239cf64-de86-4289-8214-59e2de82c8a9.png?alt=media&#x26;token=6bd50a39-3cfb-4f71-8629-a4a89f2a095e" alt=""><figcaption><p>Extensions Marketplace</p></figcaption></figure>

Next we’ll install two extensions: Docker and Dev Containers. The Docker extensions can be helpful in seeing the Docker images and Docker containers that are currently running. The Dev Containers extension allows us to use the Docker container as a full-featured development environment from within VSCode – this helps ensure that the environment we are developing in is as close as possible to what gets deployed to the platform.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FbLxfkuY3UZqwGrqcZkFd%2Fcd040f81-2cd1-4d91-be98-31f0c471a47f.png?alt=media&#x26;token=b5a84a24-9be6-4566-8d2f-a1089ae116ea" alt=""><figcaption><p>Docker Extension</p></figcaption></figure>

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2Ffk8eRjbBOnFh8gnlKths%2F91f2f456-a9c0-4fd0-86eb-14e0f3b89e43.png?alt=media&#x26;token=66f4d438-1ed9-400f-bef8-2c7ea4238ef5" alt=""><figcaption><p>Dev Containers Extension</p></figcaption></figure>

After we have the extensions installed, we are ready to pull the code and start our development.

## Testing Dev Containers <a href="#testing-dev-containers" id="testing-dev-containers"></a>

We recommend following the [Run and Deploy the Toybox Channel](an-example-channel-toybox/run-and-deploy-the-toybox-channel) tutorial to ensure your development environment is configured correctly. This will take you through cloning Rendered.ai’s Example channel, starting the Development Container then testing the execution of the channel.

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

Here we have compiled a list of common issues users may run into while configuring their development environment.

| <h4>Docker not found</h4><p>When starting the Development container in VSCode the following message may appear.</p><p> </p><p>Start the Docker Desktop application.</p> |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><h4 id="docker-not-found">Docker not found</h4><p>When starting the Development container in VSCode the following message may appear.</p><p> </p><p>Start the Docker Desktop application.</p></td></tr><tr><td><h4 id="allow-your-non-root-user-to-execute-docker">Allow your non-root user to execute docker</h4><p>When starting the Development Container in VSCode the following message may appear.</p><p><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FoLd8SZJqFNYcCs7q8bHl%2F27c7e247-fcff-4f30-8e7b-5a99b6874678.png?alt=media&#x26;token=39828b1e-9f9b-4e67-b882-8154732aac95" alt="" data-size="original"></p><p>This is due to VSCode having insufficient permissions to access the docker daemon on your behalf. You will need to ensure that the user has access to the docker daemon, on Linux operating systems you can add the current user to the docker group.</p><pre class="language-bash"><code class="lang-bash">sudo groupadd docker
sudo usermod -aG docker $USER
</code></pre><p>Important: Log out and log back in again to refresh group membership.</p></td></tr><tr><td><h4 id="failure-to-pull-public-image">Failure to pull Public Image</h4><p>When starting the Development Container in VSCode the following message may appear.</p><p><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2F5DfDkSwrQdaFA5xj1vvh%2F9d1afacb-e135-4fcb-bef3-e9620bca00fb.png?alt=media&#x26;token=2a51f478-b268-4cba-a8f7-110697ffc57e" alt="" data-size="original"></p><p> </p></td></tr></tbody></table>

&#x20;

Add label
