Commit 5fab0456 authored by micah's avatar micah 💬
Browse files

git subrepo pull (merge) float

subrepo:
  subdir:   "float"
  merged:   "7406f7a"
upstream:
  origin:   "https://git.autistici.org/ai3/float.git"
  branch:   "master"
  commit:   "7406f7a"
git-subrepo:
  version:  "0.4.1"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "a04d8c2"
parent f736f380
Pipeline #66422 passed with stage
in 22 minutes and 1 second
......@@ -9,7 +9,7 @@ variables:
.base_test_template: &base_test
stage: test
image: registry.git.autistici.org/ai3/docker/float-runner:bullseye
image: registry.git.autistici.org/ai3/docker/float-runner:master
before_script:
- mkdir -p $BUILD_DIR
script:
......@@ -45,6 +45,7 @@ variables:
base_test:
<<: *base_test
variables:
CREATE_ENV_VARS: "-e config.float_debian_dist=buster"
TEST_DIR: "test/base.ref"
base_bullseye_test:
......@@ -57,6 +58,7 @@ base_bullseye_test:
full_test:
<<: *base_test
variables:
CREATE_ENV_VARS: "-e config.float_debian_dist=buster"
TEST_DIR: "test/full.ref"
full_bullseye_test:
......
......@@ -6,7 +6,7 @@
[subrepo]
remote = https://git.autistici.org/ai3/float.git
branch = master
commit = 65eba040f7c149ccbb5a37e8c63043f98bd25290
parent = 3c314fbff9e440eefadc138e63ae79951a7b9b97
commit = 7406f7aa6f959d89b1d71cad7e2202e5b39e1668
parent = f736f38035d8f838477a620715f165e62be75de6
cmdver = 0.4.1
method = merge
......@@ -1970,6 +1970,9 @@ Prometheus to find the service endpoints. This can only have the value
`metrics_path`: Path for metrics if different from the default of `/metrics`.
`labels`: An optional dictionary of key/value labels to set for this
target (they will be added to all metrics scraped from it).
### Traffic routing
Services can define *public* HTTP and TCP endpoints, that will be
......
......@@ -50,6 +50,8 @@ Vagrant.configure(2) do |config|
libvirt.cpus = 1
libvirt.memory = {{ ram }}
libvirt.random_hostname = true
libvirt.cpu_mode = 'host-passthrough'
libvirt.volume_cache = 'unsafe'
{% if libvirt.remote_host %}
libvirt.host = "{{ libvirt.remote_host }}"
libvirt.username = "{{ libvirt.remote_user }}"
......@@ -201,7 +203,7 @@ DEFAULT_VARS = {
'domain_public': [],
'testing': True,
'float_debian_dist': 'buster',
'float_debian_dist': 'bullseye',
'net_overlays': [{
'name': 'vpn0',
'network': '192.168.13.0/24',
......
......@@ -4,9 +4,8 @@
tasks:
- apt:
update_cache: yes
upgrade: yes
upgrade: "yes"
- apt:
autoclean: yes
autoremove: yes
serial:
- 1
......
......@@ -358,7 +358,7 @@ def _build_horizontal_upstreams_map(services):
upstreams = {}
for service_name, svc in services.items():
for ep in svc.get('horizontal_endpoints', []):
upstream_name = 'be_%s_%s_%s' % (name, ep['port'], service_name)
upstream_name = 'be_%s_%s_%s' % (ep['name'], ep['port'], service_name)
upstreams[upstream_name] = {
'name': upstream_name,
'service_name': service_name,
......
......@@ -11,7 +11,7 @@ metadb:
cert: "/etc/credentials/x509/backup-agent/client/cert.pem"
key: "/etc/credentials/x509/backup-agent/client/private_key.pem"
ca: "/etc/credentials/x509/backup-agent/ca.pem"
request_max_timeout: "20s"
request_max_timeout: "900s"
repository:
name: default
type: restic
......
# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]
# Default Storage Driver
driver = "overlay"
# Temporary storage location
runroot = "/var/run/containers/storage"
# Primary Read/Write location of container storage
graphroot = "/var/lib/containers/storage"
# Storage path for rootless users
#
# rootless_storage_path = "$HOME/.local/share/containers/storage"
[storage.options]
# Storage options to be passed to underlying storage drivers
# AdditionalImageStores is used to pass paths to additional Read/Only image stores
# Must be comma separated list.
additionalimagestores = [
]
# Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of
# a container, to the UIDs/GIDs as they should appear outside of the container,
# and the length of the range of UIDs/GIDs. Additional mapped sets can be
# listed and will be heeded by libraries, but there are limits to the number of
# mappings which the kernel will allow when you later attempt to run a
# container.
#
# remap-uids = 0:1668442479:65536
# remap-gids = 0:1668442479:65536
# Remap-User/Group is a user name which can be used to look up one or more UID/GID
# ranges in the /etc/subuid or /etc/subgid file. Mappings are set up starting
# with an in-container ID of 0 and then a host-level ID taken from the lowest
# range that matches the specified name, and using the length of that range.
# Additional ranges are then assigned, using the ranges which specify the
# lowest host-level IDs first, to the lowest not-yet-mapped in-container ID,
# until all of the entries have been used for maps.
#
# remap-user = "containers"
# remap-group = "containers"
# Root-auto-userns-user is a user name which can be used to look up one or more UID/GID
# ranges in the /etc/subuid and /etc/subgid file. These ranges will be partioned
# to containers configured to create automatically a user namespace. Containers
# configured to automatically create a user namespace can still overlap with containers
# having an explicit mapping set.
# This setting is ignored when running as rootless.
# root-auto-userns-user = "storage"
#
# Auto-userns-min-size is the minimum size for a user namespace created automatically.
# auto-userns-min-size=1024
#
# Auto-userns-max-size is the minimum size for a user namespace created automatically.
# auto-userns-max-size=65536
[storage.options.overlay]
# ignore_chown_errors can be set to allow a non privileged user running with
# a single UID within a user namespace to run containers. The user can pull
# and use any image even those with multiple uids. Note multiple UIDs will be
# squashed down to the default uid in the container. These images will have no
# separation between the users in the container. Only supported for the overlay
# and vfs drivers.
#ignore_chown_errors = false
# Path to an helper program to use for mounting the file system instead of mounting it
# directly.
#mount_program = "/usr/bin/fuse-overlayfs"
# mountopt specifies comma separated list of extra mount options
mountopt = "nodev"
# Set to skip a PRIVATE bind mount on the storage home directory.
# skip_mount_home = "false"
# Size is used to set a maximum size of the container image.
# size = ""
[storage.options.thinpool]
# Storage Options for thinpool
# autoextend_percent determines the amount by which pool needs to be
# grown. This is specified in terms of % of pool size. So a value of 20 means
# that when threshold is hit, pool will be grown by 20% of existing
# pool size.
# autoextend_percent = "20"
# autoextend_threshold determines the pool extension threshold in terms
# of percentage of pool size. For example, if threshold is 60, that means when
# pool is 60% full, threshold has been hit.
# autoextend_threshold = "80"
# basesize specifies the size to use when creating the base device, which
# limits the size of images and containers.
# basesize = "10G"
# blocksize specifies a custom blocksize to use for the thin pool.
# blocksize="64k"
# directlvm_device specifies a custom block storage device to use for the
# thin pool. Required if you setup devicemapper.
# directlvm_device = ""
# directlvm_device_force wipes device even if device already has a filesystem.
# directlvm_device_force = "True"
# fs specifies the filesystem type to use for the base device.
# fs="xfs"
# log_level sets the log level of devicemapper.
# 0: LogLevelSuppress 0 (Default)
# 2: LogLevelFatal
# 3: LogLevelErr
# 4: LogLevelWarn
# 5: LogLevelNotice
# 6: LogLevelInfo
# 7: LogLevelDebug
# log_level = "7"
# min_free_space specifies the min free space percent in a thin pool require for
# new device creation to succeed. Valid values are from 0% - 99%.
# Value 0% disables
# min_free_space = "10%"
# mkfsarg specifies extra mkfs arguments to be used when creating the base
# device.
# mkfsarg = ""
# Size is used to set a maximum size of the container image.
# size = ""
# use_deferred_removal marks devicemapper block device for deferred removal.
# If the thinpool is in use when the driver attempts to remove it, the driver
# tells the kernel to remove it as soon as possible. Note this does not free
# up the disk space, use deferred deletion to fully remove the thinpool.
# use_deferred_removal = "True"
# use_deferred_deletion marks thinpool device for deferred deletion.
# If the device is busy when the driver attempts to delete it, the driver
# will attempt to delete device every 30 seconds until successful.
# If the program using the driver exits, the driver will continue attempting
# to cleanup the next time the driver is used. Deferred deletion permanently
# deletes the device and all data stored in device will be lost.
# use_deferred_deletion = "True"
# xfs_nospace_max_retries specifies the maximum number of retries XFS should
# attempt to complete IO when ENOSPC (no space) error is returned by
# underlying storage device.
# xfs_nospace_max_retries = "0"
......@@ -2,6 +2,13 @@
- include_tasks: "podman_{{ podman_package_source }}.yml"
# If we've changed sources.list for podman, it is important
# that we run apt upgrade now.
- name: Apt upgrade
apt:
upgrade: 'yes'
when: "podman_sources_list.changed"
- name: Symlink podman to docker
file:
src: /usr/bin/podman
......@@ -14,6 +21,11 @@
src: containers.conf
dest: "/etc/containers/containers.conf"
- name: Install storage.conf
copy:
src: storage.conf
dest: "/etc/containers/storage.conf"
- file:
path: "/etc/containers/certs.d"
state: directory
......
......@@ -19,6 +19,7 @@
apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/deb.autistici.org.gpg] http://deb.autistici.org/urepo buster-podman/"
state: present
register: podman_sources_list
- name: Pin podman packages to our repository
copy:
......
......@@ -24,6 +24,7 @@
file:
path: "/etc/apt/preferences.d/99podman"
state: absent
register: podman_sources_list
- name: Install Podman packages
apt:
......
......@@ -18,6 +18,7 @@
apt_repository:
repo: "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /"
state: present
register: podman_sources_list
- name: Remove podman package pins
file:
......
......@@ -13,6 +13,13 @@
register: docker_systemd_run_script
loop: "{{ float_enabled_containers }}"
# TODO temporary only, to be removed once all symlinks are gone
- name: Cleanup Alias symlink
file:
dest: "/etc/systemd/system/{{ item.tag }}"
state: absent
loop: "{{ float_enabled_containers }}"
- name: Set up the systemd units
template:
src: systemd.j2
......
......@@ -8,7 +8,7 @@ Requires=docker.service
[Service]
ExecStart=/usr/lib/float/docker/run-{{ item.service }}-{{ item.container.name }}.sh
ExecStop=/usr/bin/{{ container_runtime }} stop --time 20 {{ item.service }}-{{ item.container.name }}
ExecStopPost=-/usr/bin/{{ container_runtime }} kill {{ item.service }}-{{ item.container.name }}
ExecStopPost=-/usr/bin/{{ container_runtime }} kill {{ item.service }}-{{ item.container.name }} 2>/dev/null
TimeoutStopSec=60
KillMode=control-group
Restart=always
......@@ -33,4 +33,3 @@ LimitNOFILE=65535
[Install]
WantedBy=multi-user.target {{ 'docker.service' if container_runtime == 'docker' else '' }}
Alias={{ item.service }}-{{ item.container.name }}
......@@ -30,3 +30,10 @@ disable_restricted_sysctl: false
# Conntrack table size.
nf_conntrack_max: 524288
# Customize /etc/motd.
motd: |2
┏━╸╻ ┏━┓┏━┓╺┳╸
** ┣╸ ┃ ┃ ┃┣━┫ ┃
╹ ┗━╸┗━┛╹ ╹ ╹ {{ inventory_hostname }}
.
,O,
,OOO,
'oooooOOOOOooooo'
`OOOOOOOOOOO`
`OOOOOOO` [ai3]
OOOO'OOOO
OOO' 'OOO
O' 'O
#!/bin/sh
id=$(lsb_release --short --id | tr A-Z a-z)
codename=$(lsb_release --short --codename)
version=0
if [ -e /etc/debian_version ]; then
version=$(cat /etc/debian_version)
fi
echo "node_lsb_release{id=\"${id}\",codename=\"${codename}\",version=\"${version}\"} 1"
exit 0
......@@ -49,18 +49,33 @@
template:
src: "sources.list.j2"
dest: "/etc/apt/sources.list"
register: sources_list
- name: Install package repositories
apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/deb.autistici.org.gpg] http://deb.autistici.org/urepo float/{{ float_debian_dist }}/"
state: present
repo: "deb [signed-by=/usr/share/keyrings/deb.autistici.org.gpg] http://deb.autistici.org/urepo float/{{ item }}/"
state: "{{ 'present' if item == float_debian_dist else 'absent' }}"
loop:
- stretch
- buster
- bullseye
- name: Run apt-get update
- name: Run apt update
apt:
update_cache: yes
cache_valid_time: '{{ 1800 if ansible_distribution_release == float_debian_dist else 1 }}'
changed_when: false
# If we're updating the distro, the first round of 'apt upgrade'
# (staggered, to handle normal software upgrades) did not do anything,
# but now we have to run 'apt full-upgrade' because we've just
# switched sources.list, and we're expecting the rest of the playbook
# to execute with the new float_debian_dist.
- name: Run apt full-upgrade
apt:
upgrade: "full"
when: "sources_list.changed"
# When testing, try to make dpkg faster by disabling fsync.
- name: Speed up dpkg
apt:
......
......@@ -2,7 +2,7 @@
- name: Install motd
copy:
src: motd
content: "\n{{ motd }}\n\n"
dest: /etc/motd
- name: Set locale to C
......
......@@ -4,7 +4,10 @@
#
# We store the git commit of HEAD from the source repository being
# pushed on the remote servers, and we check if the remote commit is
# older than the local one.
# older than the local one. There are many ways in which this check is
# incomplete: it won't detect changes in submodules, it won't detect
# any sort of local unpushed change, etc. But it will at least prevent
# foot-shooting if you're implementing proper operations.
#
# To skip the checks in an emergency, set the
# 'skip_rollback_protection' variable to 'true' in the Ansible
......@@ -12,11 +15,11 @@
# Detect remote commit (if present).
- stat:
path: /etc/ai3-ansible-commit
path: /etc/.float-ansible-commit
register: commit_guard_stat
- slurp:
src: /etc/ai3-ansible-commit
src: /etc/.float-ansible-commit
register: commit_guard_content
when: commit_guard_stat.stat.exists
- set_fact:
......@@ -28,7 +31,7 @@
# custom message.
- local_action:
module: shell
_raw_params: git merge-base --is-ancestor {{ remote_git_revision }} {{ git_revision }}
_raw_params: git merge-base --is-ancestor {{ remote_git_revision | trim }} {{ git_revision }}
chdir: "{{ inventory_dir }}"
when: commit_guard_stat.stat.exists
become: false
......@@ -38,9 +41,15 @@
check_mode: no
- fail:
msg: "You are pushing an older version of the sources. Run 'git pull' and try again?"
msg: |
You seem to be pushing an older version of the sources.
This could be because your local repository is out of date (run
"git pull" and try again?). If the rollback is intended, or if
you really think the check is wrong for some reason, re-run
float with "-e rollback=true".
when: "commit_guard_stat.stat.exists and commit_compare.rc != 0 and not skip_rollback_protection"
- copy:
dest: /etc/ai3-ansible-commit
content: "{{ git_revision }}"
dest: /etc/.float-ansible-commit
content: "{{ git_revision }}\n"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment