Skip to content
Snippets Groups Projects
Select Git revision
  • 19976059781a3cc8a9ea288008b2c2cd621c7fc4
  • master default protected
  • e-infra2
  • ci-megalinter-speedup
  • egi-fixes
  • e-infra
  • envri-hub-new-aai
  • egi-b2drop-no-collapse
  • lfs
  • gpu_staging
  • resurrect-testing-ownloud
  • experiments/collab
  • update_claim_group_keys
  • envri-hub
  • enable_rtc
  • eosc-ui
  • future/jupyterhub-5.x
  • versioning
  • eosc-templating
  • staging1-raw-image
  • token-exchange
21 results

extra

Blame
  • deploy.sh 1.91 KiB
    #! /bin/bash -xe
    
    #
    # Example to setup new site with 3rd party nodes
    #
    
    cd terraform && terraform init && terraform apply
    cd -
    cp -pv terraform/inventory.yaml inventory/1-cesnet.yaml
    
    # dynamic DNS
    ip="$(head -n 1 < terraform/fip.txt)"
    shellstate=$(shopt -po xtrace)
    set +o xtrace
    # https://nsupdate.fedcloud.eu
    vault_prefix=secrets/users/e1662e20-e34b-468c-b0ce-d899bc878364@egi.eu/eosc-dev
    FEDCLOUD_DYNAMIC_DNS=$(vault read -field data $vault_prefix/FEDCLOUD_DYNAMIC_DNS | grep ^map | head -n 1 | sed 's/map\[\(.*\)\]/\1/')
    for auth in $FEDCLOUD_DYNAMIC_DNS; do
    	echo "curl -i -X GET -u $(echo "$auth" | cut -d: -f1):XXX https://nsupdate.fedcloud.eu/nic/update?myip=$ip"
    	curl -i -X GET -u "$auth" https://nsupdate.fedcloud.eu/nic/update?myip="$ip"
    done
    eval "$shellstate"
    
    # wait for ping and ssh
    for ip in $(cat terraform/hosts.txt); do
    	while ! ping -c 1 "$ip"; do sleep 5; done
    	ssh-keygen -R "$ip"
    	while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
    done
    
    # check ssh access
    ansible -m command -a 'uname -a' allnodes
    
    # wait cloud-init
    ansible -m shell -a 'while ! test -f /var/lib/cloud/instance/boot-finished; do sleep 2; done' allnodes
    
    # setup volumes
    ansible -m copy -a 'src=terraform/nfs-volume.sh dest=/root/ mode=preserve' nfs
    ansible -m command -a '/root/nfs-volume.sh' nfs
    ansible -m copy -a 'src=terraform/squid-volume.sh dest=/root/ mode=preserve' 'ingress[0]'
    ansible -m command -a '/root/squid-volume.sh' 'ingress[0]'
    ansible -m copy -a 'src=terraform/docker-volume.sh dest=/root/ mode=preserve' 'ingress nfs worker'
    ansible -m command -a '/root/docker-volume.sh' 'ingress nfs worker'
    
    # k8s + notebooks
    ansible-playbook playbooks/k8s.yaml
    # ansible-playbook playbooks/squid.yaml
    # ansible-playbook playbooks/cvmfs.yaml
    while ansible -i ./inventory -m command -a 'kubectl get pods --all-namespaces' master | tail -n +3 | grep -v ' Running '; do sleep 5; done