You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/05/07 17:57:13 UTC

[airflow-ci-infra] branch main updated: Send logs to Cloudwatch in the same region, not always to Frankfurt (#25)

This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-ci-infra.git


The following commit(s) were added to refs/heads/main by this push:
     new 0101dc7  Send logs to Cloudwatch in the same region, not always to Frankfurt (#25)
0101dc7 is described below

commit 0101dc7826c1af318b669230bf0543997e08f4e8
Author: Ash Berlin-Taylor <as...@firemirror.com>
AuthorDate: Fri May 7 18:57:04 2021 +0100

    Send logs to Cloudwatch in the same region, not always to Frankfurt (#25)
---
 github-runner-ami/packer/files/install-files.sh            |  3 ++-
 .../{install-files.sh => vector.service.d.override.conf}   | 14 ++------------
 github-runner-ami/packer/files/vector.toml                 |  2 +-
 github-runner-ami/packer/ubuntu2004.pkr.hcl                |  6 +++++-
 4 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/github-runner-ami/packer/files/install-files.sh b/github-runner-ami/packer/files/install-files.sh
index 9c726f6..bacde4e 100644
--- a/github-runner-ami/packer/files/install-files.sh
+++ b/github-runner-ami/packer/files/install-files.sh
@@ -18,7 +18,7 @@
 
 set -eu -o pipefail
 
-mkdir /etc/iptables/ /etc/vector
+mkdir /etc/iptables/ /etc/vector /etc/systemd/system/vector.service.d
 
 install --owner root --mode=0644 --target-directory "/etc/systemd/system/" "/tmp/etc-systemd-system/"*
 install --owner root --mode=0755 --target-directory "/usr/local/sbin" "/tmp/usr-local-sbin/"*
@@ -27,3 +27,4 @@ install --owner root --mode=0644 --target-directory "/etc/iptables" "/tmp/etc-ip
 install --owner root --mode=0644 --target-directory "/etc/cron.d" "/tmp/etc-cron.d/"*
 install --owner root --mode=0644 --target-directory "/etc/sudoers.d" "/tmp/etc-sudoers.d/"*
 install --owner root --mode=0644 --target-directory "/etc/vector/" "/tmp/etc-vector/"*
+install --owner root --mode=0644 --target-directory "/etc/systemd/system/vector.service.d/" "/tmp/etc-systemd-system-vector.service.d/"*
diff --git a/github-runner-ami/packer/files/install-files.sh b/github-runner-ami/packer/files/vector.service.d.override.conf
similarity index 52%
copy from github-runner-ami/packer/files/install-files.sh
copy to github-runner-ami/packer/files/vector.service.d.override.conf
index 9c726f6..899e86c 100644
--- a/github-runner-ami/packer/files/install-files.sh
+++ b/github-runner-ami/packer/files/vector.service.d.override.conf
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -16,14 +15,5 @@
 # specific language governing permissions and limitations
 # under the License.
 
-set -eu -o pipefail
-
-mkdir /etc/iptables/ /etc/vector
-
-install --owner root --mode=0644 --target-directory "/etc/systemd/system/" "/tmp/etc-systemd-system/"*
-install --owner root --mode=0755 --target-directory "/usr/local/sbin" "/tmp/usr-local-sbin/"*
-install --owner root --mode=0755 --target-directory "/usr/local/bin" "/tmp/usr-local-bin/"*
-install --owner root --mode=0644 --target-directory "/etc/iptables" "/tmp/etc-iptables/"*
-install --owner root --mode=0644 --target-directory "/etc/cron.d" "/tmp/etc-cron.d/"*
-install --owner root --mode=0644 --target-directory "/etc/sudoers.d" "/tmp/etc-sudoers.d/"*
-install --owner root --mode=0644 --target-directory "/etc/vector/" "/tmp/etc-vector/"*
+[Service]
+EnvironmentFile=/etc/environment
diff --git a/github-runner-ami/packer/files/vector.toml b/github-runner-ami/packer/files/vector.toml
index 05db414..07da3a0 100644
--- a/github-runner-ami/packer/files/vector.toml
+++ b/github-runner-ami/packer/files/vector.toml
@@ -95,4 +95,4 @@ create_missing_group = false
 create_missing_stream = true
 group_name = "GitHubRunners"
 stream_name = "{{ host }}"
-region = "eu-central-1"
+region = "${AWS_DEFAULT_REGION}"
diff --git a/github-runner-ami/packer/ubuntu2004.pkr.hcl b/github-runner-ami/packer/ubuntu2004.pkr.hcl
index f428705..cb688f8 100644
--- a/github-runner-ami/packer/ubuntu2004.pkr.hcl
+++ b/github-runner-ami/packer/ubuntu2004.pkr.hcl
@@ -89,7 +89,7 @@ build {
   # in to place with the approriate permissions via install-files.sh provisioner step
   provisioner "shell" {
     inline = [
-      "mkdir -p /tmp/etc-systemd-system /tmp/usr-local-sbin /tmp/usr-local-bin /tmp/etc-sudoers.d /tmp/etc-iptables /tmp/etc-cron.d /tmp/etc-vector"
+      "mkdir -p /tmp/etc-systemd-system /tmp/usr-local-sbin /tmp/usr-local-bin /tmp/etc-sudoers.d /tmp/etc-iptables /tmp/etc-cron.d /tmp/etc-vector /tmp/etc-systemd-system-vector.service.d"
     ]
   }
   provisioner "file" {
@@ -136,6 +136,10 @@ build {
     destination = "/tmp/etc-vector/vector.toml"
     source      = "./files/vector.toml"
   }
+  provisioner "file" {
+    destination = "/tmp/etc-systemd-system-vector.service.d/override.conf"
+    source      = "./files/vector.service.d.override.conf"
+  }
   provisioner "shell" {
     scripts = [
       "./files/install-files.sh",