Skip to content

Commit a83cb1b

Browse files
committed
OSDOCS#13788: Added info for cache and workspace directories in oc-mirror doc
1 parent 800a55d commit a83cb1b

File tree

4 files changed

+67
-4
lines changed

4 files changed

+67
-4
lines changed

disconnected/mirroring/about-installing-oc-mirror-v2.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ include::modules/oc-mirror-imageset-config-parameters-v2.adoc[leveloffset=+1]
131131
// Command reference for oc-mirror v2
132132
include::modules/oc-mirror-command-reference-v2.adoc[leveloffset=+1]
133133
include::modules/oc-mirror-command-reference-v2-delete.adoc[leveloffset=+2]
134+
include::modules/oc-mirror-about-cache-and-workspace-dirs.adoc[leveloffset=+2]
134135

135136
[role="_additional-resources"]
136137
.Additional resources
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="oc-mirror-about-cache-and-workspace-dirs_{context}"]
7+
= About the --cache-dir and --workspace flags
8+
9+
You can use the `--cache-dir` flag to specify a directory for storing a persistent cache of image blobs and manifests. You can use this cache directory to perform incremental mirroring and avoid remirroring unchanged images, which saves time and reduces network bandwidth usage.
10+
11+
If you delete or corrupt the cache directory, the oc-mirror plugin pulls the image blobs and manifests again, which can force a full remirror and increase network usage.
12+
13+
You can use the `--workspace` flag to specify a directory for storing the working files that are created during a mirroring operation, such as the `ImageDigestMirrorSet` and `ImageTagMirrorSet` manifests. You can use this workspace directory to apply the generated configuration to clusters and repeat mirroring operations.
14+
15+
If you remove or modify the workspace directory, future mirroring operations might fail, or clusters may use inconsistent image sources.
16+
17+
[WARNING]
18+
====
19+
Deleting or modifying the contents of cache or workspace directories can cause the following issues:
20+
21+
* Failed or incomplete mirroring operations.
22+
* Loss of incremental mirroring data.
23+
* Full remirroring requirements and increased network overhead.
24+
25+
Do not modify, relocate, or delete these directori es unless you fully understand the impact. You must regularly back up the cache and workspace directories after successful mirroring operations.
26+
====
27+
28+
The following best practices help you manage the cache and workspace directories effectively:
29+
30+
* Use persistent storage: Place the cache and workspace directories on reliable and backed‑up storage.
31+
* Back up after successful operations: Regularly back up both directories, especially after completing a mirroring cycle.
32+
* Restore when needed: In case of data loss, restore these directories from backup to resume mirroring operations without performing a full remirror.
33+
* Separate environments: Use dedicated directories for different environments to prevent conflicts.
34+
35+
.Example: Using cache and workspace directories
36+
====
37+
Specify the cache and workspace directories by running the following command:
38+
[source,terminal]
39+
----
40+
$ oc mirror --config=imageset-config.yaml \
41+
file://local_mirror \
42+
--workspace /mnt/mirror-data/workspace \
43+
--cache-dir /mnt/mirror-data/cache
44+
--v2
45+
----
46+
47+
Example directory structure after mirroring:
48+
----
49+
/mnt/mirror-data/
50+
├── cache/
51+
│ ├── manifests/
52+
│ ├── metadata.db
53+
│ └── previous-mirror-state.json
54+
└── workspace/
55+
├── imageset-config-state.yaml
56+
├── manifests/
57+
└── icsp/
58+
----
59+
60+
You must back up both `/mnt/mirror-data/cache` and `/mnt/mirror-data/workspace` directories after each successful mirroring operation.
61+
====
62+

modules/oc-mirror-command-reference-v2-delete.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The following tables describe the `oc mirror` subcommands and flags for deleting
1919
|Path of the authentication file. The default value is `${XDG_RUNTIME_DIR}/containers/auth.json`.
2020

2121
|`--cache-dir <string>`
22-
|oc-mirror cache directory location. The default is `$HOME`.
22+
|Use this flag to specify a directory for storing a persistent cache of image blobs and manifests. You can use this cache directory to perform incremental mirroring and avoid remirroring unchanged images, which saves time and reduces network bandwidth usage. The default cache directory is `$HOME`. For more information, see disconnected/mirroring/about-installing-oc-mirror-v2.adoc#oc-mirror-about-cache-and-workspace-dirs_about-installing-oc-mirror-v2[About the --cache-dir and --workspace flags].
2323

2424
|`-c <string>`, `--config <string>`
2525
|Path to the delete imageset configuration file.
@@ -67,6 +67,6 @@ The following tables describe the `oc mirror` subcommands and flags for deleting
6767
|Require HTTPS and verify certificates when talking to the container registry or daemon. The default value is `true`.
6868

6969
|`--workspace <string>`
70-
|oc-mirror workspace where resources and internal artifacts are generated.
70+
|Use this flag to specify a directory for storing the working files that are created during a mirroring operation, such as the `ImageDigestMirrorSet` and `ImageTagMirrorSet` manifests. Use this directory to apply the generated configuration to clusters and repeat mirroring operations. For more information, see disconnected/mirroring/about-installing-oc-mirror-v2.adoc#oc-mirror-about-cache-and-workspace-dirs_about-installing-oc-mirror-v2[About the --cache-dir and --workspace flags].
7171

7272
|===

modules/oc-mirror-command-reference-v2.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The following tables describe the `oc mirror` subcommands and flags for oc-mirro
3939
|Specifies the path to an image set configuration file.
4040

4141
|`--cache-dir <string>`
42-
|oc-mirror cache directory location. The default value is `$HOME`.
42+
|Use this flag to specify a directory for storing a persistent cache of image blobs and manifests. You can use this cache directory to perform incremental mirroring and avoid remirroring unchanged images, which saves time and reduces network bandwidth usage. The default cache directory is `$HOME`. For more information, see disconnected/mirroring/about-installing-oc-mirror-v2.adoc#oc-mirror-about-cache-and-workspace-dirs_about-installing-oc-mirror-v2[About the --cache-dir and --workspace flags].
4343

4444
|`--dest-tls-verify`
4545
|Requires HTTPS and verifies certificates when accessing the container registry or daemon. The default value is `true`.
@@ -87,7 +87,7 @@ The following tables describe the `oc mirror` subcommands and flags for oc-mirro
8787
|Displays the version for oc-mirror plugin v2.
8888

8989
|`--workspace`
90-
|Determines string oc-mirror plugin v2 workspace where resources and internal artifacts are generated.
90+
|Use this flag to specify a directory for storing the working files that are created during a mirroring operation, such as the `ImageDigestMirrorSet` and `ImageTagMirrorSet` manifests. Use this directory to apply the generated configuration to clusters and repeat mirroring operations. For more information, see disconnected/mirroring/about-installing-oc-mirror-v2.adoc#oc-mirror-about-cache-and-workspace-dirs_about-installing-oc-mirror-v2[About the --cache-dir and --workspace flags].
9191

9292
|`--retry-delay duration`
9393
|Delay between 2 retries. The default value is `1s`.

0 commit comments

Comments
 (0)