CIDuty/How To/QuarantineMultipleInstances: Difference between revisions

Formatting changes and added more info
m (add link to CIDuty:TaskClusterCli)
(Formatting changes and added more info)
Line 8: Line 8:
===== Setting up taskcluster =====
===== Setting up taskcluster =====
In order to run the previous python file we will need the help from taskcluster cli. The installation of the app can be done in two methods. Choose one. Both are correct.
In order to run the previous python file we will need the help from taskcluster cli. The installation of the app can be done in two methods. Choose one. Both are correct.
* Download taskcluster needed file and make it executable  
* Download taskcluster binary and make it executable  
# Download the taskcluster : https://index.taskcluster.net/v1/task/project.taskcluster.taskcluster-cli.latest/artifacts/public/linux-amd64/taskcluster
# Download the taskcluster : https://index.taskcluster.net/v1/task/project.taskcluster.taskcluster-cli.latest/artifacts/public/linux-amd64/taskcluster
# Save the file and make it executable it: chmod u+x taskcluster
# Save the file and make it executable it: chmod u+x taskcluster
# Create a 'bin' directory : mkdir ~/bin
# Put the taskcluster binary in your $PATH, usually ~/bin.
# Do a check to see if the file shows up in your $PATH by running : ls -al ~/bin.<br />
You should see the file called taskcluster there (double check that it can be executed by you)<br />
Because this file is now in your $PATH you can run it anytime, from within any directory.
* Install taskcluster libraries
* Install taskcluster libraries
# The second way is by installing it : pip install taskcluster==3.0.2
# The second way is by installing it : pip install taskcluster==3.0.2
Line 16: Line 21:
===== Authentication =====
===== Authentication =====
# Before running the command, check that you are logged on with your ldap on [https://tools.taskcluster.net/ taskcluster]
# Before running the command, check that you are logged on with your ldap on [https://tools.taskcluster.net/ taskcluster]
# Next we need to sign in, running the following command : <br />./taskcluster signin


In the browser a new page should have opened with all your taskcluster secrets and access groups. Scroll down until the bottom of the screen and check for a button called  '''Create client''', ''press it''. Now you are ready to run the script.
===== Getting taskcluster ready to run the script =====
# We need to sign in, running the following command :
    ./taskcluster signin
In the browser a new page should have opened with all your taskcluster secrets and access groups. Scroll down until the bottom of the screen and check for a button called  '''Create client''', ''press it''. <br />
You should get a new page saying that you can now close the URL. Your terminal should now have 3 new messages. 2 of them starting with 'export' and a 3rd line saying : "Credentials output as environment variables"<br />
Copy both lines, export TASKCLUSTER_CLIENT_ID='**********' and export TASKCLUSTER_ACCESS_TOKEN='*******************', into ~/.bashrc.<br />Also run them in the currently opened terminal.
You will not need to do the signin process again until the token expires. New terminals will also be able to run taskcluster commands thanks to the .bashrc file you've previously updated.
 
''Now you are ready to run the script.''


===== Running the script =====
===== Running the script =====
Line 27: Line 39:
===== Example =====
===== Example =====
In our case we needed to un-quarantine t-yosemite-r7-070 so the command looked like this :
In our case we needed to un-quarantine t-yosemite-r7-070 so the command looked like this :
* python quarantine_machines.py --enable --provisioner releng-hardware --worker-type gecko-t-osx-1010 --worker-group mdc1 t-yosemite-r7-070
  python quarantine_machines.py --enable --provisioner releng-hardware --worker-type gecko-t-osx-1010 --worker-group mdc1 t-yosemite-r7-070


Here is an other example, when we needed to un-quarantine multiple osx machines from mdc2 starting from 001 to 009 :
Here is an other example, when we needed to un-quarantine multiple osx machines from mdc2 starting from 001 to 009 :
* python quarantine_machines.py --enable --provisioner releng-hardware --worker-type gecko-t-osx-1010 --worker-group mdc2 t-yosemite-r7-00{1..9}
  python quarantine_machines.py --enable --provisioner releng-hardware --worker-type gecko-t-osx-1010 --worker-group mdc2 t-yosemite-r7-00{1..9}
 
See also : [[CIDuty:TaskClusterCli|CIDuty:TaskClusterCli]]
canmove, Confirmed users
112

edits