Skip to content
Snippets Groups Projects
Commit 6af370a3 authored by Maria Petrova-El Sayed's avatar Maria Petrova-El Sayed
Browse files

Remove jonja templating

parent 7ee9ae59
No related branches found
No related tags found
No related merge requests found
Pipeline #117867 failed
...@@ -8,10 +8,8 @@ variables: ...@@ -8,10 +8,8 @@ variables:
OS_REGION_NAME: "HDFCloud" OS_REGION_NAME: "HDFCloud"
OS_INTERFACE: public OS_INTERFACE: public
OLD_PROD_NAME: old-docker-worker OLD_PROD_NAME: old-docker-worker
WORKER_NAME: airflow-docker-worker1 WORKER_NAME: airflow-docker-worker
WORKER_IP: 134.94.199.45 WORKER_IP: 134.94.199.45
DLS_PRODUCTION_IP: 134.94.199.17
LOCAL_FIXED_IP: 10.0.27.27
AIRFLOW_TESTUSER: "airflow" AIRFLOW_TESTUSER: "airflow"
VOLUME_ID: 3423c7e3-daa5-403c-bc8d-5b327f17b53e VOLUME_ID: 3423c7e3-daa5-403c-bc8d-5b327f17b53e
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
...@@ -22,8 +20,7 @@ variables: ...@@ -22,8 +20,7 @@ variables:
before_script: before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client gcc libxslt-dev libffi-dev libssl-dev build-essential python3-dev -y )' - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client gcc libxslt-dev libffi-dev libssl-dev build-essential python3-dev -y )'
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
- echo "$SSH_USER_PKEY_FOR_DOCKER_WORKER" | tr -d '\r' | ssh-add - - echo "$SSH_PRIVATE_KEY_DOCKER_WORKER" | tr -d '\r' | ssh-add -
# - echo "$SSH_DLS_USER_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- chmod 700 ~/.ssh - chmod 700 ~/.ssh
...@@ -47,21 +44,17 @@ create-docker-worker: ...@@ -47,21 +44,17 @@ create-docker-worker:
# openstack server set --name $OLD_PROD_NAME $OLD_ID; # openstack server set --name $OLD_PROD_NAME $OLD_ID;
# fi # fi
- openstack server remove volume $OLD_ID $VOLUME_ID - openstack server remove volume $OLD_ID $VOLUME_ID
# TODO: The line below is not working because of --property "private_key=$SSH_HOST_PRIVATE_KEY_DWORKER_ESCAPED" => "Error Value ... is too long (HTTP 400)".
# - INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor s1 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data cloudinit.yml --property "private_key=$SSH_HOST_PRIVATE_KEY_DWORKER_ESCAPED" --security-group ssh --security-group www --security-group https $WORKER_NAME`
- INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor s1 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data cloudinit.yml --security-group ssh --security-group www --security-group https $WORKER_NAME` - INSTANCE_ID=`openstack server create -f value -c id --prefix IMAGE_ --flavor s1 --image 149a65b5-aeb8-499f-aaa6-ec966bd28dd6 --user-data cloudinit.yml --security-group ssh --security-group www --security-group https $WORKER_NAME`
- while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip - while [ "`openstack server show $INSTANCE_ID -c addresses -f value`" = "{}" ]; do sleep 5; done # wait until an address is available to attach the floating ip
- openstack server add floating ip $INSTANCE_ID $WORKER_IP - openstack server add floating ip $INSTANCE_ID $WORKER_IP
- sleep 10 # ensure that next command reaches the new server, prevents host key problems - sleep 10 # ensure that next command reaches the new server, prevents host key problems
# do the mount /dev/vdb1 stuff - LOCAL_IP=`openstack port list --server $INSTANCE_ID --network internal -c 'Fixed IP Addresses'`
- echo $LOCAL_IP
# do the mount /dev/vdb stuff
- openstack server add volume $INSTANCE_ID $VOLUME_ID - openstack server add volume $INSTANCE_ID $VOLUME_ID
- sleep 20 # apparently it may take some time until the volume is available to the OS - sleep 20 # apparently it may take some time until the volume is available to the OS
- ssh -vvv -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo mkdir -p /wf_pipeline_data && sudo mount /dev/vdb /wf_pipeline_data" - ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo mkdir -p /wf_pipeline_data && sudo mount /dev/vdb /wf_pipeline_data"
- until ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP ls /finished_cloudinit >/dev/null 2>&1; do sleep 30; done # wait until cloudinit script is complete - until ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP ls /finished_cloudinit >/dev/null 2>&1; do sleep 30; done # wait until cloudinit script is complete
# add the ssh host private key value
- LOCAL_IP=`openstack port list --server $INSTANCE_ID --network internal -c 'Fixed IP Addresses'`
- echo $LOCAL_IP
# - echo "$SSH_HOST_PRIVATE_KEY_DWORKER" | ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo tee /etc/ssh/ssh_host_ed25519_key"
- echo "{\"data-root\":\"/wf_pipeline_data/docker_volumes\"}" | ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo tee -a /etc/docker/daemon.json" - echo "{\"data-root\":\"/wf_pipeline_data/docker_volumes\"}" | ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo tee -a /etc/docker/daemon.json"
- ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo service docker restart" # to use the configured docker data path - ssh -oStrictHostKeyChecking=accept-new airflow@$WORKER_IP "sudo service docker restart" # to use the configured docker data path
- echo "Done" - echo "Done"
...@@ -89,5 +82,3 @@ update-dls-testing: ...@@ -89,5 +82,3 @@ update-dls-testing:
<<: *ssh_setup <<: *ssh_setup
script: script:
- echo "$SSH_HOST_PRIVATE_KEY_DWORKER" | ssh -oStrictHostKeyChecking=accept-new airflow@$DLS_PRODUCTION_IP "sudo tee /home/airflow/testme.txt" - echo "$SSH_HOST_PRIVATE_KEY_DWORKER" | ssh -oStrictHostKeyChecking=accept-new airflow@$DLS_PRODUCTION_IP "sudo tee /home/airflow/testme.txt"
\ No newline at end of file
## template: jinja
#cloud-config #cloud-config
# This is a cloud config that install most basic packages, and add the admin users # This is a cloud config that install most basic packages, and add the admin users
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment