From 4fd75fc80fd27cac519989e12cee030b8a8349a7 Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 7 Oct 2016 14:17:26 -0700 Subject: [PATCH] coreos-base/oem-gce: migrate to the containerized GCE agent The container is actually installed into the image when running the image_to_vm script, so this ebuild has no runtime dependencies. It only installs the GRUB configuration, oem-release file, and service unit to start the rkt container. --- .../units/google-accounts-manager.service | 12 -------- .../units/google-address-manager.service | 11 ------- .../units/google-clock-sync-manager.service | 11 ------- .../google-startup-scripts-onboot.service | 15 ---------- .../units/google-startup-scripts.service | 14 --------- .../oem-gce/files/units/oem-gce.service | 29 +++++++++++++++++++ ...e-1.3.2.ebuild => oem-gce-20160906.ebuild} | 5 ---- 7 files changed, 29 insertions(+), 68 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-accounts-manager.service delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-address-manager.service delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-clock-sync-manager.service delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts-onboot.service delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts.service create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/{oem-gce-1.3.2.ebuild => oem-gce-20160906.ebuild} (84%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-accounts-manager.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-accounts-manager.service deleted file mode 100644 index 1b4545ba1f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-accounts-manager.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Google Compute Engine User Accounts Manager Daemon -After=network.target -Before=sshd.service -Requires=network.target - -[Service] -Type=simple -ExecStart=/usr/share/oem/python/bin/python2.7 /usr/share/oem/google-compute-daemon/manage_accounts.py - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-address-manager.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-address-manager.service deleted file mode 100644 index 4eccef0ed4..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-address-manager.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Google Compute Engine Address Manager Daemon -After=network.target -Requires=network.target - -[Service] -Type=simple -ExecStart=/usr/share/oem/python/bin/python2.7 /usr/share/oem/google-compute-daemon/manage_addresses.py - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-clock-sync-manager.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-clock-sync-manager.service deleted file mode 100644 index 277b50b364..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-clock-sync-manager.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Google Compute Engine Clock Sync Daemon -After=network.target -Requires=network.target - -[Service] -Type=simple -ExecStart=/usr/share/oem/python/bin/python2.7 /usr/share/oem/google-compute-daemon/manage_clock_sync.py - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts-onboot.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts-onboot.service deleted file mode 100644 index 6c393e8576..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts-onboot.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Google Compute Engine Startup Scripts -After=network.target -After=local-fs.target -Before=sshd.service -Requires=network.target -Requires=local-fs.target - -[Service] -Type=oneshot -Environment=GOOGLE_SCRIPTS_PREFIX=/usr/share/oem/google-startup-scripts -ExecStart=/usr/share/oem/google-startup-scripts/onboot - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts.service deleted file mode 100644 index c3e517b5af..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/google-startup-scripts.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Google Compute Engine user startup scripts -After=network.target -After=google-startup-scripts-onboot.service -Requires=google-startup-scripts-onboot.service -Requires=network.target - -[Service] -Environment=GOOGLE_SCRIPTS_PREFIX=/usr/share/oem/google-startup-scripts -ExecStart=/usr/share/oem/google-startup-scripts/run-startup-scripts -Type=idle - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service new file mode 100644 index 0000000000..9e60fb51cd --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service @@ -0,0 +1,29 @@ +[Unit] +Description=GCE Linux Agent +After=local-fs.target network-online.target network.target +After=local-fs.target network-online.target network.target + +[Service] +Type=simple +Restart=always +RestartSec=5 + +# There is a custom main process that kills all of the contained services. +KillMode=process +KillSignal=SIGTERM + +ExecStart=/usr/bin/rkt run \ + --inherit-env=true \ + --insecure-options=image \ + --net=host \ + --stage1-path=/usr/lib/rkt/stage1-images/stage1-fly.aci \ + --volume=baselayout,kind=host,source=/usr/share/baselayout,readOnly=true \ + --volume=cacertificates,kind=host,source=/usr/share/ca-certificates,readOnly=true \ + --volume=etc,kind=host,source=/etc,readOnly=false \ + --volume=runsystemd,kind=host,source=/run/systemd,readOnly=false \ + /usr/share/oem/coreos-oem-gce.aci + +ExecStopPost=/usr/bin/rkt gc --mark-only + +[Install] +WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-1.3.2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20160906.ebuild similarity index 84% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-1.3.2.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20160906.ebuild index a835239a8a..5e1842ea4f 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-1.3.2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20160906.ebuild @@ -15,11 +15,6 @@ IUSE="" # no source directory S="${WORKDIR}" -RDEPEND=" - ~app-emulation/google-compute-daemon-${PV} - ~app-emulation/google-startup-scripts-${PV} -" - src_prepare() { sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ "${FILESDIR}/oem-release" > "${T}/oem-release" || die