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

ansible: upgrades for docker hosts (1804 hosts & containers, remove debian7-armv7, swap Alpine 3.8 for 3.10) #1945

Merged
merged 1 commit into from
Oct 9, 2019
Merged
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
14 changes: 7 additions & 7 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ hosts:
ubuntu1404-x86-1: {ip: 159.203.115.220}
ubuntu1604-x86-1: {ip: 159.203.77.233}
ubuntu1604-x86-2: {ip: 104.131.191.135}
ubuntu1604_docker-x64-1: {ip: 128.199.198.56}
ubuntu1604_docker-x64-2: {ip: 138.68.241.115}
ubuntu1804_docker-x64-1: {ip: 134.209.55.216}
ubuntu1804_docker-x64-2: {ip: 159.89.183.200}
ubuntu1804-x64-1: {ip: 178.128.181.213}

- joyent:
Expand All @@ -113,7 +113,7 @@ hosts:
smartos17-x64-2: {ip: 72.2.115.11}
smartos18-x64-1: {ip: 72.2.115.192}
smartos18-x64-2: {ip: 72.2.119.47}
ubuntu1604_docker-x64-1: {ip: 37.153.110.162, user: ubuntu}
ubuntu1804_docker-x64-1: {ip: 165.225.151.201, user: ubuntu}
ubuntu1604_arm_cross-x64-1: {ip: 165.225.136.6, user: ubuntu}
ubuntu1804-x64-1: {ip: 37.153.109.142, user: ubuntu}

Expand Down Expand Up @@ -212,9 +212,9 @@ hosts:
osx1010-x64-1: {ip: 192.168.2.210, user: iojs}

- scaleway:
ubuntu1604-armv7l-1: {ip: 212.47.233.202}
ubuntu1604-armv7l-2: {ip: 51.15.218.201}
ubuntu1604-armv7l-3: {ip: 163.172.186.154}
ubuntu1804-armv7l-1: {ip: 212.47.246.3}
ubuntu1804-armv7l-2: {ip: 212.47.233.202}
ubuntu1804-armv7l-3: {ip: 51.15.218.201}

- softlayer:
centos5-x64-1: {ip: 50.23.85.252}
Expand All @@ -226,7 +226,7 @@ hosts:
debian9-x64-1: {ip: 169.60.150.91}
ubuntu1404-x64-1: {ip: 50.97.245.5}
ubuntu1404-x86-1: {ip: 50.97.245.9}
ubuntu1604_docker-x64-1: {ip: 169.62.77.230}
ubuntu1804_docker-x64-1: {ip: 52.117.26.9}
ubuntu1604-x64-1: {ip: 169.60.150.88, alias: jenkins-workspace-3}

- packetnet:
Expand Down
8 changes: 1 addition & 7 deletions ansible/plugins/filter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ def match_key(value, dictionary, raise_error=True, feedback_name='os'):
return False


def latest_version(versions):
versions.sort(key=lambda s: map(int, s.split('.')))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THIS was the Python3 problem that's been haunting me, stopping me from doing any of this Docker update stuff on my Mac, having to do it all on my Linux machine instead. I've lost the error, although it's been mentioned a couple of times in this repo already, something about < not being compatible with map.
So I've avoided the Python2/3 dumpster fire entirely and used good 'ol reliable Bash to get the job done, see below.

return versions[-1]


def starts_with(value, query):
return value.startswith(query)

Expand All @@ -65,6 +60,5 @@ def filters(self):
return {
'match_key': match_key,
'startswith': starts_with,
'stripversion': stripversion,
'latest_version': latest_version
'stripversion': stripversion
}
4 changes: 2 additions & 2 deletions ansible/roles/baselayout/tasks/ccache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
# This depends on ansible being able to run curl locally, YMMV, if it doesn't
# work, try changing the local_action to a remote one:
# raw: curl -sL https://www.samba.org/ftp/ccache/
local_action: command shell curl -sL https://www.samba.org/ftp/ccache/
local_action: shell curl -sL https://www.samba.org/ftp/ccache/ | sed -n -e 's/.*"ccache-\([0-9.]*\).tar.gz".*/\1/p' | tail -1
register: ccache_html_content

- name: "ccache : extract ccache latest version"
set_fact:
ccache_latest: "{{ ccache_html_content.stdout | regex_findall('ccache-[0-9]+.[0-9]+(?:.[0-9]+)*.tar.gz') | map('regex_replace', 'ccache-') | map('regex_replace', '.tar.gz') | list | latest_version }}"
ccache_latest: "{{ ccache_html_content.stdout }}"

- name: "ccache : download and extract"
unarchive:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.8
FROM alpine:3.10

ENV LC_ALL C
ENV USER {{ server_user }}
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"

- name: run scaleway armv7 jenkins-worker setup
when: "'scaleway-ubuntu1604-armv7l' in inventory_hostname"
when: "'scaleway-ubuntu1804-armv7l' in inventory_hostname"
include: "{{ role_path }}/tasks/partials/scaleway-armv7.yml"

# @TODO(mhdawson): get tap2junit working on zOS
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/jenkins-worker/tasks/partials/docker-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
register: server_user_uid

- name: docker | fetch samba ccache HTML page
local_action: shell curl -sL https://www.samba.org/ftp/ccache/
local_action: shell curl -sL https://www.samba.org/ftp/ccache/ | sed -n -e 's/.*"ccache-\([0-9.]*\).tar.gz".*/\1/p' | tail -1
register: ccache_html_content

- name: docker | extract ccache latest version
set_fact:
ccache_latest: "{{ ccache_html_content.stdout | regex_findall('ccache-[0-9]+.[0-9]+(?:.[0-9]+)*.tar.gz') | map('regex_replace', 'ccache-') | map('regex_replace', '.tar.gz') | list | latest_version }}"
ccache_latest: "{{ ccache_html_content.stdout }}"

- name: docker | check if docker exists
shell: which docker
Expand All @@ -23,7 +23,7 @@

- name: docker | install docker from docker.com
when: "docker_exists.stdout == ''"
raw: curl -fsSL get.docker.com | sudo bash -
raw: curl -fsSL get.docker.com | bash -

- name: docker | copy docker-exec script
template:
Expand Down
71 changes: 0 additions & 71 deletions ansible/roles/jenkins-worker/templates/armv7_wheezy.Dockerfile.j2

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ raspberry_pi: {
{ name: 'jessie', template: 'rpi_jessie.Dockerfile.j2' }
],
armv7l: [
{ name: 'wheezy', template: 'rpi_wheezy.Dockerfile.j2' },
{ name: 'jessie', template: 'rpi_jessie.Dockerfile.j2' },
{ name: 'stretch', template: 'rpi_stretch.Dockerfile.j2' }
],
Expand All @@ -132,7 +131,6 @@ raspberry_pi: {

scaleway_armv7: {
containers: [
{ name: 'wheezy', template: 'armv7_wheezy.Dockerfile.j2' },
{ name: 'jessie', template: 'armv7_jessie.Dockerfile.j2' },
{ name: 'stretch', template: 'armv7_stretch.Dockerfile.j2' }
]
Expand Down
1 change: 0 additions & 1 deletion jenkins/scripts/VersionSelectorScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def buildExclusions = [
[ /^ubuntu1604-32/, anyType, gte(10) ], // 32-bit linux for <10 only

// ARM --------------------------------------------------
[ /^debian7-docker-armv7$/, anyType, gte(10) ],
[ /^debian8-docker-armv7$/, releaseType, lt(10) ],
[ /^debian8-docker-armv7$/, anyType, gte(12) ],
[ /^debian9-docker-armv7$/, anyType, lt(10) ],
Expand Down