Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues deploying an Airflow cluster due to obsolete ami image default and environment provisioning failure in EC2 instances. #37

Open
jmvictoria opened this issue Jun 26, 2020 · 0 comments

Comments

@jmvictoria
Copy link

jmvictoria commented Jun 26, 2020

Hi all and greetings for this great job.

  1. The default ami image used to deploy EC2 instances is no longer available (at least in eu-west-1 zone), I must use the more recent: ami-089cc16f7f08c4457" # ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611, instead setting it in main.tf with "ami =" option without problem.

  2. In EC2 instance provisining file "cloud-init.sh" I got a failure setting the Airflow environment variables in /etc/environment due to incorrect line format in file because of the use of preceding "export ", to avoid that I propose the next patch:

--- .terraform/modules/airflow_cluster/terraform-aws-airflow-0.12.0/files/cloud-init.sh.orig    2020-06-25 11:42:51.153032110 +0000
+++ .terraform/modules/airflow_cluster/terraform-aws-airflow-0.12.0/files/cloud-init.sh 2020-06-26 06:42:23.942287388 +0000
@@ -92,11 +92,12 @@

    cat /etc/environment | sudo tee -a /tmp/airflow_environment
    cat /tmp/custom_env | sudo tee -a /tmp/airflow_environment
-   sed 's/^/export /' -- </tmp/airflow_environment | sudo tee -a /etc/environment
+    sudo cp /tmp/airflow_environment /etc/environment
+   sed 's/^/export /' -- </tmp/airflow_environment | sudo tee -a /tmp/airflow_exportenv
    sudo cat /tmp/airflow.service >> /etc/systemd/system/airflow.service
    cat /tmp/airflow_environment | sudo tee -a /etc/sysconfig/airflow

-   source /etc/environment
+   source /tmp/airflow_exportenv

    if [ "$AIRFLOW__CORE__LOAD_DEFAULTS" = false ]; then
            airflow upgradedb

Best regards,

Juan M.Victoria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant