From 01cb9c88b232e2ae3f2852de988dc7bb36878a20 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Mon, 8 Jul 2024 09:32:05 -0500 Subject: [PATCH 1/9] feat(pythontest): noble migrations --- Vagrantfile | 4 ++-- salt/base/config/sources.list.jinja | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index e570201c..035e0803 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,7 +16,7 @@ SERVERS = [ "moin", "planet", "pypy-web", - "pythontest", + {:name => "pythontest", :codename => "noble"}, ] SUBNET1 = "192.168.50" @@ -40,7 +40,7 @@ Vagrant.configure("2") do |config| config.vm.define "salt-master" do |s_config| s_config.vm.provider "docker" do |docker, override| docker.build_dir = "dockerfiles" - docker.dockerfile = "Dockerfile.jammy" + docker.dockerfile = "Dockerfile.noble" end s_config.vm.hostname = "salt-master.vagrant.psf.io" diff --git a/salt/base/config/sources.list.jinja b/salt/base/config/sources.list.jinja index 5146671e..af292dc8 100644 --- a/salt/base/config/sources.list.jinja +++ b/salt/base/config/sources.list.jinja @@ -4,12 +4,13 @@ {% set base_repo = "us.archive.ubuntu.com/ubuntu/" %} {% endif %} +{# TODO: Investigate, these seem to be handled doubly in sources.list.d as well as sources.list ###### Ubuntu Main Repos -deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe -deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe +{#deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe#} +{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe#} ###### Ubuntu Update Repos -deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe -deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe -deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe -deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe +{#deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe#} +{#deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe#} +{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe#} +{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe#} From b5ffe66e0da10805e9a1de511551f43f1228f34e Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 9 Jul 2024 14:41:09 -0500 Subject: [PATCH 2/9] feat(loadbalancer): noble migrations --- salt/haproxy/config/haproxy.cfg.jinja | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/salt/haproxy/config/haproxy.cfg.jinja b/salt/haproxy/config/haproxy.cfg.jinja index 00f24836..cc51f668 100644 --- a/salt/haproxy/config/haproxy.cfg.jinja +++ b/salt/haproxy/config/haproxy.cfg.jinja @@ -65,7 +65,6 @@ defaults balance roundrobin timeout connect 5000 - timeout client 50000 timeout server 50000 monitor-uri /_haproxy_status @@ -121,7 +120,6 @@ frontend main capture request header X-Forwarded-For len 64 acl letsencrypt-well-known-acl path_beg /.well-known/acme-challenge/ - use_backend letsencrypt-well-known if letsencrypt-well-known-acl # Determine if this request has TLS on the client side or not. acl is_tls dst_port 19001 @@ -141,6 +139,8 @@ frontend main # Redirect all HTTP traffic to HTTPS redirect code 301 scheme https if !is_tls !letsencrypt-well-known-acl + use_backend letsencrypt-well-known if letsencrypt-well-known-acl + # Dispatch to the redirect backend for any redirects we have, we're going # to do this here after the HTTP -> HTTPS redirect even though this will # result in an extra redirect because we want to give this domain a chance @@ -214,7 +214,25 @@ backend redirect {% for service, config in haproxy.services.items() %} backend {{ service }} {% if config.get("check") -%} + {% if grains["oscodename"] != "noble" -%} option httpchk {{ config.check }} + {%- else -%} + # Noble Config using the newer http-check syntax + # We need to split the check into parts to handle the extra things + # ...maybe there is a better way to do this? + {% set check_parts = config.check.split(' ', 2) -%} + {% set method = check_parts[0] -%} + {% set path = check_parts[1] -%} + {% if check_parts|length > 2 -%} + {% set extra = check_parts[2].split('\r\n') -%} + {% set version = extra[0] -%} + {% set headers = extra[1:] -%} + {% endif -%} + http-check send meth {{ method }} uri {{ path }} ver {{ version }} + {%- for header in headers %} + http-check send hdr {{ header.replace(':\\ ', ': ') }} + {%- endfor %} + {%- endif %} {%- endif %} # http://gnuterrypratchett.com/ From 5266a6a16f3458632f6ad15c68537200ffa1f346 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 9 Jul 2024 14:41:40 -0500 Subject: [PATCH 3/9] feat(base): fix os codename --- salt/base/repo.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/base/repo.sls b/salt/base/repo.sls index fc8665e7..a646f554 100644 --- a/salt/base/repo.sls +++ b/salt/base/repo.sls @@ -1,4 +1,4 @@ -{% if grains["oscodename"] in ["jammy", "focal"] %} +{% if grains["oscodename"] in ["jammy", "noble"] %} psfkey: file.managed: - name: /etc/apt/keyrings/packagecloud.asc From 0cab3cf00dab420966f03c6dcc2ca84de09f1a1e Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 9 Jul 2024 15:23:26 -0500 Subject: [PATCH 4/9] feat(buildbot): fix missing file (?) --- salt/buildbot/init.sls | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/salt/buildbot/init.sls b/salt/buildbot/init.sls index 26292f66..b632ab08 100644 --- a/salt/buildbot/init.sls +++ b/salt/buildbot/init.sls @@ -49,6 +49,15 @@ buildbot-user: - user: buildbot-user - file: /srv +{# vagrant up fails due to this file not existing (see: https://github.com/python/psf-salt/pull/367#issuecomment-2218636563) #} +/srv/buildbot/master/twistd.log: + file.managed: + - user: buildbot + - group: buildbot + - mode: "0644" + - require: + - git: /srv/buildbot + update-master: cmd.run: - runas: buildbot From 91c9da6bc5f88584c63dfd3302e0345c50e5a0c9 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 9 Jul 2024 15:44:26 -0500 Subject: [PATCH 5/9] fix(buildbot): fix awry salt warning --- salt/buildbot/init.sls | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/buildbot/init.sls b/salt/buildbot/init.sls index b632ab08..f548c28a 100644 --- a/salt/buildbot/init.sls +++ b/salt/buildbot/init.sls @@ -55,6 +55,7 @@ buildbot-user: - user: buildbot - group: buildbot - mode: "0644" + - replace: False - require: - git: /srv/buildbot From bc8379a672ce11b8fc99afcf83fb8f8fadee7b6d Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 9 Jul 2024 16:06:25 -0500 Subject: [PATCH 6/9] feat(core): update to noble --- Vagrantfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 035e0803..5b7e75f4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,21 +1,20 @@ #!/usr/bin/env ruby - SERVERS = [ - "backup-server", + {:name => "backup-server", :codename => "noble"}, {:name => "bugs", :codename => "jammy", :ports => [8080]}, - "buildbot", + {:name => "buildbot", :codename => "noble"}, "cdn-logs", - {:name => "codespeed", :codename => "jammy"}, - {:name => "consul", :codename => "jammy"}, - "docs", - "downloads", + {:name => "codespeed", :codename => "noble"}, + {:name => "consul", :codename => "noble"}, + {:name => "docs", :codename => "noble"}, + {:name => "downloads", :codename => "noble"}, "hg", - {:name => "loadbalancer", :ports => [20000, 20001, 20002, 20003, 20004, 20005, 20010]}, - "mail", + {:name => "loadbalancer", :codename => "noble", :ports => [20000, 20001, 20002, 20003, 20004, 20005, 20010]}, + {:name => "mail", :codename => "noble"}, "moin", - "planet", - "pypy-web", + {:name => "planet", :codename => "noble"}, + {:name => "pypy-web", :codename => "noble"}, {:name => "pythontest", :codename => "noble"}, ] From f18bb2d56bc8e56c810461e0eff20d4f98b7dfe9 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Wed, 10 Jul 2024 09:22:25 -0500 Subject: [PATCH 7/9] feat(core): ensure back compat for sources --- salt/base/config/sources.list.jinja | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/salt/base/config/sources.list.jinja b/salt/base/config/sources.list.jinja index af292dc8..a0bb4474 100644 --- a/salt/base/config/sources.list.jinja +++ b/salt/base/config/sources.list.jinja @@ -4,13 +4,15 @@ {% set base_repo = "us.archive.ubuntu.com/ubuntu/" %} {% endif %} -{# TODO: Investigate, these seem to be handled doubly in sources.list.d as well as sources.list +{# 24.04 Noble is the first to use /etc/apt/sources.list.d/ubuntu.list instead of 'sources.list' #} +{% if grains["oscodename"] != "noble" %} ###### Ubuntu Main Repos -{#deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe#} -{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe#} +deb http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe +deb-src http://{{ base_repo }} {{ grains["oscodename"] }} main restricted universe ###### Ubuntu Update Repos -{#deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe#} -{#deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe#} -{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe#} -{#deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe#} +deb http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe +deb http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe +deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-security main restricted universe +deb-src http://{{ base_repo }} {{ grains["oscodename"] }}-updates main restricted universe +{% endif %} \ No newline at end of file From 3b375961bf1cc7b1e10b0fa3624d43840adde7ab Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Wed, 10 Jul 2024 12:24:16 -0500 Subject: [PATCH 8/9] feat(hg): update package, move to noble --- Vagrantfile | 2 +- salt/hg/init.sls | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 5b7e75f4..1a24ac07 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,7 @@ SERVERS = [ {:name => "consul", :codename => "noble"}, {:name => "docs", :codename => "noble"}, {:name => "downloads", :codename => "noble"}, - "hg", + {:name => "hg", :codename => "noble"}, {:name => "loadbalancer", :codename => "noble", :ports => [20000, 20001, 20002, 20003, 20004, 20005, 20010]}, {:name => "mail", :codename => "noble"}, "moin", diff --git a/salt/hg/init.sls b/salt/hg/init.sls index fe4cc1de..ad2e9b38 100644 --- a/salt/hg/init.sls +++ b/salt/hg/init.sls @@ -158,7 +158,7 @@ apache2: pkg.installed: - pkgs: - apache2 - - libapache2-mod-wsgi + - libapache2-mod-wsgi-py3 service.running: - enable: True - reload: True From 6fcd4e79fcec9a1e5497e5653e3874e1edad6b6c Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Thu, 11 Jul 2024 11:39:06 -0500 Subject: [PATCH 9/9] feat(hg): working hg on noble --- salt/hg/config/repos.conf | 6 +++--- salt/hg/files/hg/wsgi/python.wsgi | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/hg/config/repos.conf b/salt/hg/config/repos.conf index 52c4b52c..9ce46f3e 100644 --- a/salt/hg/config/repos.conf +++ b/salt/hg/config/repos.conf @@ -6,7 +6,7 @@ git = 1 showfunc = 1 [web] -llow_archive = gz, zip, bz2 +allow_archive = gz, zip, bz2 collapse = True contact = - descend = True @@ -15,5 +15,5 @@ logourl = https://hg.python.org pygments_style = default style = hgpythonorg -[extensions] -hgext.highlight = +; [extensions] +; hgext.highlight = diff --git a/salt/hg/files/hg/wsgi/python.wsgi b/salt/hg/files/hg/wsgi/python.wsgi index b1eb056d..5632caaf 100644 --- a/salt/hg/files/hg/wsgi/python.wsgi +++ b/salt/hg/files/hg/wsgi/python.wsgi @@ -3,4 +3,4 @@ from mercurial import encoding CONFIG = '/srv/hg/repos.conf' encoding.encoding = 'utf-8' -application = hgwebdir(CONFIG) +application = hgwebdir(CONFIG.encode())