Skip to content

Commit 8337417

Browse files
committed
Copy source to VMs
1 parent 03c0965 commit 8337417

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

master-bintars/master.cfg

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,39 +113,47 @@ c["workers"].append(mkWorker("monty-bbw1-x64", max_builds=1, properties={"jobs":
113113

114114

115115
####### FACTORY CODE
116-
def getport():
117-
# TODO Dummy implementation, replace with actual logic to get a port
118-
return "12345"
119-
120-
121116
def memory_def():
122117
# TODO Dummy implementation, replace with actual logic to define memory
123118
return "2048"
124119

125120

126121
gccWarningPattern = "^(.*?):([0-9]+):(?:[0-9]+:)? [Ww]arning: (.*)$"
122+
kvm_scpopt = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
127123

128124

129-
# TODO - replace with actual implementation
130-
def ScpSourceIntoVM():
131-
return "scp source.zip buildbot@vm:/path/to/destination"
125+
def ScpSourceIntoVM(port):
126+
return util.Interpolate(
127+
"= scp -P "
128+
+ port
129+
+ " "
130+
+ kvm_scpopt
131+
+ " /mnt/packages/%(prop:tarbuildnum)s_%(prop:mariadb_version)s.tar.gz buildbot@localhost:buildbot/"
132+
)
132133

133134

134135
def getBintarBuilder(
135-
name, kvm_image, cpu, ramdisk=True, catg="main", cmake="", suffix=""
136+
name,
137+
kvm_image,
138+
cpu,
139+
ramdisk=True,
140+
catg="main",
141+
cmake="",
142+
suffix="",
143+
port="10000",
136144
):
137145
bin_fact = util.BuildFactory()
138146

139147
args = [
140-
"--port=" + getport(),
148+
"--port=" + port,
141149
"--memory=" + memory_def(),
142150
"--user=buildbot",
143151
"--cpu=" + cpu,
144152
"--smp=4",
145-
"--logfile=kernel_" + getport() + ".log",
153+
"--logfile=kernel_" + port + ".log",
146154
]
147155
if ramdisk:
148-
args.append("--work-image=/dev/shm/vm-tmp-" + getport() + ".qcow2")
156+
args.append("--work-image=/dev/shm/vm-tmp-" + port + ".qcow2")
149157

150158
kvm_image_test = kvm_image.replace("vm-centos5", "vm-centos6")
151159

@@ -172,16 +180,21 @@ def getBintarBuilder(
172180
description=["making", "bintar"],
173181
descriptionDone=["make", "bintar"],
174182
timeout=3600,
175-
logfiles={"kernel": "kernel_" + getport() + ".log"},
183+
logfiles={"kernel": "kernel_" + port + ".log"},
176184
env={"TERM": "vt102"},
177185
command=["runvm"]
178186
+ args
179187
+ [
180188
"--base-image=/kvm/vms/" + kvm_image + "-build.qcow2",
181-
"vm-tmp-" + getport() + ".qcow2",
189+
"vm-tmp-" + port + ".qcow2",
190+
"rm -Rf buildbot && mkdir buildbot",
191+
ScpSourceIntoVM(port),
192+
util.Interpolate(
193+
"tar -xvzf %(prop:tarbuildnum)s_%(prop:mariadb_version)s.tar.gz --strip-components=1"
194+
),
182195
util.Interpolate(
183196
"""
184-
ls
197+
ls buildbot
185198
"""
186199
),
187200
],
@@ -200,12 +213,14 @@ f_1210_bintar = getBintarBuilder(
200213
kvm_image="vm-quantal-amd64",
201214
cpu="host",
202215
ramdisk=True,
216+
port="10001",
203217
)
204218
f_1604_bintar = getBintarBuilder(
205219
name="amd64-kvm-ubuntu-1604-bintar",
206220
kvm_image="vm-quantal-amd64",
207221
cpu="host",
208222
ramdisk=True,
223+
port="10002",
209224
)
210225

211226
c["builders"].append(

0 commit comments

Comments
 (0)