Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add centos8 builder #42

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions buildbot/docker-builders/centos8-64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM centos:8
RUN yum install -y epel-release
ChrisOrlando marked this conversation as resolved.
Show resolved Hide resolved
RUN yum --exclude=iputils update -y && yum install -y \
git curl wget mock rpm-build \
python36 python3-libs python36-devel python3-pip python3-numpy python3-pillow \
redhat-rpm-config gcc libffi-devel openssl-devel \
&& yum groupinstall -y "Development Tools"
RUN ln -sf /usr/bin/python3.6 /usr/bin/python3 \
&& ln -sf /usr/bin/pip3.6 /usr/bin/pip3

RUN python3 -m pip install "buildbot[bundle]" sphinx

ENV WORKER_NAME diax-centos8-64
ENV WORKER_ADMIN Andrew Chin <[email protected]>
ENV WORKER_INFO CentOS 8 64-bit
COPY worker-start.sh /root/
CMD /root/worker-start.sh
18 changes: 18 additions & 0 deletions buildbot/docker-builders/centos8-64/worker-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

cd /root/
if [ ! -d "worker" ]; then
echo "creating worker..."
buildbot-worker create-worker --umask=0o22 --no-logrotate worker bbmaster:9989 $WORKER_NAME $(python3 -c "import hmac, hashlib; print(hmac.new(bytes('$BUILDBOT_SECRET', 'utf-8'), bytes('$WORKER_NAME', 'utf-8'), hashlib.sha512).hexdigest())")
echo $WORKER_ADMIN > worker/info/admin
echo $WORKER_INFO > worker/info/host
uname -a >> worker/info/host
fi

rm -f worker/twistd.pid worker/twistd.log

# make sure /sys is rw (I HAVE NO IDEA but it helps rpm builders)
mount -o remount,rw /sys

# run in a clean env, don't leak secrets
exec env -i -- /bin/bash -c "source /etc/profile; export HOME=`pwd`; exec buildbot-worker start --nodaemon worker"
15 changes: 10 additions & 5 deletions buildbot/master/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ class BaseConfig:
DEFAULT_CLIENT_JAR_VER = "1.15"

ALL_BUILDERS = ['src', 'render', 'win32',
'win64', 'deb32', 'deb64', 'centos7-64']
'win64', 'deb32', 'deb64', 'centos7-64', 'centos8-64']
ENABLED_WORKERS = ['diax-stretch-64',
'diax-stretch-32', 'ec2-windows', 'diax-centos7-64']
'diax-stretch-32', 'ec2-windows', 'diax-centos7-64', 'diax-centos8-64']

# high-level worker list
# workers[name] = [... list of builders ...]
WORKERS_TO_BUILDERS = {
'diax-stretch-64': ['src', 'render', 'deb64'],
'diax-stretch-32': ['src', 'render', 'deb32'],
'diax-centos7-64': ['centos7-64'],
'diax-centos8-64': ['centos8-64'],
'ec2-windows': ['win32', 'win64'],
}

Expand All @@ -79,8 +80,8 @@ class DevConfig(BaseConfig):
BASE_URL = "http://localhost:8020"
ENABLE_GITHUB_AUTH = os.environ.get("DISABLE_GITHUB_AUTH") is None

ALL_BUILDERS = ['src', 'render', 'deb32', 'deb64', 'centos7-64']
ENABLED_WORKERS = ['diax-stretch-64', 'diax-stretch-32', 'diax-centos7-64']
ALL_BUILDERS = ['src', 'render', 'deb32', 'deb64', 'centos7-64', 'centos8-64']
ENABLED_WORKERS = ['diax-stretch-64', 'diax-stretch-32', 'diax-centos7-64', 'diax-centos8-64']


ENV = os.environ.get("ENV", "production")
Expand Down Expand Up @@ -563,7 +564,7 @@ def rpm(rpmbase, mockbase, mockconfig, rpmarch, mockarch):
yield MasterShellCommand(command=["/root/rpmsign.sh", upload_dest(".rpm")], name="sign package", description="signing", descriptionDone="signed")

# link the new rpm into the repo
system_map = {'centos6': '6', 'centos7': '7'}
system_map = {'centos6': '6', 'centos7': '7', 'centos8': '8'}
rpm_package_area = RPM_REPO / system_map[rpmbase] / rpmarch / "packages"

yield MasterShellCommand(command=["ln", "-f", upload_dest(".rpm"), str(rpm_package_area)], name="link into repo", doStepIf=is_release_build, description="linking into repo", descriptionDone="linked into repo")
Expand All @@ -584,6 +585,10 @@ def centos6_64():
def centos7_64():
yield rpm('centos7', 'el7', 'epel-7', 'x86_64', 'x86_64')

@builder(locks=[rpm_build_lock.access('exclusive')])
def centos8_64():
yield rpm('centos8', 'el8', 'epel-8', 'x86_64', 'x86_64')


class RenderDirUpload(DirectoryUpload):
def __init__(self, *args, **kwargs):
Expand Down
39 changes: 39 additions & 0 deletions buildbot/repos/rpm/control/centos8/Minecraft-Overviewer.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Summary: Generates large resolution images of a Minecraft map.
Name: Minecraft-Overviewer
Version: {VERSION}
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
License: GNU General Public License v3
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Vendor: Andrew Brown <[email protected]>
Url: https://overviewer.org/
Requires: python3-pillow python3-numpy
BuildRequires: wget python36-devel python3-numpy

%description
The Minecraft Overviewer is a command-line tool for rendering high-resolution
maps of Minecraft worlds. It generates a set of static html and image files and
uses the Leaflet javascript library to display a nice interactive map.

%prep
wget -P %{_tmppath} https://github.com/python-pillow/Pillow/archive/5.1.0.tar.gz
tar -xf %{_tmppath}/5.1.0.tar.gz --directory %{_tmppath}
%setup -n %{name}

%build
env CFLAGS="$RPM_OPT_FLAGS" PIL_INCLUDE_DIR=%{_tmppath}/Pillow-5.1.0/src/libImaging %{__python3} setup.py build

%install
%{__python3} setup.py install -O1 --root=%{buildroot}
rm -rf %{buildroot}%{_defaultdocdir}/minecraft-overviewer

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{python3_sitearch}/Minecraft_Overviewer-*-*.egg-info
%{python3_sitearch}/overviewer_core
%{_bindir}/overviewer.py
%doc README.rst COPYING.txt sample_config.py
2 changes: 1 addition & 1 deletion buildbot/repos/rpm/repo/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.PHONY : all

all : 6/i386.repo 6/x86_64.repo 7/i386.repo 7/x86_64.repo
all : 6/i386.repo 6/x86_64.repo 7/i386.repo 7/x86_64.repo 8/x86_64.repo

%.repo :
createrepo -s sha $*
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ services:
- apparmor:unconfined
links:
- bbmaster
bbcentos864:
build: buildbot/docker-builders/centos8-64
env_file: confidential.env
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
links:
- bbmaster
bbstretch64:
build: buildbot/docker-builders/stretch-64
env_file: confidential.env
Expand Down
2 changes: 1 addition & 1 deletion flask/overviewer/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from flask import url_for, current_app, session
from flask_sqlalchemy import SQLAlchemy
from werkzeug import secure_filename
from werkzeug.utils import secure_filename
import os.path
import os
import hashlib
Expand Down
4 changes: 2 additions & 2 deletions flask/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ gunicorn==19.9.0
Flask-SQLAlchemy==2.3.2
Flask-Migrate==2.4.0
GitHub-Flask==3.2.0
Flask-WTF==0.14.2
Flask-WTF==0.14.3
unidecode==0.04.1
Flask-Markdown==0.3
pytoml==0.1.20
Pillow==6.2.0
requests==2.21.0
Flask-Caching==1.0.0
Flask-Caching==1.8.0
psycopg2==2.7.7
Flask-DebugToolbar==0.10.1
Flask-Script==2.0.6