Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
classabbyamp committed Aug 4, 2024
1 parent 34cc6cb commit 41e1012
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
20 changes: 4 additions & 16 deletions services/nomad/build/buildbot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import configparser
import json
import shlex
from pathlib import Path

from twisted.internet import defer

Expand All @@ -17,20 +18,7 @@ with open(ini['buildbot'].get('workers', '/local/workers.json')) as f:
workers = js.get("workers", [])
builders = js.get("builders", [])

# TODO
userInfoProvider = util.LdapUserInfo(
uri='ldap://localhost:389',
bindUser='',
bindPw='',
accountBase='ou=entities,dc=netauth,dc=voidlinux,dc=org',
accountPattern='(uid=%(username)s)',
accountFullName='displayname',
accountEmail='mail',
groupBase='ou=groups,dc=netauth,dc=voidlinux,dc=org',
groupMemberPattern='',
groupName='',
)
auth = util.RemoteUserAuth(userInfoProvider=userInfoProvider)
netauth = util.BuildbotNetAuth(conf=Path("/etc/netauth/config.toml"))
authz = util.Authz(
allowRules=[
util.AnyEndpointMatcher(role="ops", defaultDeny=False),
Expand Down Expand Up @@ -65,10 +53,10 @@ c = BuildmasterConfig = {
},
},
'avatar_methods': [
util.AvatarGitHub(), util.AvatarGravatar(),
netauth, util.AvatarGitHub(), util.AvatarGravatar(),
],
'authz': authz,
'auth': auth,
'auth': netauth,
'ui_default_config': {
'Waterfall.number_background_waterfall': True,
'Waterfall.show_builders_without_builds': True,
Expand Down
14 changes: 13 additions & 1 deletion services/nomad/build/buildbot.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ job "buildbot" {
read_only = false
}

volume "netauth_config" {
type = "host"
read_only = true
source = "netauth_config"
}

service {
// TODO: can't be nomad with meta {}
provider = "nomad"
Expand Down Expand Up @@ -68,6 +74,12 @@ job "buildbot" {
destination = "/db"
}

volume_mount {
volume = "netauth_config"
destination = "/etc/netauth"
read_only = true
}

template {
data = <<EOF
[buildbot]
Expand All @@ -81,7 +93,7 @@ host = irc.libera.chat
# TODO
# nick = void-builder
# channel = #xbps
# authz = duncaen maldridge
# authz = duncaen maldridge abby
nick = abby-testbot
channel = ###abby-testbot
authz = duncaen maldridge abby
Expand Down
1 change: 1 addition & 0 deletions services/pkg/buildbot-builder/buildbot.tac
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# vim: set filetype=python:

import os
import configparser
Expand Down
4 changes: 3 additions & 1 deletion services/pkg/buildbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ RUN xbps-install -Suy xbps && xbps-install -uy python3 tini git curl
# version must be synced with ../buildbot-worker
RUN python3 -m venv /venv && \
/venv/bin/pip3 install wheel && \
/venv/bin/pip3 install 'buildbot[tls,bundle]~=4.0.0' treq ldap3
/venv/bin/pip3 install 'buildbot[tls,bundle]~=4.0.0' treq \
'git+https://github.com/classabbyamp/netauth-python.git' \
'git+https://github.com/classabbyamp/buildbot-netauth.git'
WORKDIR /buildbot
COPY buildbot.tac /buildbot/
COPY run.sh /
Expand Down
2 changes: 2 additions & 0 deletions services/pkg/buildbot/buildbot.tac
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# vim: set filetype=python:

import os
import sys

Expand Down

0 comments on commit 41e1012

Please sign in to comment.