first we change poudriere.conf
--- poudriere.conf.sample 2018-02-15 00:54:08.000000000 +0100
+++ poudriere.conf 2018-02-21 19:40:40.959762000 +0100
@@ -9,14 +9,14 @@
# You need at least 7GB of free space in this pool to have a working
# poudriere.
#
-#ZPOOL=tank
+ZPOOL=zroot
### NO ZFS
# To not use ZFS, define NO_ZFS=yes
#NO_ZFS=yes
# root of the poudriere zfs filesystem, by default /poudriere
-# ZROOTFS=/poudriere
+ZROOTFS=/poudriere
# the host where to download sets for the jails setup
# You can specify here a host or an IP
@@ -27,7 +27,7 @@
# Also note that every protocols supported by fetch(1) are supported here, even
# file:///
# Suggested: https://download.FreeBSD.org
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=ftp://mirror.uni-c.dk
# By default the jails have no /etc/resolv.conf, you will need to set
# RESOLV_CONF to a file on your hosts system that will be copied has
@@ -42,7 +42,7 @@
# by default a zfs filesystem will be created and set to
# ${BASEFS}/data
#
-#POUDRIERE_DATA=${BASEFS}/data
+POUDRIERE_DATA=${BASEFS}/data
# Use portlint to check ports sanity
USE_PORTLINT=no
@@ -64,7 +64,7 @@
# yes - Enables tmpfs(5) for wrkdir and data
# no - Disable use of tmpfs(5)
# EXAMPLE: USE_TMPFS="wrkdir data"
-USE_TMPFS=yes
+USE_TMPFS=all
# How much memory to limit tmpfs size to for *each builder* in GiB
# (default: none)
@@ -77,7 +77,7 @@
# How many file descriptors to limit each jail process to (default: 1024)
# This can also be set per PKGBASE, such as MAX_FILES_RStudio=2048.
# Package names with hyphens (-) should be replaced with underscores (_).
-#MAX_FILES=1024
+MAX_FILES=2048
# If set the given directory will be used for the distfiles
# This allows to share the distfiles between jails and ports tree
@@ -97,7 +97,7 @@
# will be deleted and the port will be rebuilt.
# Valid options: yes, no, verbose
# verbose will display the old and new options
-#CHECK_CHANGED_OPTIONS=verbose
+CHECK_CHANGED_OPTIONS=verbose
# Automatic Dependency change detection
# When bulk building packages, compare the dependencies from kept packages to
@@ -107,7 +107,7 @@
# for many ports.
# Valid options: yes, no
# Default: yes
-#CHECK_CHANGED_DEPS=yes
+CHECK_CHANGED_DEPS=yes
# Consider bad dependency lines on the wrong PKGNAME as fatal.
# For example:
@@ -122,7 +122,7 @@
# Path to the RSA key to sign the PKG repo with. See pkg-repo(8)
-#PKG_REPO_SIGNING_KEY=/etc/ssl/keys/repo.key
+PKG_REPO_SIGNING_KEY=/usr/local/etc/ssl/keys/poudriere.key
# ccache support. Supply the path to your ccache cache directory.
@@ -190,7 +190,7 @@
# By default MAKE_JOBS is disabled to allow only one process per cpu
# Use the following to allow it anyway
-# ALLOW_MAKE_JOBS=yes
+#ALLOW_MAKE_JOBS=yes
# List of packages that will always be allowed to use MAKE_JOBS
# regardless of ALLOW_MAKE_JOBS. This is useful for allowing ports
@@ -199,21 +199,21 @@
# Timestamp every line of build logs
# Default: no
-#TIMESTAMP_LOGS=no
+TIMESTAMP_LOGS=yes
# URL where your POUDRIERE_DATA/logs are hosted
# This will be used for giving URL hints to the HTML output when
# scheduling and starting builds
-#URL_BASE=http://yourdomain.com/poudriere/
+URL_BASE=https://poudriere.net.deic.dk/
# This defines the max time (in seconds) that a command may run for a build
# before it is killed for taking too long. Default: 86400
-#MAX_EXECUTION_TIME=86400
+MAX_EXECUTION_TIME=86400
# This defines the time (in seconds) before a command is considered to
# be in a runaway state for having no output on stdout. Default: 7200
-#NOHANG_TIME=7200
+NOHANG_TIME=7200
# The repository is updated atomically if set yes. This leaves the
@@ -222,25 +222,25 @@
# for remote syncing or backups.
# Recommended to always keep on.
# Default: yes
-#ATOMIC_PACKAGE_REPOSITORY=yes
+ATOMIC_PACKAGE_REPOSITORY=yes
# When using ATOMIC_PACKAGE_REPOSITORY, commit the packages if some
# packages fail to build. Ignored ports are considered successful.
# This can be set to 'no' to only commit the packages once no failures
# are encountered.
# Default: yes
-#COMMIT_PACKAGES_ON_FAILURE=yes
+COMMIT_PACKAGES_ON_FAILURE=yes
# Keep older package repositories. This can be used to rollback a system
# or to bisect issues by changing the repository to one of the older
# versions and reinstalling everything with `pkg upgrade -f`
# ATOMIC_PACKAGE_REPOSITORY is required for this.
# Default: no
-#KEEP_OLD_PACKAGES=no
+KEEP_OLD_PACKAGES=yes
# How many old package repositories to keep with KEEP_OLD_PACKAGES
# Default: 5
-#KEEP_OLD_PACKAGES_COUNT=5
+KEEP_OLD_PACKAGES_COUNT=5
# Make testing errors fatal.
# If set to 'no', ports with test failure will be marked as failed but still
@@ -251,11 +251,11 @@
# Define the building jail hostname to be used when building the packages
# Some port/packages hardcode the hostname of the host during build time
# This is a necessary setup for reproducible builds.
-#BUILDER_HOSTNAME=pkg.FreeBSD.org
+BUILDER_HOSTNAME=poudriere.net.deic.dk
# Define to get a predictable timestamp on the ports tree
# This is a necessary setup for reproducible builds.
-#PRESERVE_TIMESTAMP=yes
+PRESERVE_TIMESTAMP=yes
# Define to yes to build and stage as a regular user
# Default: yes, unless CCACHE_DIR is set and CCACHE_DIR_NON_ROOT_SAFE is not
@@ -288,7 +288,7 @@
# Use colors when in a TTY
# Default: yes
-#USE_COLORS=yes
+USE_COLORS=yes
# Only build what is requested. Do not rebuild build deps if nothing requested
# depends on them. This can create an inconsistent repository if you often
@@ -305,9 +305,9 @@
# Set to hosted to use the /data directory instead of inline style HTML
# Default: inline
-#HTML_TYPE="hosted"
+HTML_TYPE="hosted"
# Set to track remaining ports in the HTML interface. This can slow down
# processing of the queue slightly, especially for bulk -a builds.
# Default: no
-#HTML_TRACK_REMAINING=yes
+HTML_TRACK_REMAINING=yes
a few things to make it all come through
sudo mkdir -p /usr/local/etc/ssl/{keys,certs}
sudo chmod 0600 /usr/local/etc/ssl/keys
sudo openssl genrsa -out /usr/local/etc/ssl/keys/poudriere.key 4096
sudo openssl rsa -in /usr/local/etc/ssl/keys/poudriere.key \
-pubout -out /usr/local/etc/ssl/certs/poudriere.cert
first run
I now switch to the root user and do the rest under tmux so other people are able to look at it.
ports
I like git, so I pick up the ports tree using git
poudriere ports -c -m git
poudriere jails
We'll do both a 64bit and a 32bit jail so we can compile to both platforms. I've taken the
naming to be something that works easily with pkg config ABI
format which also makes
the path in pkg repo config be kind of clean and neat.
poudriere jail -c -j FreeBSD:11:amd64 -v 11.1-RELEASE
poudriere jail -c -j FreeBSD:11:i386 -a i386 -v 11.1-RELEASE
Or something lazy like:
poudriere jail -c -j $(pkg config ABI) -v $(uname -r | sed -e 's/-RELEASE.*/-RELEASE/')
poudriere jail -c -j $(pkg config ABI|sed -e 's/amd64/i386/') -a i386 -v $(uname -r | sed -e 's/-RELEASE.*/-RELEASE/')
I've ended up doing something in my .zshrc
on my build servers that makes this a bit
easier.
if [ ${SYSTEM} = "FreeBSD" ]; then
echo -n " +ABI"
export ABI=$(pkg config ABI)
export ALTABI=$(pkg config ALTABI)
export FREEBSDRELEASE=$(uname -r|sed -e's/RELEASE.*/RELEASE/')
fi
if (( $+commands[poudriere] )); then
if [[ $commands[poudriere] = "/usr/local/bin/poudriere" ]]; then
echo -n " +poudriere"
alias poudriere="sudo nice -19 $commands[poudriere]"
alias pb="poudriere bulk"
alias pj="poudriere jail"
alias pja="pj -j ${ABI}"
alias pbja="pb -j ${ABI}"
alias P_makeabijail="pja -c -v ${FREEBSDRELEASE}"
fi
fi
first bulks
Before anything else, I like to build the packages we're using for all this, some shell stuff and other things. It's usually a short build.
Finding what packages to build, pkg query can often help, this liste all non-automatic packages, taken from pkg-query(8) manpage.
# pkg query -e '%a = 0' %o | sort -u
devel/git
editors/vim-lite
misc/freebsd-doc-en
ports-mgmt/pkg
ports-mgmt/poudriere
security/sudo
shells/zsh
shells/zsh-navigation-tools
sysutils/tmux
textproc/zsh-syntax-highlighting
Nice and short list, we'll take it :-)
pkg query -e '%a = 0' %o | sort -u >package-list
One last thing before we're ready to go.
mkdir -p /usr/ports/distfiles
Then in one window in tmux.
poudriere bulk -j freebsd_11-1x64 -f package-list
and in another.
poudriere bulk -j freebsd_11-1x32 -f package-list
nginx
While that's running, time to configure nginx to serve the content so it's easy to monitor without having to look at the console.
pkg install -y nginx
cat >/usr/local/etc/nginx/nginx.conf<<EOF
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80 default;
server_name _;
root /usr/local/share/poudriere/html;
location /data {
alias /usr/local/poudriere/data/logs/bulk;
autoindex on;
}
location /packages {
root /usr/local/poudriere/data;
autoindex on;
}
}
}
EOF
sysrc nginx_enable=YES
service nginx start
If there are other virtual hosts on the nginx, you'd most likely want to replace
server_name _;
with a more serious line that names the real host :-).
Comments
comments powered by Disqus