diff --git a/.cirrus.yml b/.cirrus.yml index ffbb23e4..fe0cc108 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,17 +8,35 @@ low_scale_task: image: family/ubuntu-2210-amd64 platform: linux memory: 8G - disk: 20 + disk: 40 env: - DEPENDENCIES: git ansible podman podman-docker + DEPENDENCIES: git ansible podman FEDORA_DEP: ansible-collection-ansible-posix ansible-collection-ansible-utils + CIRRUS_WORKING_DIR: /root/ovn-heater PHYS_DEPLOYMENT: ${CIRRUS_WORKING_DIR}/physical-deployments/ci.yml runtime_cache: folder: runtime-cache + # Make sure we use all the disk available to us. Similar to the steps + # described at: + # https://cloud.google.com/compute/docs/disks/resize-persistent-disk + # + # Use "findmnt -n -o SOURCE /" and parse outputs of the form: + # /dev/ + # OR + # /dev/[text] + resize_disk_script: + - d=$(findmnt -n -o SOURCE / | cut -f 1 -d '[' | cut -f 3 -d '/' | grep -oE '[a-zA-Z]+') + - p=$(findmnt -n -o SOURCE / | cut -f 1 -d '[' | cut -f 3 -d '/' | grep -oE '[0-9]+') + - t=$(df --output=fstype /root | grep -v Type) + - growpart /dev/$d $p || true + - '[ "$t" = "ext4" ] && resize2fs /dev/$d$p || true' + - '[ "$t" = "xfs" ] && xfs_growfs -d /root || true' + - '[ "$t" = "btrfs" ] && btrfs filesystem resize max /root || true' + configure_ssh_script: - mkdir -p /root/.ssh/ - ssh-keygen -t rsa -N '' -q -f /root/.ssh/id_rsa @@ -37,8 +55,8 @@ low_scale_task: unpack_caches_script: - mkdir -p runtime runtime-cache - - docker load -i runtime-cache/ovn-multi-node.tar || true - tar -xzf runtime-cache/runtime.tar.gz || true + - podman load -i runtime/ovn-fake-multinode/ovn-multi-node-image.tar || true install_script: - 'sed -i "s//$(hostname)/g" ${PHYS_DEPLOYMENT}' @@ -46,7 +64,6 @@ low_scale_task: pack_caches_script: - rm -rf runtime-cache/* - - docker save -o runtime-cache/ovn-multi-node.tar ovn/ovn-multi-node:latest - tar -czf runtime-cache/runtime.tar.gz runtime upload_caches: diff --git a/README.md b/README.md index 93b069c6..97519af5 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ a simulated OVN cluster deployed with [ovn-fake-multinode](https://github.com/ovn-org/ovn-fake-multinode). **NOTE**: This script is designed to be used on test machines only. It -performs disruptive changes to the machines it is run on (e.g., create -insecure docker registries, cleanup existing docker containers). +performs disruptive changes to the machines it is run on (e.g.,cleanup +existing containers). # Prerequisites @@ -21,9 +21,6 @@ insecure docker registries, cleanup existing docker containers). - provisions all other `OVN` nodes with the required software packages and with the correct version of `ovn-fake-multinode` to run simulated/fake `OVN` chassis. - - runs a docker registry where the `ovn-fake-multinode` (i.e., - `ovn/ovn-multi-node`) and `ovn-tester` images are pushed and from which all - other `OVN` nodes will pull the image. * TESTER: One machine to run the `ovn-tester` container which runs the python ovn-tester code. Like the ORCHESTRATOR, the TESTER also needs to be able to @@ -63,7 +60,7 @@ Therefore, the values need to be resolvable by both of these entities and need to resolve to the same host. `localhost` will not work since this does not resolve to a unique host. -## Minimal requirements on the ORCHESTRATOR node (tested on Fedora 32) +## Minimal requirements on the ORCHESTRATOR node (tested on Fedora 38 and Ubuntu 22.10) ### Install required packages: @@ -78,46 +75,6 @@ dnf install -y git ansible \ sudo apt -y install ansible ``` -## Minimal requirements on the TESTER node (tested on Fedora 36) - -### Make docker work with nested containers (disable cgroup hierarchy): - -#### RPM-based Fedora 32+ -``` -dnf install -y grubby -grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" -reboot -``` - -#### DEB-based -Edit /etc/default/grub and add `systemd.unified_cgroup_hierarchy=0` at the -end of the `GRUB_CMDLINE_LINUX_DEFAULT` variable. - -``` -sudo update-grub -sudo reboot -```` - -## Minimal requirements on the OVN-CENTRAL and OVN-WORKER-NODEs - -### Make docker work with nested containers (disable cgroup hierarchy): - -#### RPM-based Fedora 32+ -``` -dnf install -y grubby -grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0" -reboot -``` - -#### DEB-based -Edit /etc/default/grub and add `systemd.unified_cgroup_hierarchy=0` at the -end of the `GRUB_CMDLINE_LINUX_DEFAULT` variable. - -``` -sudo update-grub -sudo reboot -```` - # Installation ## Ensure all nodes can be accessed passwordless via SSH @@ -144,9 +101,6 @@ A sample file written for the deployment described above is available at `physical-deployments/physical-deployment.yml`. The file should contain the following mandatory sections and fields: -- `registry-node`: the hostname (or IP) of the node that will store the - docker private registry. In usual cases this is should be the ORCHESTRATOR - machine. - `internal-iface`: the name of the Ethernet interface used by the underlay (DB and tunnel traffic). This can be overridden per node if needed. - `tester-node`: @@ -284,7 +238,7 @@ cd ~/ovn-heater This executes `` on the physical deployment (specifically on the `ovn-tester` container on the TESTER). Current scenarios also cleanup the -environment, i.e., remove all docker containers from all physical nodes. +environment, i.e., remove all containers from all physical nodes. **NOTE**: If the environment needs to be explictly cleaned up, we can also execute before running the scenario: @@ -301,7 +255,7 @@ consist of: stored. - html reports - a copy of the `hosts` ansible inventory used for the test. -- OVN docker container logs (i.e., ovn-northd, ovn-controller, ovs-vswitchd, +- OVN container logs (i.e., ovn-northd, ovn-controller, ovs-vswitchd, ovsdb-server logs). - physical nodes journal files. - perf sampling results if enabled diff --git a/do.sh b/do.sh index 00e2f69d..1a5ba5fa 100755 --- a/do.sh +++ b/do.sh @@ -16,15 +16,11 @@ clustered_db=${CLUSTERED_DB:-True} ovn_fmn_utils=${topdir}/ovn-fake-multinode-utils ovn_fmn_playbooks=${ovn_fmn_utils}/playbooks ovn_fmn_generate=${ovn_fmn_utils}/generate-hosts.py -ovn_fmn_docker=${ovn_fmn_utils}/generate-docker-cfg.py -ovn_fmn_podman=${ovn_fmn_utils}/generate-podman-cfg.py ovn_fmn_get=${ovn_fmn_utils}/get-config-value.py ovn_fmn_ip=${rundir}/ovn-fake-multinode/ip_gen.py ovn_fmn_translate=${ovn_fmn_utils}/translate_yaml.py hosts_file=${rundir}/hosts installer_log_file=${rundir}/installer-log -docker_daemon_file=${rundir}/docker-daemon.json -podman_registry_file=${rundir}/registries.conf log_collector_file=${rundir}/log-collector.sh log_perf_file=${rundir}/perf.sh process_monitor_file=${rundir}/process-monitor.py @@ -104,8 +100,6 @@ function generate() { mkdir -p ${rundir} PYTHONPATH=${topdir}/utils ${ovn_fmn_generate} ${phys_deployment} ${rundir} ${ovn_fmn_repo} ${ovn_fmn_branch} > ${hosts_file} - PYTHONPATH=${topdir}/utils ${ovn_fmn_docker} ${phys_deployment} > ${docker_daemon_file} - PYTHONPATH=${topdir}/utils ${ovn_fmn_podman} ${phys_deployment} > ${podman_registry_file} cp ${ovn_fmn_utils}/process-monitor.py ${process_monitor_file} cp ${ovn_fmn_utils}/scripts/log-collector.sh ${log_collector_file} cp ${ovn_fmn_utils}/scripts/perf.sh ${log_perf_file} @@ -115,7 +109,7 @@ function install_deps_local_rpm() { echo "-- Installing local dependencies" yum install redhat-lsb-core datamash \ python3-pip python3-netaddr python3 python3-devel \ - podman podman-docker \ + podman \ --skip-broken -y [ -e /usr/bin/pip ] || ln -sf /usr/bin/pip3 /usr/bin/pip @@ -123,8 +117,8 @@ function install_deps_local_rpm() { function install_deps_local_deb() { echo "-- Installing local dependencies" - apt -y install datamash podman podman-docker python3-pip \ - python3-netaddr python3 python3-all-dev + apt -y install datamash podman python3-pip \ + python3-netaddr python3 python3-all-dev python3-venv } function install_deps_remote() { @@ -133,28 +127,6 @@ function install_deps_remote() { -i ${hosts_file} } -function run_registry() { - containers=$(docker ps --all --filter='name=(ovn|registry)' \ - | grep -v "CONTAINER ID" | awk '{print $1}' || true) - for container_name in $containers - do - docker stop $container_name - docker rm $container_name - done - [ -d /var/lib/registry ] || mkdir /var/lib/registry -p - docker run --privileged -d --name registry -p 5000:5000 \ - -v /var/lib/registry:/var/lib/registry --restart=always docker.io/library/registry:2 - - # This is requried on the orchestrator for local image build/push to work - cp /etc/containers/registries.conf /etc/containers/registries.conf.bak - cat > /etc/containers/registries.conf << EOF -[registries.insecure] -registries = ['localhost:5000'] -[registries.block] -registries = [] -EOF -} - function install_venv() { pushd ${rundir} if [ ! -f ${ovn_heater_venv}/bin/activate ]; then @@ -170,19 +142,6 @@ function install_venv() { popd } -function configure_docker() { - echo "-- Configuring local registry on tester nodes" - if which podman - then - echo "-- Configuring podman local registry on all nodes" - ansible-playbook ${ovn_fmn_playbooks}/configure-podman-registry.yml -i ${hosts_file} - else - echo "-- Configuring docker local registry on all nodes" - ansible-playbook ${ovn_fmn_playbooks}/configure-docker-registry.yml -i ${hosts_file} - fi - -} - function clone_component() { local comp_name=$1 local comp_repo=$2 @@ -277,7 +236,7 @@ function install_ovn_fake_multinode() { [ -n "$RPM_OVN_HOST" ] && wget $RPM_OVN_HOST fi - docker images | grep -q 'ovn/ovn-multi-node' || rebuild_needed=1 + podman images | grep -q 'ovn/ovn-multi-node' || rebuild_needed=1 if [ ${rebuild_needed} -eq 1 ]; then if [ -z "${OS_IMAGE_OVERRIDE}" ]; then @@ -295,23 +254,22 @@ function install_ovn_fake_multinode() { fi # Build images locally. - OS_IMAGE=$os_image OVS_SRC_PATH=${rundir}/ovs OVN_SRC_PATH=${rundir}/ovn EXTRA_OPTIMIZE=${EXTRA_OPTIMIZE} USE_OVSDB_ETCD=${USE_OVSDB_ETCD} ./ovn_cluster.sh build + OS_IMAGE=$os_image OVS_SRC_PATH=${rundir}/ovs OVN_SRC_PATH=${rundir}/ovn \ + EXTRA_OPTIMIZE=${EXTRA_OPTIMIZE} USE_OVSDB_ETCD=${USE_OVSDB_ETCD} \ + RUNC_CMD=podman ./ovn_cluster.sh build fi - # Tag and push image - docker tag ovn/ovn-multi-node localhost:5000/ovn/ovn-multi-node - docker push localhost:5000/ovn/ovn-multi-node + popd } function install_ovn_tester() { ssh_key=$(${ovn_fmn_get} ${phys_deployment} tester-node ssh_key) - # We need to copy the files into a known directory within the Docker - # context directory. Otherwise, Docker can't find the files we reference. + # We need to copy the files into a known directory within the container + # runtime context directory. Otherwise, podman can't find the files we + # reference. cp ${ssh_key} . ssh_key_file=${rundir_name}/$(basename ${ssh_key}) - docker build -t ovn/ovn-tester --build-arg SSH_KEY=${ssh_key_file} -f ${topdir}/Dockerfile ${topdir} - docker tag ovn/ovn-tester localhost:5000/ovn/ovn-tester - docker push localhost:5000/ovn/ovn-tester + podman build -t ovn/ovn-tester --build-arg SSH_KEY=${ssh_key_file} -f ${topdir}/Dockerfile ${topdir} } # Prepare OVS bridges and cleanup containers. @@ -320,13 +278,24 @@ function init_ovn_fake_multinode() { ansible-playbook ${ovn_fmn_playbooks}/deploy-minimal.yml -i ${hosts_file} } -# Pull image on all nodes +# Pull image on all nodes. function pull_ovn_fake_multinode() { - # Pull image on all nodes + echo "-- Saving the ovn/ovn-multi-node image and pulling it on all nodes." + + pushd ${rundir}/ovn-fake-multinode + rm -f ovn-multi-node-image.tar + podman save --format oci-archive -o ovn-multi-node-image.tar \ + ovn/ovn-multi-node:latest ansible-playbook ${ovn_fmn_playbooks}/pull-fake-multinode.yml -i ${hosts_file} + popd } function pull_ovn_tester() { + echo "-- Saving the ovn/ovn-tester image and pulling it on the tester." + + rm -f ovn-tester-image.tar + podman save --format oci-archive -o ovn-tester-image.tar \ + ovn/ovn-tester:latest ansible-playbook ${ovn_fmn_playbooks}/pull-ovn-tester.yml -i ${hosts_file} } @@ -342,9 +311,7 @@ function install() { die_distro fi install_deps_remote - run_registry install_venv - configure_docker install_ovn_fake_multinode init_ovn_fake_multinode pull_ovn_fake_multinode @@ -498,7 +465,7 @@ function run_test() { fi tester_host=$(${ovn_fmn_get} ${phys_deployment} tester-node name) - if ! ssh root@${tester_host} docker exec \ + if ! ssh root@${tester_host} podman exec \ ovn-tester python3 -u /ovn-tester/ovn_tester.py \ /physical-deployment.yml /test-scenario.yml ; then diff --git a/ovn-fake-multinode-utils/generate-docker-cfg.py b/ovn-fake-multinode-utils/generate-docker-cfg.py deleted file mode 100755 index 99bb051b..00000000 --- a/ovn-fake-multinode-utils/generate-docker-cfg.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python3 - -from __future__ import print_function - -import yaml -import sys - - -def usage(name): - print( - """ -{} DEPLOYMENT -where DEPLOYMENT is the YAML file defining the deployment. -""".format( - name - ), - file=sys.stderr, - ) - - -def generate(input_file): - with open(input_file, 'r') as yaml_file: - config = yaml.safe_load(yaml_file) - - print( - ''' -{{ - "insecure-registries" : ["{}:5000"] -}} - '''.format( - config['registry-node'] - ) - ) - - -def main(): - if len(sys.argv) != 2: - usage(sys.argv[0]) - sys.exit(1) - - generate(sys.argv[1]) - - -if __name__ == "__main__": - main() diff --git a/ovn-fake-multinode-utils/generate-hosts.py b/ovn-fake-multinode-utils/generate-hosts.py index 251c14df..dd9cee27 100755 --- a/ovn-fake-multinode-utils/generate-hosts.py +++ b/ovn-fake-multinode-utils/generate-hosts.py @@ -63,7 +63,6 @@ def generate(input_file, target, repo, branch): config = yaml.safe_load(yaml_file) user = config.get('user', 'root') prefix = config.get('prefix', 'ovn-scale') - registry_node = config['registry-node'] central_config = config['central-node'] tester_config = config['tester-node'] internal_iface = config['internal-iface'] @@ -84,7 +83,6 @@ def generate(input_file, target, repo, branch): print('ovn_fake_multinode_path=' + target + '/ovn-fake-multinode') print('ovn_fake_multinode_repo=' + repo) print('ovn_fake_multinode_branch=' + branch) - print('registry_node=' + registry_node) print('rundir=' + target) diff --git a/ovn-fake-multinode-utils/generate-podman-cfg.py b/ovn-fake-multinode-utils/generate-podman-cfg.py deleted file mode 100755 index caa53991..00000000 --- a/ovn-fake-multinode-utils/generate-podman-cfg.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python3 - -from __future__ import print_function - -import yaml -import sys - - -def usage(name): - print( - """ -{} DEPLOYMENT -where DEPLOYMENT is the YAML file defining the deployment. -""".format( - name - ), - file=sys.stderr, - ) - - -def generate(input_file): - with open(input_file, 'r') as yaml_file: - config = yaml.safe_load(yaml_file) - - print( - ''' -[registries.search] -registries = ['registry.access.redhat.com', 'registry.redhat.io'] -[registries.block] -registries = [] - ''' - ) - print( - ''' -[registries.insecure] -registries = ['{}:5000','localhost:5000'] - '''.format( - config['registry-node'] - ) - ) - - -def main(): - if len(sys.argv) != 2: - usage(sys.argv[0]) - sys.exit(1) - - generate(sys.argv[1]) - - -if __name__ == "__main__": - main() diff --git a/ovn-fake-multinode-utils/playbooks/bringup-cluster.yml b/ovn-fake-multinode-utils/playbooks/bringup-cluster.yml index c371cc49..2831c33a 100644 --- a/ovn-fake-multinode-utils/playbooks/bringup-cluster.yml +++ b/ovn-fake-multinode-utils/playbooks/bringup-cluster.yml @@ -3,10 +3,12 @@ tasks: - name: Start tester container ansible.builtin.shell: | - docker run -dt --name=ovn-tester --hostname=ovn-tester \ + podman run -dt --name=ovn-tester --hostname=ovn-tester \ --privileged ovn/ovn-tester - name: Add tester container interfaces to OVS bridges + environment: + RUNC_CMD: podman ansible.builtin.shell: | ./ovs-docker add-port br-ovn eth1 ovn-tester \ --ipaddress={{ node_net|ansible.utils.ipaddr('1') }} @@ -32,6 +34,7 @@ OVN_DP_TYPE: '{{ datapath_type }}' OVN_MONITOR_ALL: '{{ monitor_all }}' RELAY_COUNT: '{{ n_relays }}' + RUNC_CMD: podman ansible.builtin.shell: | ./ovn_cluster.sh start args: @@ -55,6 +58,7 @@ OVN_DP_TYPE: '{{ datapath_type }}' OVN_MONITOR_ALL: '{{ monitor_all }}' RELAY_COUNT: '{{ n_relays }}' + RUNC_CMD: podman ansible.builtin.shell: | ./ovn_cluster.sh add-chassis \ {{ node_name }}-{{ item|int }} tcp:0.0.0.1:6642 @@ -69,13 +73,13 @@ tasks: - name: Enumerate containers ansible.builtin.shell: | - docker ps --filter='name=ovn-' --noheading --format={{ '{{.Names}}' }} + podman ps --filter='name=ovn-' --noheading --format={{ '{{.Names}}' }} register: containers - name: Copy and start the process monitoring script in containers ansible.builtin.shell: | - docker cp /tmp/process-monitor.py {{ item }}:/tmp/ - docker exec {{ item }} bash -c " + podman cp /tmp/process-monitor.py {{ item }}:/tmp/ + podman exec {{ item }} bash -c " nohup python3 /tmp/process-monitor.py \\ -s {{ item }} \\ -o /var/log/process-stats.json \\ @@ -89,7 +93,7 @@ tasks: - name: Enumerate containers ansible.builtin.shell: | - docker ps --filter='name={{ node_name }}-' \ + podman ps --filter='name={{ node_name }}-' \ --noheading --format={{ '{{.Names}}' }} register: containers @@ -97,7 +101,7 @@ when: enable_ssl == "yes" ansible.builtin.shell: | # SSL files are installed by ovn-fake-multinode in these locations. - docker exec {{ item }} bash -c " + podman exec {{ item }} bash -c " ovs-vsctl --id=@foo create SSL \\ private_key=/opt/ovn/ovn-privkey.pem \\ certificate=/opt/ovn/ovn-cert.pem \\ @@ -109,7 +113,7 @@ - name: Add secure OVSDB remote when: enable_ssl == "yes" ansible.builtin.shell: | - docker exec {{ item }} bash -c " + podman exec {{ item }} bash -c " ovs-appctl -t ovsdb-server ovsdb-server/add-remote pssl:6640 " loop: "{{ containers.stdout_lines }}" @@ -117,7 +121,7 @@ - name: Add insecure OVSDB remote when: enable_ssl == "no" ansible.builtin.shell: | - docker exec {{ item }} bash -c " + podman exec {{ item }} bash -c " ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6640 " loop: "{{ containers.stdout_lines }}" diff --git a/ovn-fake-multinode-utils/playbooks/configure-docker-registry.yml b/ovn-fake-multinode-utils/playbooks/configure-docker-registry.yml deleted file mode 100644 index 2b7b23ee..00000000 --- a/ovn-fake-multinode-utils/playbooks/configure-docker-registry.yml +++ /dev/null @@ -1,17 +0,0 @@ -- name: Configure docker - hosts: all - tasks: - - name: Start docker - systemd: - name: docker - state: started - - - name: Configure insecure docker registry - copy: - src: "{{ rundir }}/docker-daemon.json" - dest: /etc/docker/daemon.json - - - name: Restart docker - systemd: - name: docker - state: restarted diff --git a/ovn-fake-multinode-utils/playbooks/configure-podman-registry.yml b/ovn-fake-multinode-utils/playbooks/configure-podman-registry.yml deleted file mode 100644 index 713c494c..00000000 --- a/ovn-fake-multinode-utils/playbooks/configure-podman-registry.yml +++ /dev/null @@ -1,14 +0,0 @@ -- name: Configure docker - hosts: all - tasks: - - - name: backup registries.conf - copy: - src: /etc/containers/registries.conf - dest: /etc/containers/registries.conf.bak - remote_src: yes - - - name: Configure insecure podman registry - copy: - src: "{{ rundir }}/registries.conf" - dest: /etc/containers/registries.conf diff --git a/ovn-fake-multinode-utils/playbooks/configure-tester.yml b/ovn-fake-multinode-utils/playbooks/configure-tester.yml index 25e26a83..253b6765 100644 --- a/ovn-fake-multinode-utils/playbooks/configure-tester.yml +++ b/ovn-fake-multinode-utils/playbooks/configure-tester.yml @@ -8,7 +8,7 @@ - name: Copy physical deployment file to tester container ansible.builtin.shell: | - docker cp /tmp/physical-deployment.yml ovn-tester:/physical-deployment.yml + podman cp /tmp/physical-deployment.yml ovn-tester:/physical-deployment.yml - name: Copy test file to tester host ansible.builtin.copy: @@ -17,4 +17,4 @@ - name: Copy test file to the tester container ansible.builtin.shell: | - docker cp /tmp/test-scenario.yml ovn-tester:/test-scenario.yml + podman cp /tmp/test-scenario.yml ovn-tester:/test-scenario.yml diff --git a/ovn-fake-multinode-utils/playbooks/deploy-minimal.yml b/ovn-fake-multinode-utils/playbooks/deploy-minimal.yml index a6734544..0cb7c4c2 100644 --- a/ovn-fake-multinode-utils/playbooks/deploy-minimal.yml +++ b/ovn-fake-multinode-utils/playbooks/deploy-minimal.yml @@ -1,5 +1,7 @@ - name: Prepare the setup hosts: all + environment: + RUNC_CMD: podman tasks: - name: Start openvswitch ansible.builtin.systemd: @@ -13,24 +15,24 @@ state: started when: ansible_os_family == "Debian" - - name: Delete old docker volumes + - name: Delete old container volumes shell: | - docker volume prune -f + podman volume prune -f - name: Stop tester container if running when: ovn_tester is defined ignore_errors: yes shell: | - docker rm -f --volumes ovn-tester + podman rm -f --volumes ovn-tester - - name: Delete old docker containers if any + - name: Delete old containers if any shell: | set -e cd {{ ovn_fake_multinode_target_path }}/ovn-fake-multinode export CHASSIS_PREFIX={{ node_name }} export CHASSIS_COUNT=100 ./ovn_cluster.sh stop - docker system prune -f + podman system prune -f - name: Ensure number of inotify instances for containers shell: | diff --git a/ovn-fake-multinode-utils/playbooks/install-dependencies.yml b/ovn-fake-multinode-utils/playbooks/install-dependencies.yml index 702bdd18..75986188 100644 --- a/ovn-fake-multinode-utils/playbooks/install-dependencies.yml +++ b/ovn-fake-multinode-utils/playbooks/install-dependencies.yml @@ -38,5 +38,4 @@ ansible.builtin.package: name: - podman - - podman-docker state: present diff --git a/ovn-fake-multinode-utils/playbooks/pull-fake-multinode.yml b/ovn-fake-multinode-utils/playbooks/pull-fake-multinode.yml index c6e438ad..ebcc0ab4 100644 --- a/ovn-fake-multinode-utils/playbooks/pull-fake-multinode.yml +++ b/ovn-fake-multinode-utils/playbooks/pull-fake-multinode.yml @@ -1,8 +1,11 @@ - name: Install ovn-fake-multinode hosts: all tasks: - - name: Pull latest containers - shell: | - set -e - docker pull {{ registry_node }}:5000/ovn/ovn-multi-node - docker tag {{ registry_node }}:5000/ovn/ovn-multi-node ovn/ovn-multi-node + - name: Copy ovn-multi-node image + ansible.posix.synchronize: + src: "{{ rundir }}/ovn-fake-multinode/ovn-multi-node-image.tar" + dest: "{{ ovn_fake_multinode_path }}/ovn-multi-node-image.tar" + + - name: Load latest containers + ansible.builtin.shell: | + podman load -i {{ ovn_fake_multinode_path }}/ovn-multi-node-image.tar diff --git a/ovn-fake-multinode-utils/playbooks/pull-ovn-tester.yml b/ovn-fake-multinode-utils/playbooks/pull-ovn-tester.yml index 6912c03e..e9368e4b 100644 --- a/ovn-fake-multinode-utils/playbooks/pull-ovn-tester.yml +++ b/ovn-fake-multinode-utils/playbooks/pull-ovn-tester.yml @@ -1,8 +1,11 @@ - name: Install ovn-tester hosts: tester_hosts tasks: - - name: Pull latest containers - shell: | - set -e - docker pull {{ registry_node }}:5000/ovn/ovn-tester - docker tag {{ registry_node }}:5000/ovn/ovn-tester ovn/ovn-tester + - name: Copy ovn-tester image + ansible.posix.synchronize: + src: "{{ rundir }}/ovn-tester-image.tar" + dest: "{{ ovn_fake_multinode_target_path }}/ovn-tester-image.tar" + + - name: Load latest containers + ansible.builtin.shell: | + podman load -i {{ ovn_fake_multinode_target_path }}/ovn-tester-image.tar diff --git a/ovn-fake-multinode-utils/scripts/log-collector.sh b/ovn-fake-multinode-utils/scripts/log-collector.sh index e2f47100..9d0c788e 100755 --- a/ovn-fake-multinode-utils/scripts/log-collector.sh +++ b/ovn-fake-multinode-utils/scripts/log-collector.sh @@ -5,52 +5,52 @@ node_name=$2 mkdir /tmp/${host} pushd /tmp -for c in $(docker ps --format "{{.Names}}" --filter "name=${node_name}"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=${node_name}"); do mkdir ${host}/$c - docker exec $c ps -aux > ${host}/$c/ps - docker exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' - docker cp $c:/var/log/ovn/ovn-controller.log ${host}/$c/ - docker cp $c:/var/log/openvswitch/ovs-vswitchd.log ${host}/$c/ - docker cp $c:/var/log/openvswitch/ovsdb-server.log ${host}/$c/ - docker cp $c:/etc/openvswitch/conf.db ${host}/$c/ - docker cp $c:/var/log/process-stats.json ${host}/$c/ + podman exec $c ps -aux > ${host}/$c/ps + podman exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' + podman cp $c:/var/log/ovn/ovn-controller.log ${host}/$c/ + podman cp $c:/var/log/openvswitch/ovs-vswitchd.log ${host}/$c/ + podman cp $c:/var/log/openvswitch/ovsdb-server.log ${host}/$c/ + podman cp $c:/etc/openvswitch/conf.db ${host}/$c/ + podman cp $c:/var/log/process-stats.json ${host}/$c/ done -for c in $(docker ps --format "{{.Names}}" --filter "name=ovn-central"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=ovn-central"); do mkdir ${host}/$c - docker exec $c ps -aux > ${host}/$c/ps-before-compaction - docker exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/compact - docker exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/compact - docker exec $c ps -aux > ${host}/$c/ps-after-compaction - docker exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' - docker cp $c:/var/log/ovn/ovn-controller.log ${host}/$c/ - docker cp $c:/var/log/ovn/ovn-northd.log ${host}/$c/ - docker cp $c:/var/log/ovn/ovsdb-server-nb.log ${host}/$c/ - docker cp $c:/var/log/ovn/ovsdb-server-sb.log ${host}/$c/ - docker cp $c:/etc/ovn/ovnnb_db.db ${host}/$c/ - docker cp $c:/etc/ovn/ovnsb_db.db ${host}/$c/ - docker cp $c:/var/log/openvswitch/ovs-vswitchd.log ${host}/$c/ - docker cp $c:/var/log/openvswitch/ovsdb-server.log ${host}/$c/ - docker cp $c:/var/log/openvswitch/ovn-nbctl.log ${host}/$c/ - docker cp $c:/var/log/process-stats.json ${host}/$c/ + podman exec $c ps -aux > ${host}/$c/ps-before-compaction + podman exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/compact + podman exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/compact + podman exec $c ps -aux > ${host}/$c/ps-after-compaction + podman exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' + podman cp $c:/var/log/ovn/ovn-controller.log ${host}/$c/ + podman cp $c:/var/log/ovn/ovn-northd.log ${host}/$c/ + podman cp $c:/var/log/ovn/ovsdb-server-nb.log ${host}/$c/ + podman cp $c:/var/log/ovn/ovsdb-server-sb.log ${host}/$c/ + podman cp $c:/etc/ovn/ovnnb_db.db ${host}/$c/ + podman cp $c:/etc/ovn/ovnsb_db.db ${host}/$c/ + podman cp $c:/var/log/openvswitch/ovs-vswitchd.log ${host}/$c/ + podman cp $c:/var/log/openvswitch/ovsdb-server.log ${host}/$c/ + podman cp $c:/var/log/openvswitch/ovn-nbctl.log ${host}/$c/ + podman cp $c:/var/log/process-stats.json ${host}/$c/ done -for c in $(docker ps --format "{{.Names}}" --filter "name=ovn-relay"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=ovn-relay"); do mkdir ${host}/$c - docker exec $c ps -aux > ${host}/$c/ps-before-compaction - docker exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/compact - docker exec $c ps -aux > ${host}/$c/ps-after-compaction - docker exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' - docker cp $c:/var/log/ovn/ovsdb-server-sb.log ${host}/$c/ - docker cp $c:/var/log/process-stats.json ${host}/$c/ + podman exec $c ps -aux > ${host}/$c/ps-before-compaction + podman exec $c ovs-appctl --timeout=30 -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/compact + podman exec $c ps -aux > ${host}/$c/ps-after-compaction + podman exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' + podman cp $c:/var/log/ovn/ovsdb-server-sb.log ${host}/$c/ + podman cp $c:/var/log/process-stats.json ${host}/$c/ done -for c in $(docker ps --format "{{.Names}}" --filter "name=ovn-tester"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=ovn-tester"); do mkdir ${host}/$c - docker exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' - docker exec $c bash -c "mkdir -p /htmls; cp -f /*.html /htmls" - docker cp $c:/htmls/. ${host}/$c/ - docker cp $c:/var/log/process-stats.json ${host}/$c/ + podman exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5' + podman exec $c bash -c "mkdir -p /htmls; cp -f /*.html /htmls" + podman cp $c:/htmls/. ${host}/$c/ + podman cp $c:/var/log/process-stats.json ${host}/$c/ done journalctl --since "8 hours ago" -a > ${host}/messages diff --git a/ovn-fake-multinode-utils/scripts/perf.sh b/ovn-fake-multinode-utils/scripts/perf.sh index 5a100401..b1d390dd 100755 --- a/ovn-fake-multinode-utils/scripts/perf.sh +++ b/ovn-fake-multinode-utils/scripts/perf.sh @@ -6,20 +6,20 @@ node_name=$2 function collect_flamegraph_data() { c=$1 mkdir ${host}-perf/$c - pid=$(docker exec $c /bin/sh -c "pidof -s perf") - docker exec $c /bin/sh -c "kill $pid && tail --pid=$pid -f /dev/null" - docker exec $c /bin/sh -c "perf script report flamegraph -o /tmp/ovn-flamegraph.html" - docker cp $c:/tmp/ovn-flamegraph.html ${host}-perf/$c/ + pid=$(podman exec $c /bin/sh -c "pidof -s perf") + podman exec $c /bin/sh -c "kill $pid && tail --pid=$pid -f /dev/null" + podman exec $c /bin/sh -c "perf script report flamegraph -o /tmp/ovn-flamegraph.html" + podman cp $c:/tmp/ovn-flamegraph.html ${host}-perf/$c/ } mkdir /tmp/${host}-perf pushd /tmp -for c in $(docker ps --format "{{.Names}}" --filter "name=${node_name}"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=${node_name}"); do collect_flamegraph_data $c done -for c in $(docker ps --format "{{.Names}}" --filter "name=ovn-central"); do +for c in $(podman ps --format "{{.Names}}" --filter "name=ovn-central"); do collect_flamegraph_data $c done diff --git a/ovn-tester/ovn_sandbox.py b/ovn-tester/ovn_sandbox.py index 4a75fd94..9320e0c7 100644 --- a/ovn-tester/ovn_sandbox.py +++ b/ovn-tester/ovn_sandbox.py @@ -72,7 +72,7 @@ def ensure_channel(self): width=10000, height=10000 ) if self.container: - dcmd = 'docker exec -it ' + self.container + ' bash' + dcmd = 'podman exec -it ' + self.container + ' bash' self.channel.sendall(f"{dcmd}\n".encode()) stdout = StringIO() diff --git a/ovn-tester/ovn_workload.py b/ovn-tester/ovn_workload.py index 2b67cbd2..7b5ff073 100644 --- a/ovn-tester/ovn_workload.py +++ b/ovn-tester/ovn_workload.py @@ -79,7 +79,7 @@ def set_northd_threads(self, n_threads): log.info(f'Configuring northd to use {n_threads} threads') for container in self.db_containers: self.phys_node.run( - f'docker exec {container} ovn-appctl -t ' + f'podman exec {container} ovn-appctl -t ' f'ovn-northd parallel-build/set-n-threads ' f'{n_threads}' ) @@ -103,18 +103,18 @@ def enable_trim_on_compaction(self): log.info('Setting DB trim-on-compaction') for db_container in self.db_containers: self.phys_node.run( - f'docker exec {db_container} ovs-appctl -t ' + f'podman exec {db_container} ovs-appctl -t ' f'/run/ovn/ovnnb_db.ctl ' f'ovsdb-server/memory-trim-on-compaction on' ) self.phys_node.run( - f'docker exec {db_container} ovs-appctl -t ' + f'podman exec {db_container} ovs-appctl -t ' f'/run/ovn/ovnsb_db.ctl ' f'ovsdb-server/memory-trim-on-compaction on' ) for relay_container in self.relay_containers: self.phys_node.run( - f'docker exec {relay_container} ovs-appctl -t ' + f'podman exec {relay_container} ovs-appctl -t ' f'/run/ovn/ovnsb_db.ctl ' f'ovsdb-server/memory-trim-on-compaction on' ) diff --git a/physical-deployments/ci.yml b/physical-deployments/ci.yml index fc89daac..89def6a4 100644 --- a/physical-deployments/ci.yml +++ b/physical-deployments/ci.yml @@ -1,4 +1,3 @@ -registry-node: internal-iface: lo central-node: diff --git a/physical-deployments/physical-deployment.yml b/physical-deployments/physical-deployment.yml index 2aa8a7d5..b1a9160e 100644 --- a/physical-deployments/physical-deployment.yml +++ b/physical-deployments/physical-deployment.yml @@ -1,4 +1,3 @@ -registry-node: host01.mydomain.com internal-iface: eno1 central-node: