# Checkpoint/restore runc

## Prerequisites

1. Create an account with Cedana, to get access to the GPU plugin. See [authentication](https://docs.cedana.ai/daemon/get-started/authentication).
2. Set the Cedana URL & authentication token in the [configuration](https://docs.cedana.ai/daemon/get-started/configuration).
3. Install the **runc** plugin with `sudo cedana plugin install runc`.
4. Ensure the daemon is running, see [installation](https://docs.cedana.ai/daemon/get-started/installation).
5. Do a health check to ensure the plugin is ready, see [health checks](https://docs.cedana.ai/daemon/get-started/health).

## Basic

1. Run a new runc container, for example:

```sh
sudo runc run --detach <container_id> --bundle ./my-bundle
```

2. Checkpoint:

```sh
cedana dump runc <container_id> --dir <dump-dir>
```

3. Restore:

```sh
cedana restore runc --bundle ./my-bundle --path <path-to-dump>
```

## Managed

1. Run a new managed runc container:

```sh
cedana run runc --attach --jid <job_id> --bundle ./my-bundle
```

2. Checkpoint:

```sh
cedana dump job <job_id>
```

3. Restore:

```sh
cedana restore job --attach <job_id>
```

## GPU support

Just like for processes, as explained in [checkpoint/restore with GPUs](https://docs.cedana.ai/daemon/checkpoint-restore/cr-1), GPU support is also available for managed runc containers.

1. Run a new managed runc container with GPU support:

```sh
cedana run runc --attach --gpu-enabled --jid <job_id> --bundle ./my-bundle
```

2. Checkpoint:

```sh
cedana dump job <job_id>
```

3. Restore:

```sh
cedana restore job --attach <job_id>
```

{% hint style="info" %}
For all available CLI options, see [CLI reference](https://docs.cedana.ai/daemon/references/cli/cedana). Directly interacting with daemon is also possible through gRPC, see [API reference](https://docs.cedana.ai/daemon/references/api).
{% endhint %}
