Skip to content

Commit dde2dc4

Browse files
committed
feat(dockercache): add registry data directory option
1 parent c359b2b commit dde2dc4

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

riocli/apply/manifests/project.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ spec:
2626
proxyInterface: "eth0"
2727
registrySecret: "quay"
2828
registryURL: "https://quay.io"
29+
dataDirectory: "/opt/rapyuta/volumes/"

riocli/jsonschema/schemas/project-schema.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ definitions:
9898
type: string
9999
registryURL:
100100
type: string
101+
dataDirectory:
102+
type: string
101103
required:
102104
- proxyDevice
103105
- proxyInterface

riocli/project/features/dockercache.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
default=(),
5353
help="Name of the secret for upstream docker registry",
5454
)
55+
@click.option(
56+
"--data-directory",
57+
type=click.STRING,
58+
default=(),
59+
help="Registry blob storage path (default: /opt/rapyuta/volumes/docker-cache/)",
60+
)
5561
@name_to_guid
5662
@with_spinner(text="Updating DockerCache state...")
5763
def dockercache(
@@ -62,6 +68,7 @@ def dockercache(
6268
proxy_interface: str,
6369
registry_url: str,
6470
registry_secret: str,
71+
data_directory: str,
6572
spinner=None,
6673
) -> None:
6774
"""
@@ -74,7 +81,8 @@ def dockercache(
7481
--proxy-device edge01 \\
7582
--proxy-interface eth0 \\
7683
--registry-url https://quay.io \\
77-
--registry-secret quay
84+
--registry-secret quay \\
85+
--data-directory "/tmp/rapyuta/volumes"
7886
"""
7987
client = new_v2_client(with_project=False)
8088

@@ -91,6 +99,7 @@ def dockercache(
9199
"proxyInterface": proxy_interface,
92100
"registryURL": registry_url,
93101
"registrySecret": registry_secret,
102+
"dataDirectory": data_directory,
94103
}
95104

96105
is_enabled = project["spec"]["features"]["dockerCache"].get("enabled", False)

0 commit comments

Comments
 (0)