uricp 0.0.36 → 0.0.38.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +1 -1
- data/Jenkinsfile +0 -68
- data/almalinux8/Dockerfile +9 -8
- data/features/rbd_access.feature +92 -32
- data/features/support/env.rb +15 -1
- data/lib/uricp/strategy/cached_get.rb +3 -3
- data/lib/uricp/strategy/common.rb +11 -1
- data/lib/uricp/strategy/rbd_cache_clone.rb +4 -1
- data/lib/uricp/strategy/rbd_cached_get.rb +1 -1
- data/lib/uricp/strategy/rbd_cached_put.rb +1 -1
- data/lib/uricp/version.rb +1 -1
- data/uricp.gemspec +1 -1
- metadata +9 -11
- data/bionic/Dockerfile +0 -21
- data/centos7/Dockerfile +0 -25
- data/xenial/Dockerfile +0 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3005dfc06f7452fc0af32b526a4745c0b8bb8d9187d70efc4c6c802d8be9c2c6
|
|
4
|
+
data.tar.gz: b8009971a3908d3c26f8d4a0bc6d4da8ef49a3864ce2da1d991826798f74a171
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a01d015364ba6ee624a9a76f1bf4822a03d30e196ee386ba8eee9ead75a4e60c7faf79227159b02130b5d1cec1736609a227d98309472c3793159703bcae705
|
|
7
|
+
data.tar.gz: ae50a09f10c508c50198d324c7d9fe769af2c120d14b4124e58741ccc9787b4c6d2a73abe2d32a3b96c0971859848514af1bc180bbe7fd9c581be969109ec689
|
data/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 2.7.8
|
data/Gemfile.lock
CHANGED
data/Jenkinsfile
CHANGED
|
@@ -40,30 +40,6 @@ pipeline {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
stage("CentOS 7") {
|
|
44
|
-
agent {
|
|
45
|
-
dockerfile {
|
|
46
|
-
dir 'centos7'
|
|
47
|
-
label "docker"
|
|
48
|
-
additionalBuildArgs '--build-arg CEPH_MON --build-arg RBD_USR --build-arg RBD_PSW'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
steps {
|
|
52
|
-
sh 'rbd --id "${RBD_USR}" ls servers'
|
|
53
|
-
sh 'bundle install --deployment'
|
|
54
|
-
sh 'bundle exec rake features:new_qemu'
|
|
55
|
-
}
|
|
56
|
-
post {
|
|
57
|
-
always {
|
|
58
|
-
sh 'bundle exec rake features:clean'
|
|
59
|
-
}
|
|
60
|
-
failure {
|
|
61
|
-
mail to: 'sysadmin@brightbox.co.uk',
|
|
62
|
-
subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
|
|
63
|
-
body: "${env.BUILD_URL}"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
43
|
stage("Focal, Ruby 2.7.0") {
|
|
68
44
|
agent {
|
|
69
45
|
dockerfile {
|
|
@@ -88,50 +64,6 @@ pipeline {
|
|
|
88
64
|
}
|
|
89
65
|
}
|
|
90
66
|
}
|
|
91
|
-
stage("Xenial, Ruby 2.3.1") {
|
|
92
|
-
agent {
|
|
93
|
-
dockerfile {
|
|
94
|
-
dir 'xenial'
|
|
95
|
-
label "docker"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
steps {
|
|
99
|
-
sh 'bundle install --deployment'
|
|
100
|
-
sh 'bundle exec rake features:new_qemu'
|
|
101
|
-
}
|
|
102
|
-
post {
|
|
103
|
-
always {
|
|
104
|
-
sh 'bundle exec rake features:clean'
|
|
105
|
-
}
|
|
106
|
-
failure {
|
|
107
|
-
mail to: 'sysadmin@brightbox.co.uk',
|
|
108
|
-
subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
|
|
109
|
-
body: "${env.BUILD_URL}"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
stage("Bionic, Ruby 2.5.1") {
|
|
114
|
-
agent {
|
|
115
|
-
dockerfile {
|
|
116
|
-
dir 'bionic'
|
|
117
|
-
label "docker"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
steps {
|
|
121
|
-
sh 'bundle install --deployment'
|
|
122
|
-
sh 'bundle exec rake features:new_qemu'
|
|
123
|
-
}
|
|
124
|
-
post {
|
|
125
|
-
always {
|
|
126
|
-
sh 'bundle exec rake features:clean'
|
|
127
|
-
}
|
|
128
|
-
failure {
|
|
129
|
-
mail to: 'sysadmin@brightbox.co.uk',
|
|
130
|
-
subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
|
|
131
|
-
body: "${env.BUILD_URL}"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
67
|
}
|
|
136
68
|
post {
|
|
137
69
|
failure {
|
data/almalinux8/Dockerfile
CHANGED
|
@@ -3,21 +3,22 @@ MAINTAINER support@brightbox.co.uk
|
|
|
3
3
|
|
|
4
4
|
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
|
5
5
|
RUN dnf -y install dnf-plugins-core
|
|
6
|
-
RUN dnf config-manager --
|
|
7
|
-
RUN echo "8-stream" > /etc/dnf/vars/stream
|
|
8
|
-
RUN dnf -y update
|
|
9
|
-
RUN dnf config-manager --set-enabled powertools,devel
|
|
6
|
+
RUN dnf config-manager --set-enabled powertools
|
|
10
7
|
RUN dnf -y group install "Development Tools"
|
|
11
|
-
RUN dnf -y install https://www.rdoproject.org/repos/rdo-release.el8.rpm
|
|
12
8
|
RUN dnf -y install \
|
|
13
9
|
git \
|
|
14
10
|
lz4 \
|
|
15
11
|
qemu-img \
|
|
16
12
|
ruby-devel \
|
|
13
|
+
python3-pip \
|
|
17
14
|
rubygems \
|
|
18
|
-
rubygem-bundler
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
rubygem-bundler
|
|
16
|
+
# Ceph
|
|
17
|
+
RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
|
18
|
+
RUN dnf -y install http://download.ceph.com/rpm-pacific/el8/noarch/ceph-release-1-1.el8.noarch.rpm
|
|
19
|
+
RUN dnf -y install ceph-common
|
|
20
|
+
# Swiftclient
|
|
21
|
+
RUN pip3 install python-swiftclient
|
|
21
22
|
RUN mkdir -p /etc/ceph
|
|
22
23
|
ARG RBD_USR=libvirt
|
|
23
24
|
ARG RBD_PSW
|
data/features/rbd_access.feature
CHANGED
|
@@ -32,7 +32,7 @@ Feature: Manipulate file images in ceph
|
|
|
32
32
|
"""
|
|
33
33
|
And the output should contain:
|
|
34
34
|
"""
|
|
35
|
-
rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy' || { [ $? -eq 22 ] && rbd create --id libvirt -s 0 'servers/srv-testy'; };
|
|
35
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/freedos.qcow2@base' 'servers/srv-testy' || { [ $? -eq 22 ] && rbd create --id libvirt -s 0 'servers/srv-testy'; };
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
38
|
Scenario: HTTP URI from file cache via unpopulated rbd cache
|
|
@@ -53,7 +53,7 @@ Feature: Manipulate file images in ceph
|
|
|
53
53
|
"""
|
|
54
54
|
And the output should contain:
|
|
55
55
|
"""
|
|
56
|
-
rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
|
|
56
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/freedos.qcow2@base' 'servers/srv-testy'
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
Scenario: HTTP URI to rbd via partial rbd caches
|
|
@@ -77,7 +77,27 @@ Feature: Manipulate file images in ceph
|
|
|
77
77
|
"""
|
|
78
78
|
And the output should contain:
|
|
79
79
|
"""
|
|
80
|
-
rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
|
|
80
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/freedos.qcow2@base' 'servers/srv-testy'
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
Scenario: file URI to rbd via cache
|
|
84
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
|
85
|
+
When I successfully run `uricp --dry-run --target-format 'raw' --cache '/tmp/uricp' --max-cache '1073741824B' 'file:///dev/servers/srv-testy-vol_frozen' 'rbd:/servers/srv-testy-vol'`
|
|
86
|
+
And the output should contain:
|
|
87
|
+
"""
|
|
88
|
+
rbd import --no-progress --id libvirt - <'/dev/servers/srv-testy-vol_frozen' 'servers/srv-testy-vol'
|
|
89
|
+
"""
|
|
90
|
+
And the output should not contain:
|
|
91
|
+
"""
|
|
92
|
+
snap create
|
|
93
|
+
"""
|
|
94
|
+
And the output should not contain:
|
|
95
|
+
"""
|
|
96
|
+
snap protect
|
|
97
|
+
"""
|
|
98
|
+
And the output should not contain:
|
|
99
|
+
"""
|
|
100
|
+
rbd clone
|
|
81
101
|
"""
|
|
82
102
|
|
|
83
103
|
Scenario: rbd to rbd - no cache
|
|
@@ -85,23 +105,23 @@ Feature: Manipulate file images in ceph
|
|
|
85
105
|
When I successfully run `uricp --dry-run rbd:///servers/img-testy rbd:///servers/srv-testy`
|
|
86
106
|
And the output should contain:
|
|
87
107
|
"""
|
|
88
|
-
rbd snap create --id libvirt 'servers/img-testy@uricp_snap'
|
|
108
|
+
rbd snap create --id libvirt 'servers/img-testy@srv-testy-uricp_snap'
|
|
89
109
|
"""
|
|
90
110
|
And the output should contain:
|
|
91
111
|
"""
|
|
92
|
-
rbd snap protect --id libvirt 'servers/img-testy@uricp_snap'
|
|
112
|
+
rbd snap protect --id libvirt 'servers/img-testy@srv-testy-uricp_snap'
|
|
93
113
|
"""
|
|
94
114
|
And the output should not contain:
|
|
95
115
|
"""
|
|
96
|
-
rbd snap unprotect --id libvirt 'servers/img-testy@uricp_snap'
|
|
116
|
+
rbd snap unprotect --id libvirt 'servers/img-testy@srv-testy-uricp_snap'
|
|
97
117
|
"""
|
|
98
118
|
And the output should not contain:
|
|
99
119
|
"""
|
|
100
|
-
rbd snap rm --id libvirt 'servers/img-testy@uricp_snap'
|
|
120
|
+
rbd snap rm --id libvirt 'servers/img-testy@srv-testy-uricp_snap'
|
|
101
121
|
"""
|
|
102
122
|
And the output should contain:
|
|
103
123
|
"""
|
|
104
|
-
rbd clone --id libvirt 'servers/img-testy@uricp_snap' 'servers/srv-testy'
|
|
124
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/img-testy@srv-testy-uricp_snap' 'servers/srv-testy'
|
|
105
125
|
"""
|
|
106
126
|
|
|
107
127
|
Scenario: rbd to rbd - unpopulated cache
|
|
@@ -109,27 +129,27 @@ Feature: Manipulate file images in ceph
|
|
|
109
129
|
When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy`
|
|
110
130
|
And the output should contain:
|
|
111
131
|
"""
|
|
112
|
-
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
|
132
|
+
rbd snap create --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
113
133
|
"""
|
|
114
134
|
And the output should contain:
|
|
115
135
|
"""
|
|
116
|
-
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
136
|
+
rbd snap protect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
117
137
|
"""
|
|
118
138
|
And the output should not contain:
|
|
119
139
|
"""
|
|
120
|
-
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
140
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
121
141
|
"""
|
|
122
142
|
And the output should not contain:
|
|
123
143
|
"""
|
|
124
|
-
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
|
144
|
+
rbd snap rm --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
125
145
|
"""
|
|
126
146
|
And the output should not contain:
|
|
127
147
|
"""
|
|
128
|
-
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
|
148
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@img-testy-uricp_snap' -
|
|
129
149
|
"""
|
|
130
150
|
And the output should contain:
|
|
131
151
|
"""
|
|
132
|
-
rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
|
|
152
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/srv-testy@img-testy-uricp_snap' 'servers/img-testy'
|
|
133
153
|
"""
|
|
134
154
|
And the output should not contain:
|
|
135
155
|
"""
|
|
@@ -162,7 +182,47 @@ Feature: Manipulate file images in ceph
|
|
|
162
182
|
"""
|
|
163
183
|
And the output should contain:
|
|
164
184
|
"""
|
|
165
|
-
rbd clone --id libvirt 'servers/img-testy@base' 'servers/srv-testy'
|
|
185
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/img-testy@base' 'servers/srv-testy'
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
Scenario: rbd disk to rbd disk - cache ignored
|
|
189
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
|
190
|
+
When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/vol-testy rbd:///servers/vol-copyy`
|
|
191
|
+
And the output should contain:
|
|
192
|
+
"""
|
|
193
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/vol-testy@vol-copyy-uricp_snap' 'servers/vol-copyy'
|
|
194
|
+
"""
|
|
195
|
+
And the output should not contain:
|
|
196
|
+
"""
|
|
197
|
+
@base
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
Scenario: rbd disk to a file that is not an image - cache ignored
|
|
201
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
|
202
|
+
When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/vol-testy file:///tmp/uricp/backup.raw`
|
|
203
|
+
And the output should contain:
|
|
204
|
+
"""
|
|
205
|
+
rbd export --no-progress --id libvirt 'servers/vol-testy@backup.raw-uricp_snap' -
|
|
206
|
+
"""
|
|
207
|
+
And the output should contain:
|
|
208
|
+
"""
|
|
209
|
+
rbd snap rm --id libvirt 'servers/vol-testy@backup.raw-uricp_snap'
|
|
210
|
+
"""
|
|
211
|
+
And the output should not contain:
|
|
212
|
+
"""
|
|
213
|
+
rbd clone
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
Scenario: rbd disk with a base snapshot to rbd disk
|
|
217
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
|
218
|
+
When I successfully run `uricp --dry-run --dry-cache=rbd --cache=/tmp/uricp rbd:///servers/srv-testy-vol rbd:///servers/vol-copyy`
|
|
219
|
+
And the output should contain:
|
|
220
|
+
"""
|
|
221
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/srv-testy-vol@vol-copyy-uricp_snap' 'servers/vol-copyy'
|
|
222
|
+
"""
|
|
223
|
+
And the output should not contain:
|
|
224
|
+
"""
|
|
225
|
+
@base
|
|
166
226
|
"""
|
|
167
227
|
|
|
168
228
|
Scenario: RBD export.
|
|
@@ -170,23 +230,23 @@ Feature: Manipulate file images in ceph
|
|
|
170
230
|
When I successfully run `uricp --dry-run --compress rbd:///servers/srv-testy file:///tmp/img-testy`
|
|
171
231
|
And the output should contain:
|
|
172
232
|
"""
|
|
173
|
-
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
|
233
|
+
rbd snap create --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
174
234
|
"""
|
|
175
235
|
And the output should contain:
|
|
176
236
|
"""
|
|
177
|
-
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
237
|
+
rbd snap protect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
178
238
|
"""
|
|
179
239
|
And the output should contain:
|
|
180
240
|
"""
|
|
181
|
-
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
241
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
182
242
|
"""
|
|
183
243
|
And the output should contain:
|
|
184
244
|
"""
|
|
185
|
-
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
|
245
|
+
rbd snap rm --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
186
246
|
"""
|
|
187
247
|
And the output should contain:
|
|
188
248
|
"""
|
|
189
|
-
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
|
249
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@img-testy-uricp_snap' -
|
|
190
250
|
"""
|
|
191
251
|
|
|
192
252
|
Scenario: RBD export with cacheing - populated cache
|
|
@@ -212,27 +272,27 @@ Feature: Manipulate file images in ceph
|
|
|
212
272
|
When I successfully run `uricp --dry-run --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
|
213
273
|
And the output should contain:
|
|
214
274
|
"""
|
|
215
|
-
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
|
275
|
+
rbd snap create --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
216
276
|
"""
|
|
217
277
|
And the output should contain:
|
|
218
278
|
"""
|
|
219
|
-
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
279
|
+
rbd snap protect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
220
280
|
"""
|
|
221
281
|
And the output should not contain:
|
|
222
282
|
"""
|
|
223
|
-
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
|
283
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
224
284
|
"""
|
|
225
285
|
And the output should not contain:
|
|
226
286
|
"""
|
|
227
|
-
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
|
287
|
+
rbd snap rm --id libvirt 'servers/srv-testy@img-testy-uricp_snap'
|
|
228
288
|
"""
|
|
229
289
|
And the output should not contain:
|
|
230
290
|
"""
|
|
231
|
-
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
|
291
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@img-testy-uricp_snap' -
|
|
232
292
|
"""
|
|
233
293
|
And the output should contain:
|
|
234
294
|
"""
|
|
235
|
-
rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
|
|
295
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/srv-testy@img-testy-uricp_snap' 'servers/img-testy'
|
|
236
296
|
"""
|
|
237
297
|
And the output should contain:
|
|
238
298
|
"""
|
|
@@ -252,27 +312,27 @@ Feature: Manipulate file images in ceph
|
|
|
252
312
|
When I successfully run `uricp --dry-run --auth-token 'd75945e3b9159f1f14e91b2022bc53ea10481ed15e4a' --target-format 'raw' --compress --segment-size '1073741824B' --cache '/var/cache/domtrix' rbd:/servers/vol-yd63x https://orbit.gb1s.brightbox.com/v1/acc-8tgbq/images/img-cfwe0`
|
|
253
313
|
And the output should contain:
|
|
254
314
|
"""
|
|
255
|
-
rbd snap create --id libvirt 'servers/vol-yd63x@uricp_snap'
|
|
315
|
+
rbd snap create --id libvirt 'servers/vol-yd63x@img-cfwe0-uricp_snap'
|
|
256
316
|
"""
|
|
257
317
|
And the output should contain:
|
|
258
318
|
"""
|
|
259
|
-
rbd snap protect --id libvirt 'servers/vol-yd63x@uricp_snap'
|
|
319
|
+
rbd snap protect --id libvirt 'servers/vol-yd63x@img-cfwe0-uricp_snap'
|
|
260
320
|
"""
|
|
261
321
|
And the output should not contain:
|
|
262
322
|
"""
|
|
263
|
-
rbd snap unprotect --id libvirt 'servers/vol-yd63x@uricp_snap'
|
|
323
|
+
rbd snap unprotect --id libvirt 'servers/vol-yd63x@img-cfwe0-uricp_snap'
|
|
264
324
|
"""
|
|
265
325
|
And the output should not contain:
|
|
266
326
|
"""
|
|
267
|
-
rbd snap rm --id libvirt 'servers/vol-yd63x@uricp_snap'
|
|
327
|
+
rbd snap rm --id libvirt 'servers/vol-yd63x@img-cfwe0-uricp_snap'
|
|
268
328
|
"""
|
|
269
329
|
And the output should not contain:
|
|
270
330
|
"""
|
|
271
|
-
rbd export --no-progress --id libvirt 'servers/vol-yd63x@uricp_snap' -
|
|
331
|
+
rbd export --no-progress --id libvirt 'servers/vol-yd63x@img-cfwe0-uricp_snap' -
|
|
272
332
|
"""
|
|
273
333
|
And the output should contain:
|
|
274
334
|
"""
|
|
275
|
-
rbd clone --id libvirt 'servers/vol-yd63x@uricp_snap' 'servers/img-cfwe0'
|
|
335
|
+
rbd clone --id libvirt --rbd-default-clone-format 2 'servers/vol-yd63x@img-cfwe0-uricp_snap' 'servers/img-cfwe0'
|
|
276
336
|
"""
|
|
277
337
|
And the output should contain:
|
|
278
338
|
"""
|
data/features/support/env.rb
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
require 'aruba/cucumber'
|
|
2
2
|
require 'methadone/cucumber'
|
|
3
3
|
require 'fileutils'
|
|
4
|
+
require 'tmpdir'
|
|
5
|
+
|
|
6
|
+
# The features refer to their scratch area as /tmp/uricp. Put it under the
|
|
7
|
+
# standard temp directory instead ($TMPDIR, defaulting to /tmp).
|
|
8
|
+
FEATURE_DIR = '/tmp/uricp'
|
|
9
|
+
TEST_DIR = File.join(Dir.tmpdir, 'uricp')
|
|
10
|
+
|
|
11
|
+
# Rewrite the path in every step argument, including docstrings.
|
|
12
|
+
module UseTestDir
|
|
13
|
+
def invoke(args)
|
|
14
|
+
super(args.map { |a| a.is_a?(String) ? String.new(a).gsub(FEATURE_DIR, TEST_DIR) : a })
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
Cucumber::RbSupport::RbStepDefinition.prepend(UseTestDir)
|
|
4
18
|
|
|
5
19
|
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
|
6
20
|
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
|
|
@@ -15,6 +29,6 @@ end
|
|
|
15
29
|
After do
|
|
16
30
|
ENV['RUBYLIB'] = @original_rubylib
|
|
17
31
|
|
|
18
|
-
FileUtils.rm_rf(Dir.glob('
|
|
32
|
+
FileUtils.rm_rf(Dir.glob(File.join(TEST_DIR, '*')))
|
|
19
33
|
|
|
20
34
|
end
|
|
@@ -23,9 +23,9 @@ module Uricp::Strategy
|
|
|
23
23
|
|
|
24
24
|
def proposal
|
|
25
25
|
@proposed_options = options.dup
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@proposed_options['rbd_cache_name'] = rbd_cache_image_spec(to)
|
|
26
|
+
unless file_source?
|
|
27
|
+
@proposed_options['from_uri'] = URI.join('file:///', cache_file)
|
|
28
|
+
@proposed_options['rbd_cache_name'] = rbd_cache_image_spec(to) if to.scheme == 'rbd'
|
|
29
29
|
end
|
|
30
30
|
@proposed_options.delete('cache')
|
|
31
31
|
@proposed_options.delete('cache_name')
|
|
@@ -7,6 +7,7 @@ module Uricp::Strategy
|
|
|
7
7
|
include Methadone::SH
|
|
8
8
|
|
|
9
9
|
VOL_REGEX = /^(srv|vol)-.....$/
|
|
10
|
+
IMAGE_REGEX = /\Aimg-/.freeze
|
|
10
11
|
|
|
11
12
|
def initialize(options)
|
|
12
13
|
@options = options
|
|
@@ -115,8 +116,11 @@ module Uricp::Strategy
|
|
|
115
116
|
'base'
|
|
116
117
|
end
|
|
117
118
|
|
|
119
|
+
# Prefixed with the target name so snapshot listings show which
|
|
120
|
+
# copy each snapshot was taken for.
|
|
118
121
|
def rbd_snapshot_name
|
|
119
|
-
@rbd_snapshot_name ||=
|
|
122
|
+
@rbd_snapshot_name ||=
|
|
123
|
+
"#{File.basename(to.path)}-#{dry_run? ? DRY_SNAP : SecureRandom.uuid}"
|
|
120
124
|
end
|
|
121
125
|
|
|
122
126
|
def get_temp_filename(base_dir)
|
|
@@ -176,6 +180,12 @@ module Uricp::Strategy
|
|
|
176
180
|
uri.scheme == 'rbd' && uri.path.include?('@')
|
|
177
181
|
end
|
|
178
182
|
|
|
183
|
+
# Only images are cached in RBD. Anything else, such as a server or volume
|
|
184
|
+
# disk, may change after it is copied, so it is never used as a cache.
|
|
185
|
+
def image_cache_name?(uri)
|
|
186
|
+
File.basename(uri.path).match?(IMAGE_REGEX)
|
|
187
|
+
end
|
|
188
|
+
|
|
179
189
|
def rbd_cache_upload_available?
|
|
180
190
|
rbd_cache_name && !rbd_cache_image_exists?(rbd_cache_name)
|
|
181
191
|
end
|
|
@@ -14,6 +14,9 @@ module Uricp::Strategy
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
with_active_cache do
|
|
17
|
+
# Only cache copies to an image; anything else is a plain copy
|
|
18
|
+
return proposal(nil) unless image_cache_name?(to)
|
|
19
|
+
|
|
17
20
|
options['cache_name'] = File.basename(options['to_uri'].path)
|
|
18
21
|
cache_target = rbd_cache_image_spec(from)
|
|
19
22
|
if rbd_cache_image_exists?(cache_target) || in_rbd_cache(cache_target)
|
|
@@ -30,7 +33,7 @@ module Uricp::Strategy
|
|
|
30
33
|
|
|
31
34
|
def proposal(cache_check)
|
|
32
35
|
@proposed_options = options.dup
|
|
33
|
-
@proposed_options['rbd_cache_target'] = rbd_uri(cache_check)
|
|
36
|
+
@proposed_options['rbd_cache_target'] = rbd_uri(cache_check) if cache_check
|
|
34
37
|
@proposed_options.delete('cache')
|
|
35
38
|
@proposed_options.delete('cache_name')
|
|
36
39
|
@proposed_options.delete('dry-cache')
|
|
@@ -8,7 +8,7 @@ module Uricp::Strategy
|
|
|
8
8
|
include Uricp::Strategy::CacheCommon
|
|
9
9
|
|
|
10
10
|
def appropriate?
|
|
11
|
-
if from.scheme != 'rbd' || rbd_snapshot_spec?(from)
|
|
11
|
+
if from.scheme != 'rbd' || rbd_snapshot_spec?(from) || !image_cache_name?(from)
|
|
12
12
|
debug "#{self.class.name}: not appropriate"
|
|
13
13
|
return false
|
|
14
14
|
end
|
|
@@ -16,7 +16,7 @@ module Uricp::Strategy
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def command
|
|
19
|
-
"rbd clone --id #{rbd_id} '#{rbd_image_spec(from)}' "\
|
|
19
|
+
"rbd clone --id #{rbd_id} --rbd-default-clone-format 2 '#{rbd_image_spec(from)}' "\
|
|
20
20
|
"'#{rbd_image_spec(to)}' || { [ $? -eq 22 ] && "\
|
|
21
21
|
"rbd create --id #{rbd_id} -s 0 '#{rbd_image_spec(to)}'; };"
|
|
22
22
|
end
|
data/lib/uricp/version.rb
CHANGED
data/uricp.gemspec
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.homepage = ''
|
|
15
15
|
spec.license = 'gplv3'
|
|
16
16
|
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?('docs/') || (f.end_with?('.md') && f != 'README.md') }
|
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
20
|
spec.require_paths = ['lib']
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uricp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.38.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Neil Wilson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aruba
|
|
@@ -161,6 +161,7 @@ extra_rdoc_files: []
|
|
|
161
161
|
files:
|
|
162
162
|
- ".gitignore"
|
|
163
163
|
- ".rubocop.yml"
|
|
164
|
+
- ".tool-versions"
|
|
164
165
|
- Gemfile
|
|
165
166
|
- Gemfile.lock
|
|
166
167
|
- Jenkinsfile
|
|
@@ -170,8 +171,6 @@ files:
|
|
|
170
171
|
- almalinux8/Dockerfile
|
|
171
172
|
- bin/segment_upload
|
|
172
173
|
- bin/uricp
|
|
173
|
-
- bionic/Dockerfile
|
|
174
|
-
- centos7/Dockerfile
|
|
175
174
|
- cucumber.yml
|
|
176
175
|
- features/auth_download.feature
|
|
177
176
|
- features/cacheable_from_uri.feature
|
|
@@ -225,12 +224,11 @@ files:
|
|
|
225
224
|
- lib/uricp/uri_strategy.rb
|
|
226
225
|
- lib/uricp/version.rb
|
|
227
226
|
- uricp.gemspec
|
|
228
|
-
- xenial/Dockerfile
|
|
229
227
|
homepage: ''
|
|
230
228
|
licenses:
|
|
231
229
|
- gplv3
|
|
232
230
|
metadata: {}
|
|
233
|
-
post_install_message:
|
|
231
|
+
post_install_message:
|
|
234
232
|
rdoc_options: []
|
|
235
233
|
require_paths:
|
|
236
234
|
- lib
|
|
@@ -241,12 +239,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
241
239
|
version: '0'
|
|
242
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
241
|
requirements:
|
|
244
|
-
- - "
|
|
242
|
+
- - ">"
|
|
245
243
|
- !ruby/object:Gem::Version
|
|
246
|
-
version:
|
|
244
|
+
version: 1.3.1
|
|
247
245
|
requirements: []
|
|
248
|
-
rubygems_version: 3.1.
|
|
249
|
-
signing_key:
|
|
246
|
+
rubygems_version: 3.1.6
|
|
247
|
+
signing_key:
|
|
250
248
|
specification_version: 4
|
|
251
249
|
summary: Copy one URL to another with optional cacheing
|
|
252
250
|
test_files:
|
data/bionic/Dockerfile
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
FROM ubuntu:bionic
|
|
2
|
-
MAINTAINER support@brightbox.co.uk
|
|
3
|
-
|
|
4
|
-
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
|
5
|
-
|
|
6
|
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common
|
|
7
|
-
|
|
8
|
-
#RUN apt-add-repository ppa:brightbox/ruby-ng
|
|
9
|
-
|
|
10
|
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
|
|
11
|
-
build-essential \
|
|
12
|
-
git \
|
|
13
|
-
qemu-utils \
|
|
14
|
-
liblz4-tool \
|
|
15
|
-
curl \
|
|
16
|
-
ruby \
|
|
17
|
-
ruby-dev \
|
|
18
|
-
python-swiftclient \
|
|
19
|
-
ruby-bundler
|
|
20
|
-
|
|
21
|
-
|
data/centos7/Dockerfile
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
FROM centos:7
|
|
2
|
-
MAINTAINER support@brightbox.co.uk
|
|
3
|
-
|
|
4
|
-
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
|
5
|
-
RUN yum update -y
|
|
6
|
-
RUN yum -y install \
|
|
7
|
-
centos-release-openstack-train \
|
|
8
|
-
epel-release
|
|
9
|
-
RUN yum -y install \
|
|
10
|
-
gcc \
|
|
11
|
-
make \
|
|
12
|
-
git \
|
|
13
|
-
qemu-img \
|
|
14
|
-
lz4 \
|
|
15
|
-
ruby-devel \
|
|
16
|
-
rubygems \
|
|
17
|
-
rubygem-bundler \
|
|
18
|
-
ceph-common \
|
|
19
|
-
python-swiftclient
|
|
20
|
-
RUN mkdir -p /etc/ceph
|
|
21
|
-
ARG RBD_USR=libvirt
|
|
22
|
-
ARG RBD_PSW
|
|
23
|
-
ARG CEPH_MON
|
|
24
|
-
RUN echo -e "[client.$RBD_USR]\nkey = $RBD_PSW\n" > /etc/ceph/ceph.client.$RBD_USR.keyring
|
|
25
|
-
RUN echo -e "[global]\nmon_host = $CEPH_MON\n" > /etc/ceph/ceph.conf
|
data/xenial/Dockerfile
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
FROM ubuntu:xenial
|
|
2
|
-
MAINTAINER support@brightbox.co.uk
|
|
3
|
-
|
|
4
|
-
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
|
5
|
-
|
|
6
|
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common
|
|
7
|
-
|
|
8
|
-
#RUN apt-add-repository ppa:brightbox/ruby-ng
|
|
9
|
-
|
|
10
|
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
|
|
11
|
-
build-essential \
|
|
12
|
-
git \
|
|
13
|
-
qemu-utils \
|
|
14
|
-
liblz4-tool \
|
|
15
|
-
curl \
|
|
16
|
-
ruby \
|
|
17
|
-
ruby-dev \
|
|
18
|
-
python-swiftclient \
|
|
19
|
-
ruby-bundler
|
|
20
|
-
|
|
21
|
-
|