diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd8e7fdaa042ad877dfc8c7a9a6fb1d37ffad1b3..c29e5e3e4642a686e431468110d3cae107f45e10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,74 +90,74 @@ build-job-ZCU104: # This job runs in the build stage, which runs first. tags: - Vivado2021.1 -deploy-job-Z2: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. - environment: production - script: - - echo "Deploying application to Z2" - # use smbclient to transfer accross the bit, hwh and python script files to the z2 xilinx board - # could probably set this up as scp with RSA keys in future - - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'cd ./pynq/overlays/soclabs/ ; put ./system/fpga_imp/pynq_export/pz2/pynq/overlays/soclabs/design_1.bit ./design_1.bit' -E 2>errorlog - - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) - - then - - echo "Connection to Z2 Board Failed" - - exit 1 - - else - - echo "Connection to Z2 Board successful" - - fi - - rm errorlog - - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'cd ./pynq/overlays/soclabs/ ; put ./system/fpga_imp/pynq_export/pz2/pynq/overlays/soclabs/design_1.hwh ./design_1.hwh' -E 2>errorlog - - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) - - then - - echo "Connection to Z2 Board Failed" - - exit 1 - - else - - echo "Connection to Z2 Board successful" - - fi - - rm errorlog - - cd ./system/fpga_imp/CI_verification - - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'put ./load_bitfile.py ./load_bitfile.py' -E 2>errorlog - - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) - - then - - echo "Connection to Z2 Board Failed" - - exit 1 - - else - - echo "Connection to Z2 Board successful" - - fi - - rm errorlog - # get root access on host machine, this was found to be needed because other screen would not work - # however a more elegant solution would be better - - echo gitrunner1 | sudo -S su - # open detatched terminal with connection to the Xilinx Z2 board - - sudo screen -S zynq -dm /dev/ttyUSB1 115200 - # get root access on xilinx board, this is needed because the python script won't run without - # being root. - - sudo screen -r zynq -X stuff "sudo -S su \n" - # setup pynq environment - - sudo screen -r zynq -X stuff "source /etc/profile.d/pynq_venv.sh \n" - - sudo screen -r zynq -X stuff "source /etc/profile.d/xrt_setup.sh \n" - - sudo screen -r zynq -X stuff "source /etc/profile.d/boardname.sh \n" - # run load_bitfile: this loads the overlay and checks that it has been loaded - # script will output "Overlay Loaded" if successful - - sudo screen -r zynq -X stuff "python3 load_bitfile.py > tmp \n" - # sleep 1 minute: this is needed as currently the terminal running the CI/CD script will not wait - # for the python script to finish. A more elegant solution should be implemented in future - - sleep 60 - # copy over the tmp file back to host machine and check if "Overlay Loaded" has been outputed f - - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'get tmp' - - if (grep -r "Overlay Loaded" ./tmp) - - then - - echo "Bit file loaded successfully" - - else - - echo "Bit file load failed" - - exit 1 - - fi - after_script: - # cleanup: remove detached terminal screen - - echo gitrunner1 | sudo -S su - - sudo screen -X -S zynq quit - tags: - - Z2 +#deploy-job-Z2: # This job runs in the deploy stage. +# stage: deploy # It only runs when *both* jobs in the test stage complete successfully. +# environment: production +# script: +# - echo "Deploying application to Z2" +# # use smbclient to transfer accross the bit, hwh and python script files to the z2 xilinx board +# # could probably set this up as scp with RSA keys in future +# - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'cd ./pynq/overlays/soclabs/ ; put ./system/fpga_imp/pynq_export/pz2/pynq/overlays/#soclabs/design_1.bit ./design_1.bit' -E 2>errorlog +# - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) +# - then +# - echo "Connection to Z2 Board Failed" +# - exit 1 +# - else +# - echo "Connection to Z2 Board successful" +# - fi +# - rm errorlog +# - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'cd ./pynq/overlays/soclabs/ ; put ./system/fpga_imp/pynq_export/pz2/pynq/overlays/#soclabs/design_1.hwh ./design_1.hwh' -E 2>errorlog +# - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) +# - then +# - echo "Connection to Z2 Board Failed" +# - exit 1 +# - else +# - echo "Connection to Z2 Board successful" +# - fi +# - rm errorlog +# - cd ./system/fpga_imp/CI_verification +# - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'put ./load_bitfile.py ./load_bitfile.py' -E 2>errorlog +# - if (grep -r "Connection to 192.168.2.99 failed" ./errorlog) +# - then +# - echo "Connection to Z2 Board Failed" +# - exit 1 +# - else +# - echo "Connection to Z2 Board successful" +# - fi +# - rm errorlog +# # get root access on host machine, this was found to be needed because other screen would not work +# # however a more elegant solution would be better +# - echo gitrunner1 | sudo -S su +# # open detatched terminal with connection to the Xilinx Z2 board +# - sudo screen -S zynq -dm /dev/ttyUSB1 115200 +# # get root access on xilinx board, this is needed because the python script won't run without +# # being root. +# - sudo screen -r zynq -X stuff "sudo -S su \n" +# # setup pynq environment +# - sudo screen -r zynq -X stuff "source /etc/profile.d/pynq_venv.sh \n" +# - sudo screen -r zynq -X stuff "source /etc/profile.d/xrt_setup.sh \n" +# - sudo screen -r zynq -X stuff "source /etc/profile.d/boardname.sh \n" +# # run load_bitfile: this loads the overlay and checks that it has been loaded +# # script will output "Overlay Loaded" if successful +# - sudo screen -r zynq -X stuff "python3 load_bitfile.py > tmp \n" +# # sleep 1 minute: this is needed as currently the terminal running the CI/CD script will not wait +# # for the python script to finish. A more elegant solution should be implemented in future +# - sleep 60 +# # copy over the tmp file back to host machine and check if "Overlay Loaded" has been outputed f +# - smbclient //192.168.2.99/xilinx -m SMB3 -U xilinx%xilinx -c 'get tmp' +# - if (grep -r "Overlay Loaded" ./tmp) +# - then +# - echo "Bit file loaded successfully" +# - else +# - echo "Bit file load failed" +# - exit 1 +# - fi +# after_script: +# # cleanup: remove detached terminal screen +# - echo gitrunner1 | sudo -S su +# - sudo screen -X -S zynq quit +# tags: +# - Z2 deploy-job-ZCU104: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully.