Skip to content
Snippets Groups Projects
Commit ce166ca4 authored by Andreas Hamacher's avatar Andreas Hamacher
Browse files

still working on gc_key file

parent cb54f895
No related branches found
No related tags found
4 merge requests!381Yumadminpackage,!379Pipelinefix,!376Pipelinefix,!373Pipelinefix
...@@ -54,8 +54,8 @@ yamllint: ...@@ -54,8 +54,8 @@ yamllint:
# tags: # tags:
# - heat # - heat
# before_script: # before_script:
# - echo "$GC_KEY" > GC_KEY # - echo "$GC_KEY" > gc_key.pem
# - chmod 400 $GC_KEY # - chmod 400 gc_key.pem
# - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh # - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
# script: # script:
# - echo "heat stage" # - echo "heat stage"
...@@ -84,18 +84,19 @@ testlustre: ...@@ -84,18 +84,19 @@ testlustre:
- heat - heat
before_script: before_script:
- cd $DEFAULT_PATH - cd $DEFAULT_PATH
- echo "$GC_KEY" > gc_key.pem
- chmod 400 gc_key.pem
- echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
- sleep 60 - sleep 60
script: script:
- echo "heat stage" - echo "heat stage"
- chmod 400 $GC_KEY
- source ./$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- openstack stack list - openstack stack list
- openstack stack create --wait --template heat/lustre_HOT.yaml --parameter "project_name=$STACKNAME" $STACKNAME - openstack stack create --wait --template heat/lustre_HOT.yaml --parameter "project_name=$STACKNAME" $STACKNAME
- python3 ../scripts/make_inventory.py static $STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME - python3 ../scripts/make_inventory.py static $STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME
- cd plays/testlustre - cd plays/testlustre
- sleep 100 - sleep 100
- ansible-playbook -i files/inventory.$STACKNAME --key-file ../$GC_KEY testlustre.yml - ansible-playbook -i files/inventory.$STACKNAME --key-file ../../gc_key.pem testlustre.yml
- sleep 60 - sleep 60
- cd ../../ - cd ../../
- bash -x ./heat/heatcicdwrapper.sh delete_if_exists $STACKNAME - bash -x ./heat/heatcicdwrapper.sh delete_if_exists $STACKNAME
...@@ -109,11 +110,12 @@ build_cluster_cicd: ...@@ -109,11 +110,12 @@ build_cluster_cicd:
- heat - heat
before_script: before_script:
- cd $DEFAULT_PATH - cd $DEFAULT_PATH
- echo "$GC_KEY" > gc_key.pem
- chmod 400 gc_key.pem
- echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
script: script:
- echo "heat stage" - echo "heat stage"
#- source ./$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- chmod 400 $GC_KEY
- openstack stack list - openstack stack list
- bash -x ./heat/heatcicdwrapper.sh create_or_update $STACKNAME - bash -x ./heat/heatcicdwrapper.sh create_or_update $STACKNAME
- bash -x ./heat/server_rebuild.sh all - bash -x ./heat/server_rebuild.sh all
...@@ -131,55 +133,59 @@ ansible_create_cluster_stage: ...@@ -131,55 +133,59 @@ ansible_create_cluster_stage:
- ansible - ansible
before_script: before_script:
- cd $DEFAULT_PATH/.. - cd $DEFAULT_PATH/..
- echo "$GC_KEY" > gc_key.pem
- chmod 400 gc_key.pem
- echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
script: script:
- echo "ansible_create_cluster_stage" - echo "ansible_create_cluster_stage"
- chmod 400 $GC_KEY
- bash -x ./CICD/ansible_create_cluster_script.sh - bash -x ./CICD/ansible_create_cluster_script.sh
- cd CICD - cd CICD
- ansible-playbook -i files/inventory.$STACKNAME --key-file $GC_KEY --skip-tags SiteSpecific master_playbook.yml - ansible-playbook -i files/inventory.$STACKNAME --key-file ../gc_key.pem --skip-tags SiteSpecific master_playbook.yml
- sleep 15 - sleep 15
- echo uglyuglyfix - echo uglyuglyfix
- ansible -i files/inventory.$STACKNAME --key-file $GC_KEY -b -a "systemctl restart slurmdbd" ManagementNodes - ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -b -a "systemctl restart slurmdbd" ManagementNodes
- ansible -i files/inventory.$STACKNAME --key-file $GC_KEY -b -a "systemctl restart slurmctld" ManagementNodes - ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -b -a "systemctl restart slurmctld" ManagementNodes
- cd plays - cd plays
- ansible-playbook -i files/inventory.$STACKNAME --key-file ../$GC_KEY --skip-tags monitoring computenodes.yml | tee nochange.log - ansible-playbook -i files/inventory.$STACKNAME --key-file ../../gc_key.pem --skip-tags monitoring computenodes.yml | tee nochange.log
- echo [ `grep changed= ./nochange.log -c` = `grep changed=0 ./nochange.log -c` ] > bashtest.sh # a crude way to make sure all changed lines are equal to changed=0 - echo [ `grep changed= ./nochange.log -c` = `grep changed=0 ./nochange.log -c` ] > bashtest.sh # a crude way to make sure all changed lines are equal to changed=0
- bash ./bashtest.sh - bash ./bashtest.sh
- ansible-playbook -i files/inventory.$STACKNAME --key-file ../$GC_KEY --skip-tags monitoring --check computenodes.yml - ansible-playbook -i files/inventory.$STACKNAME --key-file ../../gc_key.pem --skip-tags monitoring --check computenodes.yml
tests: tests:
stage: tests stage: tests
tags: tags:
- ansible - ansible
before_script: before_script:
- echo "$GC_KEY" > gc_key.pem
- chmod 400 gc_key.pem
- echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
script: script:
- echo "tests stage" - echo "tests stage"
- chmod 400 $$GC_KEY
- source ./$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- openstack stack list - openstack stack list
- cd CICD - cd CICD
- python3 ../scripts/make_inventory.py static $STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME - python3 ../scripts/make_inventory.py static $STACKNAME | tee ./files/inventory.$STACKNAME && chmod 755 ./files/inventory.$STACKNAME
- grep -qv "I could not find any resouces tagged with project_name:" ./files/inventory.$STACKNAME #fail if inventory file is empty - grep -qv "I could not find any resouces tagged with project_name:" ./files/inventory.$STACKNAME #fail if inventory file is empty
- ansible -m ping -i files/inventory.$STACKNAME --key-file $GC_KEY all - ansible -m ping -i files/inventory.$STACKNAME --key-file ../gc_key.pem all
- ansible -i files/inventory.$STACKNAME --key-file $GC_KEY -a "sudo ls" all - ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "sudo ls" all
- echo -e '[defaults]\r\nallow_world_readable_tmpfiles = True' > ansible.cfg - echo -e '[defaults]\r\nallow_world_readable_tmpfiles = True' > ansible.cfg
- ansible-playbook -i files/inventory.$STACKNAME --key-file $GC_KEY ./tests/mockSlurmData.yml - ansible-playbook -i files/inventory.$STACKNAME --key-file ../gc_key.pem ./tests/mockSlurmData.yml
# Need to find a better check for sinfo # Need to find a better check for sinfo
#- ansible -B 30 -i files/inventory.$STACKNAME --key-file $GC_KEY -a "find /opt/ -name sinfo -type f" ManagementNodes #- ansible -B 30 -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "find /opt/ -name sinfo -type f" ManagementNodes
#- ansible -B 30 -i files/inventory.$STACKNAME --key-file $GC_KEY -a "find /opt/ -name squeue -type f" ManagementNodes #- ansible -B 30 -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "find /opt/ -name squeue -type f" ManagementNodes
- ansible -B 30 -i files/inventory.$STACKNAME --key-file $GC_KEY -a "systemctl is-active --quiet mariadb" SQLNodes - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "systemctl is-active --quiet mariadb" SQLNodes
- ansible -B 30 -i files/inventory.$STACKNAME --key-file $GC_KEY -a "systemctl is-active --quiet slurmctld" ManagementNodes - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "systemctl is-active --quiet slurmctld" ManagementNodes
- ansible -B 30 -i files/inventory.$STACKNAME --key-file $GC_KEY -a "systemctl is-active --quiet slurmdbd" ManagementNodes - ansible -B 30 -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a "systemctl is-active --quiet slurmdbd" ManagementNodes
- bash -e ./tests/run_tests.sh all "files/inventory.$STACKNAME" "$GC_KEY"
- bash -e ./tests/run_tests.sh ComputeNodes "files/inventory.$STACKNAME" "$GC_KEY"
- bash -e ./tests/run_tests.sh LoginNodes "files/inventory.$STACKNAME" "$GC_KEY" - bash -e ./tests/run_tests.sh all "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh ManagementNodes "files/inventory.$STACKNAME" "$GC_KEY" - bash -e ./tests/run_tests.sh ComputeNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh NFSNodes "files/inventory.$STACKNAME" "$GC_KEY" - bash -e ./tests/run_tests.sh LoginNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh SQLNodes "files/inventory.$STACKNAME" "$GC_KEY" - bash -e ./tests/run_tests.sh ManagementNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh slurm "files/inventory.$STACKNAME" "$GC_KEY" - bash -e ./tests/run_tests.sh NFSNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- ansible -i files/inventory.$STACKNAME --key-file $GC_KEY -a 'sudo su - user1 -c whoami' LoginNodes,ComputeNodes # to test ldap - bash -e ./tests/run_tests.sh SQLNodes "files/inventory.$STACKNAME" "../gc_key.pem"
- bash -e ./tests/run_tests.sh slurm "files/inventory.$STACKNAME" "../gc_key.pem"
- ansible -i files/inventory.$STACKNAME --key-file ../gc_key.pem -a 'sudo su - user1 -c whoami' LoginNodes,ComputeNodes # to test ldap
#- sshpass -p 'redhat' ssh -o StrictHostKeyChecking=no user1@server.example.com #- sshpass -p 'redhat' ssh -o StrictHostKeyChecking=no user1@server.example.com
extended: extended:
...@@ -209,10 +215,11 @@ manual_cluster_spawn: ...@@ -209,10 +215,11 @@ manual_cluster_spawn:
- echo "for this to work you have to provide a variable called manual stackname" - echo "for this to work you have to provide a variable called manual stackname"
- echo I still need to handle os password - echo I still need to handle os password
- echo $MANUAL_STACKNAME - echo $MANUAL_STACKNAME
- echo "$GC_KEY" > gc_key.pem
- chmod 400 gc_key.pem
- echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
script: script:
- source ./$NECTAR_ALLOCATION-openrc.sh - source ./$NECTAR_ALLOCATION-openrc.sh
- chmod 400 $GC_KEY
- bash -x ./CICD/heat/heatcicdwrapper.sh create $MANUAL_STACKNAME ${CI_PROJECT_NAME} - bash -x ./CICD/heat/heatcicdwrapper.sh create $MANUAL_STACKNAME ${CI_PROJECT_NAME}
- openstack stack list - openstack stack list
- export STACKNAME=$MANUAL_STACKNAME - export STACKNAME=$MANUAL_STACKNAME
...@@ -242,8 +249,8 @@ clean: ...@@ -242,8 +249,8 @@ clean:
# tags: # tags:
# - heat # - heat
# before_script: # before_script:
# - echo "$GC_KEY" > GC_KEY # - echo "$GC_KEY" > gc_key.pem
# - chmod 400 $GC_KEY # - chmod 400 gc_key.pem
# - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh # - echo "$HPCCICD_openrc" > ./$NECTAR_ALLOCATION-openrc.sh
# - source ./$NECTAR_ALLOCATION-openrc.sh # - source ./$NECTAR_ALLOCATION-openrc.sh
# - export HEAT_TEST_STACKNAME=_TESTING_HEAT # - export HEAT_TEST_STACKNAME=_TESTING_HEAT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment