worker and master splited #8
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/buildbot_multibuild#8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "cis-muzahid/buildbot_multibuild:kivy-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +2,4 @@
from os.path import exists, isfile, join
import requests
import re
from buildbot.plugins import util
this is probably here only because of
@util.renderer
, which shouldn't be on the workerRemoved from worker
also remove
from .renderers import *
@ -0,0 +71,4 @@
return results
def _get_dockerfile_contents(props):
can't access
props
, instead thejobname
variable needs to be passed from masterAlso passed os_codename instead of
util.Interpolate("%(prop:os_codename)s")
@ -0,0 +86,4 @@
}[util.Interpolate("%(prop:os_codename)s")]
@util.renderer
this can't be on a worker, because of the decorator
however, it needs to worker differently. It needs to return
getProperty('dockerfile')
or soemthing like that.@ -0,0 +91,4 @@
return _get_dockerfile_contents(props)
def trigger_child_hooks(buildbotUrl: str, os_codename: str, repository, branch, jobname, directory=".buildbot"):
@ -0,0 +108,4 @@
# make a post request
request_data["properties"] = {
"dockerfile": get_dockerfile_contents(
"dockerfile": _get_dockerfile_contents(
@ -17,56 +17,8 @@ import re
from buildbot.plugins import steps, util
from .lib.renderers import *
from .lib.worker_multibuild import trigger_child_hooks
also only worker
@ -68,4 +22,2 @@
path =".buildbot"
def list_jobs(directory=".buildbot"):
needs to be on the worker
@ -149,3 +59,3 @@
)
)
?
@ -81,3 +21,1 @@
results.append(_)
return results
addStep(steps.ShellCommand(
ok but different location (inside
add_child_step
)@ -135,3 +39,1 @@
"jobname": jobname,
}
requests.post(request_url, headers=request_headers, data=request_data)
return _get_dockerfile_contents(props, props.getProperty('jobname', default=None), util.Interpolate("%(prop:os_codename)s"))
return props.getProperty('dockerfile')
@ -0,0 +69,4 @@
return results
def _get_dockerfile_contents(props, jobname, os_codename):
no
props
@ -135,3 +34,1 @@
"jobname": jobname,
}
requests.post(request_url, headers=request_headers, data=request_data)
return _get_dockerfile_contents(props, props.getProperty('jobname', default=None), util.Interpolate("%(prop:os_codename)s"))
no calling
_get_dockerfile_contents
, just accessprops
@ -171,1 +67,4 @@
Add a step to the download, build and test factory
"""
build_factory.addStep(steps.ShellCommand(
upon reflection, this
BuildStep
needs to go to the parent, not child17bc49bafc
tod3f4e3574e
Also let's just assume os_codename is
bionic
and make it configurable later.@ -0,0 +16,4 @@
ty = "/change_hook/base"
path =".buildbot"
dockerfile_extra_contents_focal = """
make this into a dict
@ -135,3 +34,1 @@
"jobname": jobname,
}
requests.post(request_url, headers=request_headers, data=request_data)
return _get_dockerfile_contents(props.getProperty('jobname', default=None), util.Interpolate("%(prop:os_codename)s"))
return props.getProperty('dockerfile')
We already have this information.
@ -144,1 +44,4 @@
command=["sudo", "wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", "worker_multibuild.py"]
))
build_factory.addStep(
os_codename
should be per-Dockerfile. We don't really needos_codename
in the parent, only in the child.The
Dockerfile
s will begin with, e.g.FROM ubuntu:bionic ...
. So the parent will then extract the codename from that, and based on that append the corresponding buildbot's setup and entrypoint.@ -93,54 +29,21 @@ def find_artifacts(directory="out"):
return join(directory, _)
@util.renderer
we don't need this function
@ -0,0 +76,4 @@
with open(join(path + jobname), "r") as file:
contents = file.read()
# remove any line containing FROM or RUN keywords
re.match(r"(?m)^(FROM|RUN).*$", "", contents)
the check should be reversed. Instead of removing lines containing FROM or RUN, it should remove the other lines.
@ -151,1 +41,4 @@
build_factory.addStep(steps.ShellCommand(
name="download worker",
command=["sudo", "wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", "worker_multibuild.py"]
no need for sudo, however we need a different directory
Update path to
multibuild
(downloading and executing it). It shouldn't mix with the repository that's being processed.a40d498533
to483db0d732
@ -0,0 +79,4 @@
# accept any line containing FROM or RUN keywords
# re.match(r"(?m)^(FROM|RUN).*$", contents)
for i in range(len(contents)):
@ -151,1 +41,4 @@
build_factory.addStep(steps.ShellCommand(
name="download worker",
command=["sudo", "wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", "worker_multibuild.py"]
maybe into
~/.local/bin/
(also needs to create the directory if not existant)I am using
--force-directories
for crete folder if not exists@ -0,0 +85,4 @@
if inside_allowed_command:
res += line
l = line.strip()
if l.endswith("\\") or l.endswith("\\\n"):
\n
probably not needed due tostrip
continue
and revert conditional@ -151,1 +41,4 @@
build_factory.addStep(steps.ShellCommand(
name="download worker",
command=["sudo", "wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", ".local/bin/worker_multibuild.py"]
no
sudo
also maybe
os.path.join(os.getenv['HOME'], '.local/bin/worker_multibuild.py')
@ -169,2 +71,3 @@
def add_child_sh_steps(build_factory, directory=".buildbot"):
"""
Add a step to the build factory
Add a step to the download, build and test factory
please same indent as elsewhere
8e6ab5eea0
toc151641ebe
Please finish.
@ -135,3 +32,1 @@
"jobname": jobname,
}
requests.post(request_url, headers=request_headers, data=request_data)
# @util.renderer
remove
@ -152,0 +44,4 @@
command=["wget", "-O", "https://git.bitmessage.org/Bitmessage/buildbot_multibuild/raw/branch/master/lib/worker_multibuild.py", join(getenv['HOME'], '.local/bin/worker_multibuild.py')]
))
# build_factory.addStep(
remove
Pull request closed