From 1481175da725b3476061de6f6cdadf5433ac3f1b Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@dustymabe.com>
Date: Oct 19 2021 12:46:42 +0000
Subject: [PATCH 1/2] butane: updates to butane config


- turn off kernel mitigations
    - no users log into our instance
- set hostname
- enable zram
- wait for network by calling nm-online
    - https://github.com/systemd/systemd/issues/3312#issuecomment-922096361

---

diff --git a/archive-repo-manager.bu b/archive-repo-manager.bu
index dc4c2e6..c959d5c 100644
--- a/archive-repo-manager.bu
+++ b/archive-repo-manager.bu
@@ -1,11 +1,16 @@
 variant: fcos
-version: 1.3.0
+version: 1.4.0
 passwd:
   users:
     - name: core
       ssh_authorized_keys:
         - $SSH_KEY
     - name: worker
+kernel_arguments:
+  should_exist:
+    - mitigations=off
+  should_not_exist:
+    - mitigations=auto,nosmt
 storage:
   directories:
     - path: /home/worker/.config
@@ -29,6 +34,16 @@ storage:
       group:
         name: worker
   files:
+    - path: /etc/hostname
+      mode: 0644
+      contents:
+        inline: archive-repo-manager
+    - path: /etc/systemd/zram-generator.conf
+      mode: 0644
+      contents:
+        inline: |
+          # This config file enables a /dev/zram0 device with the default settings
+          [zram0]
     - path: /var/lib/systemd/linger/worker
       mode: 0644
     - path: /home/worker/archive-repo-manager-environment
@@ -57,14 +72,13 @@ storage:
           [Unit]
           Description=Podman container-archive-repo-manager.service
           Documentation=man:podman-generate-systemd(1)
-          Wants=network.target
-          After=network-online.target
           After=build-archive-repo-manager.service
           [Service]
           Environment=PODMAN_SYSTEMD_UNIT=%n
           EnvironmentFile=/home/worker/archive-repo-manager-environment
           Restart=on-failure
           TimeoutStopSec=70
+          ExecStartPre=nm-online --timeout=30
           ExecStartPre=/bin/rm -f %t/container-archive-repo-manager.pid %t/container-archive-repo-manager.ctr-id
           ExecStart=/usr/bin/podman run --conmon-pidfile %t/container-archive-repo-manager.pid --cidfile %t/container-archive-repo-manager.ctr-id --cgroups=no-conmon --replace -d --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWSACCESSKEYID -e AWSSECRETACCESSKEY -e S3BUCKET --device /dev/fuse --name archive-repo-manager localhost/archive-repo-manager:latest
           ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-archive-repo-manager.ctr-id -t 10
@@ -83,13 +97,12 @@ storage:
         inline: |
           [Unit]
           Description=Build archive-repo-manager container
-          After=network-online.target
-          Wants=network-online.target
           [Service]
           # Give time for the build to complete
           TimeoutStartSec=10m
           Type=oneshot
           RemainAfterExit=yes
+          ExecStartPre=nm-online --timeout=30
           ExecStartPre=-podman pull registry.fedoraproject.org/fedora:33
           ExecStart=-podman build -t localhost/archive-repo-manager:latest https://pagure.io/releng/archive-repo-manager.git
           ExecStartPost=-podman image prune --force

From 392b3dfd62f5f613d86e0f2ee943100b7a936751 Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@dustymabe.com>
Date: Oct 19 2021 12:46:42 +0000
Subject: [PATCH 2/2] Move to Fedora Linux 35 base


---

diff --git a/Dockerfile b/Dockerfile
index c79c043..a2b59aa 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM registry.fedoraproject.org/fedora:34
+FROM registry.fedoraproject.org/fedora:35
 
 # Get any latest updates since last container spin
 RUN dnf update -y
diff --git a/archive-repo-manager.bu b/archive-repo-manager.bu
index c959d5c..6b64a1c 100644
--- a/archive-repo-manager.bu
+++ b/archive-repo-manager.bu
@@ -103,7 +103,7 @@ storage:
           Type=oneshot
           RemainAfterExit=yes
           ExecStartPre=nm-online --timeout=30
-          ExecStartPre=-podman pull registry.fedoraproject.org/fedora:33
+          ExecStartPre=-podman pull registry.fedoraproject.org/fedora:35
           ExecStart=-podman build -t localhost/archive-repo-manager:latest https://pagure.io/releng/archive-repo-manager.git
           ExecStartPost=-podman image prune --force
           [Install]

