Skip to content

Commit 5f133e3

Browse files
authored
Drop nightly builders from master.cfg (#318)
1 parent ef8efab commit 5f133e3

File tree

5 files changed

+19
-299
lines changed

5 files changed

+19
-299
lines changed

Caddyfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pypi.halide-lang.org {
99
}
1010

1111
buildbot.halide-lang.org {
12+
redir / /master/ temporary
13+
1214
handle_path /master/* {
1315
handle /sse/* {
1416
reverse_proxy buildbot:8012 {
@@ -19,11 +21,6 @@ buildbot.halide-lang.org {
1921
reverse_proxy buildbot:8012
2022
}
2123

22-
handle {
23-
root * /artifacts
24-
file_server browse
25-
}
26-
2724
header {
2825
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
2926
X-Frame-Options DENY

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ the correct ones:
6464

6565
## Starting the master
6666

67-
Choose directories to hold build artifacts and PyPI packages (the defaults are
68-
`./data/artifacts` and `./data/packages`, respectively):
67+
Optionally choose a directory to hold PyPI packages (the default is
68+
`./data/packages`):
6969

7070
```console
71-
$ export HALIDE_BB_MASTER_ARTIFACTS_DIR=$HOME/artifacts
7271
$ export HALIDE_BB_PYPI_PACKAGES_DIR=$HOME/wheels
7372
```
7473

@@ -80,8 +79,7 @@ $ docker compose up -d --build
8079

8180
The database is automatically initialized on first start. Caddy handles TLS
8281
certificates, so there is no manual web server configuration needed. The
83-
Buildbot web interface is available at `https://buildbot.halide-lang.org/master/`
84-
and artifacts are served at the site root.
82+
Buildbot web interface is available at `https://buildbot.halide-lang.org/master/`.
8583

8684
Port 9990 must be reachable by workers. Port 8012 is internal only; Caddy
8785
proxies it on ports 80/443.

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ services:
2323
- "9990:9990"
2424
volumes:
2525
- buildbot-gitpoller:/buildbot/master/gitpoller-llvm-workdir
26-
- ${HALIDE_BB_MASTER_ARTIFACTS_DIR:-./data/artifacts}:/artifacts
2726
secrets:
2827
- db_password.txt
2928
- github_token.txt
3029
- halide_bb_pass.txt
3130
- webhook_token.txt
3231
- buildbot_www_pass.txt
3332
environment:
34-
HALIDE_BB_MASTER_ARTIFACTS_DIR: /artifacts
3533
HALIDE_BB_MASTER_SECRETS_DIR: /run/secrets
3634
HALIDE_BB_MASTER_DB_URL: "postgresql://buildbot:{DB_PASSWORD}@db/buildbot"
3735
logging:
@@ -73,7 +71,6 @@ services:
7371
- ./Caddyfile:/etc/caddy/Caddyfile:ro
7472
- caddy-data:/data
7573
- caddy-config:/config
76-
- ${HALIDE_BB_MASTER_ARTIFACTS_DIR:-./data/artifacts}:/artifacts:ro
7774
logging:
7875
driver: local
7976
restart: unless-stopped

master/custom_steps.py

Lines changed: 1 addition & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,10 @@
1-
import os
2-
import re
31
import xml.etree.ElementTree as Xml
4-
from collections import defaultdict
5-
from pathlib import Path
6-
from typing import Dict, List
72

83
from buildbot.process.buildstep import BuildStepFailed, BuildStep, ShellMixin
9-
from buildbot.process.results import SUCCESS, FAILURE, WARNINGS
104
from buildbot.steps.worker import CompositeStepMixin
115
from twisted.internet import defer
126

13-
__all__ = ["CleanOldFiles", "CTest", "SetPropertiesFromCMakeCache"]
14-
15-
16-
class SetPropertiesFromCMakeCache(CompositeStepMixin, BuildStep):
17-
name = "set-properties-from-cmake-cache"
18-
19-
renderables = ["props"]
20-
21-
# Parsing with regex is safe because the CMakeCache.txt format
22-
# hasn't changed since 2006, according to `git blame`. Caveat:
23-
# they have backwards compatibility code for parsing entries with
24-
# quoted names and missing types. We don't bother with that here.
25-
_cache_re = re.compile(
26-
r"""
27-
^(?!//|\#) # Ignore comment lines.
28-
([^:=]+?) # Get the variable name,
29-
(-ADVANCED)? # which might be marked as advanced,
30-
:([^=]*) # and will have a type.
31-
=(.*)$ # The value extends through the end of the line.
32-
""",
33-
re.VERBOSE,
34-
)
35-
36-
def __init__(self, *, props=None, normalize_bools=False, expand_lists=False, **kwargs):
37-
super().__init__(**kwargs)
38-
self.props = props or []
39-
self.normalize_bools = normalize_bools
40-
self.expand_lists = expand_lists
41-
42-
@defer.inlineCallbacks
43-
def run(self):
44-
if not self.props:
45-
return SUCCESS
46-
47-
log = yield self.addLog("props")
48-
49-
cache = yield self.getFileContentFromWorker(f"{self.workdir}/CMakeCache.txt", abandonOnFailure=True)
50-
cache = self._parse_cache(cache)
51-
52-
to_find = set(self.props)
53-
found = to_find & cache.keys()
54-
not_found = to_find - cache.keys()
55-
56-
for key in found:
57-
log.addStdout(f"{key}={cache[key]}\n")
58-
self.setProperty(key, cache[key], "CMakeCache")
59-
60-
for key in not_found:
61-
log.addStderr(f"Cache entry not found: {key}\n")
62-
self.setProperty(key, "", "CMakeCache")
63-
64-
yield log.finish()
65-
return WARNINGS if not_found else SUCCESS
66-
67-
def _parse_cache(self, cache: str):
68-
result = {}
69-
for entry in cache.splitlines():
70-
match = self._cache_re.match(entry)
71-
if match:
72-
key, is_advanced, ty, value = match.groups()
73-
if ty == "BOOL" and self.normalize_bools:
74-
value = self._normalize_bools(value)
75-
if self.expand_lists:
76-
value = self._expand_lists(value)
77-
result[key] = value
78-
return result
79-
80-
@staticmethod
81-
def _expand_lists(value: str):
82-
if ";" in value:
83-
return value.split(";")
84-
return value
85-
86-
@staticmethod
87-
def _normalize_bools(value: str):
88-
value = value.upper().strip()
89-
if value.endswith("-NOTFOUND"):
90-
return "0"
91-
if value in {"1", "ON", "YES", "TRUE", "Y"}:
92-
return "1"
93-
if value in {"0", "OFF", "NO", "FALSE", "N", "IGNORE", "NOTFOUND"}:
94-
return "0"
95-
raise ValueError(f'Invalid CMake bool "{value}"')
96-
97-
98-
class CleanOldFiles(BuildStep):
99-
name = "clean-old"
100-
101-
def __init__(self, *, groupfn, workdir, keep=1, **kwargs):
102-
super().__init__(**kwargs)
103-
self.groupfn = groupfn
104-
self.workdir = workdir
105-
self.keep = keep
106-
107-
@defer.inlineCallbacks
108-
def run(self):
109-
stdio = yield self.addLog("stdio")
110-
status = SUCCESS
111-
112-
# Group files in workdir together using the supplied function.
113-
groups: Dict[str, List[Path]] = defaultdict(list)
114-
for entry in Path(self.workdir).iterdir():
115-
gid = self.groupfn(entry)
116-
if gid:
117-
groups[gid].append(entry)
118-
119-
# Delete all but the newest self.keep files with the same key.
120-
for group in groups.values():
121-
group.sort(key=os.path.getmtime, reverse=True)
122-
for file in group[self.keep :]:
123-
try:
124-
file.unlink()
125-
stdio.addStdout(f"Removed: {file.resolve()}\n")
126-
except (FileNotFoundError, OSError) as e:
127-
stdio.addStderr(f"Could not delete {file.resolve()}: {e}\n")
128-
status = FAILURE
129-
130-
yield stdio.finish()
131-
return status
7+
__all__ = ["CTest"]
1328

1339

13410
class CTest(ShellMixin, CompositeStepMixin, BuildStep):

0 commit comments

Comments
 (0)