mirror of
https://github.com/clearml/clearml-docs
synced 2025-05-09 07:10:01 +00:00
Add CLEARML_OFFLINE MODE info (#568)
This commit is contained in:
parent
07f9deaf7f
commit
55fb19644d
@ -404,15 +404,11 @@ Function tasks must be created from within a regular task, created by calling `T
|
|||||||
### Offline Mode
|
### Offline Mode
|
||||||
|
|
||||||
You can work with tasks in Offline Mode, in which all the data and logs that the Task captures are stored in a local
|
You can work with tasks in Offline Mode, in which all the data and logs that the Task captures are stored in a local
|
||||||
folder, which can later be uploaded to the [ClearML Server](../deploying_clearml/clearml_server.md).
|
session folder, which can later be uploaded to the [ClearML Server](../deploying_clearml/clearml_server.md).
|
||||||
|
|
||||||
Before initializing a Task, use the [`Task.set_offline`](../references/sdk/task.md#taskset_offline) class method and set
|
You can enable offline mode in one of the following ways:
|
||||||
the `offline_mode` argument to `True`. The method returns the Task ID and a path to the session folder.
|
* Before initializing a task, use the [`Task.set_offline`](../references/sdk/task.md#taskset_offline) class method and set
|
||||||
|
the `offline_mode` argument to `True`
|
||||||
:::caution
|
|
||||||
Notice that the `Task.set_offline` method only works with tasks created using `Task.init` and not with those created
|
|
||||||
using the `Task.create` method.
|
|
||||||
:::
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from clearml import Task
|
from clearml import Task
|
||||||
@ -420,18 +416,32 @@ from clearml import Task
|
|||||||
Task.set_offline(offline_mode=True)
|
Task.set_offline(offline_mode=True)
|
||||||
# Initialize a Task
|
# Initialize a Task
|
||||||
task = Task.init(project_name="examples", task_name="my_task")
|
task = Task.init(project_name="examples", task_name="my_task")
|
||||||
|
|
||||||
# Rest of code is executed. All data is logged locally and not onto the server
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Before running a task, set `CLEARML_OFFLINE_MODE=1`
|
||||||
|
|
||||||
|
:::caution
|
||||||
|
Offline mode only works with tasks created using `Task.init` and not with those created
|
||||||
|
using the `Task.create` method.
|
||||||
|
:::
|
||||||
|
|
||||||
All the information captured by the Task is saved locally. Once the task script finishes execution, it's zipped.
|
All the information captured by the Task is saved locally. Once the task script finishes execution, it's zipped.
|
||||||
|
|
||||||
|
The task's console output displays the task ID and a path to the folder with the captured information:
|
||||||
|
|
||||||
|
```console
|
||||||
|
ClearML Task: created new task id=offline-372657bb04444c25a31bc6af86552cc9
|
||||||
|
...
|
||||||
|
...
|
||||||
|
ClearML Task: Offline session stored in /home/user/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip
|
||||||
|
```
|
||||||
|
|
||||||
Upload the execution data that the Task captured offline to the ClearML Server using one of the following:
|
Upload the execution data that the Task captured offline to the ClearML Server using one of the following:
|
||||||
* [`clearml-task`](../apps/clearml_task.md) CLI
|
* [`clearml-task`](../apps/clearml_task.md) CLI
|
||||||
```bash
|
```bash
|
||||||
clearml-task --import-offline-session "path/to/session/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip"
|
clearml-task --import-offline-session "path/to/session/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip"
|
||||||
```
|
```
|
||||||
Pass the path to the zip folder containing the session with the `--import-offline-session` parameter
|
Pass the path to the zip folder containing the captured information with the `--import-offline-session` parameter
|
||||||
|
|
||||||
* [`Task.import_offline_session`](../references/sdk/task.md#taskimport_offline_session) class method
|
* [`Task.import_offline_session`](../references/sdk/task.md#taskimport_offline_session) class method
|
||||||
```python
|
```python
|
||||||
|
23
docs/faq.md
23
docs/faq.md
@ -503,9 +503,26 @@ See [`Task.init`](references/sdk/task.md#taskinit).
|
|||||||
Yes! You can use ClearML's Offline Mode, in which all the data and logs that a task captures from the code are stored in a
|
Yes! You can use ClearML's Offline Mode, in which all the data and logs that a task captures from the code are stored in a
|
||||||
local folder.
|
local folder.
|
||||||
|
|
||||||
Before initializing a task, use the [`Task.set_offline`](references/sdk/task.md#taskset_offline)
|
You can enable offline mode in one of the following ways:
|
||||||
class method and set the `offline_mode` argument to `True`. When executed, this returns the Task ID and a path to the
|
* Before initializing a task, use the [`Task.set_offline`](../references/sdk/task.md#taskset_offline) class method and set
|
||||||
session folder. In order to upload to the ClearML Server the execution data that the Task captured offline, do one of the
|
the `offline_mode` argument to `True`
|
||||||
|
* Before running a task, set `CLEARML_OFFLINE_MODE=1`
|
||||||
|
|
||||||
|
:::caution
|
||||||
|
Offline mode only works with tasks created using `Task.init` and not with those created
|
||||||
|
using the `Task.create` method.
|
||||||
|
:::
|
||||||
|
|
||||||
|
The task's console output displays the task ID and a path to the folder with the session's captured information:
|
||||||
|
|
||||||
|
```console
|
||||||
|
ClearML Task: created new task id=offline-372657bb04444c25a31bc6af86552cc9
|
||||||
|
...
|
||||||
|
...
|
||||||
|
ClearML Task: Offline session stored in /home/user/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to upload to the ClearML Server the execution data that the Task captured offline, do one of the
|
||||||
following:
|
following:
|
||||||
* Use the `import-offline-session <session_path>` option of the [clearml-task](apps/clearml_task.md) CLI
|
* Use the `import-offline-session <session_path>` option of the [clearml-task](apps/clearml_task.md) CLI
|
||||||
* Use the [`Task.import_offline_session`](references/sdk/task.md#taskimport_offline_session) method.
|
* Use the [`Task.import_offline_session`](references/sdk/task.md#taskimport_offline_session) method.
|
||||||
|
@ -4,18 +4,13 @@ title: Storing Task Data Offline
|
|||||||
|
|
||||||
If your computer is offline, or you do not want a Task's data and logs stored in the ClearML Server, use
|
If your computer is offline, or you do not want a Task's data and logs stored in the ClearML Server, use
|
||||||
the **Offline Mode** option. In this mode, all the data and logs that the Task captures from the code are stored in a
|
the **Offline Mode** option. In this mode, all the data and logs that the Task captures from the code are stored in a
|
||||||
local folder, which can be later uploaded to the [ClearML Server](../deploying_clearml/clearml_server.md).
|
local session folder, which can be later uploaded to the [ClearML Server](../deploying_clearml/clearml_server.md).
|
||||||
|
|
||||||
## Setting Task to Offline Mode
|
## Setting Task to Offline Mode
|
||||||
|
|
||||||
Before initializing a Task, use the [`Task.set_offline`](../references/sdk/task.md#taskset_offline) class method and set the
|
You can enable offline mode in one of the following ways:
|
||||||
`offline_mode` argument to `True`.
|
* Before initializing a task, use the [`Task.set_offline`](../references/sdk/task.md#taskset_offline) class method and set
|
||||||
|
the `offline_mode` argument to `True`
|
||||||
:::caution
|
|
||||||
Notice that the `Task.set_offline` method only works with tasks created using `Task.init` and not with those created
|
|
||||||
using the `Task.create` method.
|
|
||||||
:::
|
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from clearml import Task
|
from clearml import Task
|
||||||
@ -23,11 +18,20 @@ from clearml import Task
|
|||||||
Task.set_offline(offline_mode=True)
|
Task.set_offline(offline_mode=True)
|
||||||
# Initialize a Task
|
# Initialize a Task
|
||||||
task = Task.init(project_name="examples", task_name="my_task")
|
task = Task.init(project_name="examples", task_name="my_task")
|
||||||
|
|
||||||
# Rest of code is executed. All data is logged locally and not onto the server
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The method returns the Task ID and a path to the session folder:
|
* Before running a task, set `CLEARML_OFFLINE_MODE=1`
|
||||||
|
|
||||||
|
:::caution
|
||||||
|
Offline mode only works with tasks created using `Task.init` and not with those created
|
||||||
|
using the `Task.create` method.
|
||||||
|
:::
|
||||||
|
|
||||||
|
|
||||||
|
All the information captured by the Task is saved locally. Once the task script finishes execution, it's zipped. The
|
||||||
|
session's zip folder's location is `~/.clearml/cache/offline/<task_id>.zip`.
|
||||||
|
|
||||||
|
The task's console output displays the task ID and a path to the folder with the session's captured information:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
ClearML Task: created new task id=offline-372657bb04444c25a31bc6af86552cc9
|
ClearML Task: created new task id=offline-372657bb04444c25a31bc6af86552cc9
|
||||||
@ -36,8 +40,6 @@ ClearML Task: created new task id=offline-372657bb04444c25a31bc6af86552cc9
|
|||||||
ClearML Task: Offline session stored in /home/user/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip
|
ClearML Task: Offline session stored in /home/user/.clearml/cache/offline/b786845decb14eecadf2be24affc7418.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
All the information captured by the Task is saved locally. Once the task script finishes execution, it's zipped. The
|
|
||||||
session's zip folder's location is `~/.clearml/cache/offline/<task_id>.zip`.
|
|
||||||
|
|
||||||
## Uploading Session Data
|
## Uploading Session Data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user