Adding packages to buildslaves
Prerequisites
Requirements
- Ansible
- buildserver-setuproutine repository
- SSH root-access to the docker host running the buildslave(s) in question
Suggestions
- Understand how the buildserver setup routine works
- SSH root-access via key authentication
Example - Adding 'sys-apps/dtc'
-
Gain access to the buildserver_setup repository
-
Edit roles/docker_buildslave/templates/Dockerfile.j2
-
Add a RUN instruction per package that should be added
29 RUN \ 30 {% set package="sys-apps/dtc" %} 31 emerge --autounmask-write=y {{ package }}; \ 32 etc-update --automode -5 && \ 33 emerge -u {{ package }} && \ 34 rm -Rf /usr/portage/distfiles/*
-
Connect to the docker host running the buildslave
-
Identify and verify the buildslave containers that have to be rebuilt
$ docker ps -f name=".*buildslave_[^_]*\..*" -f status=running
-
Stop the buildslave containers
$ docker ps -f name=".*buildslave_[^_]*\..*" -f status=running -q | xargs docker stop | xargs docker rm
-
Delete the buildslaves images, without their history
$ docker images | grep -e ".*buildslave-[^-]*\..*" | grep -oE "[[:alnum:]]{12}" | xargs docker rmi --no-prune
-
Comment the rootfs roles in the buildslaves.yml playbook for every architecture
23 - role: docker_buildslave 24 # - role: docker_buildslave_rootfs
-
Run ansible-playbook
$ ansible-playbook -i hosts buildslaves.yml --tags all
-
Uncomment the rootfs roles in the buildslaves.yml playbook for every architecture
23 - role: docker_buildslave 24 - role: docker_buildslave_rootfs