Closed shreyb closed 1 month ago
Did a lot of cleanup, and added error handling. Ready to test on the following cases:
--force
(should not prompt for deletion, then delete)--no-delete
(should not prompt for deletion, and should not delete)--force
and --no-delete
(same as (4))-name
) (should prompt, ONLY delete on specified schedd. Set this up by submitting jobs to multiple schedds using -n
, --schedd-for-testing
flags for 2 schedds.)-name
), --no-delete
(should prompt, NOT delete anything. Set this up by submitting jobs to multiple schedds using -n
, --schedd-for-testing
flags for 2 schedds.)-name
), --force
(should not prompt, ONLY delete on specified schedd. Set this up by submitting jobs to multiple schedds using -n
, --schedd-for-testing
flags for 2 schedds.)-name
), --force
, --no-delete
(should not prompt, NOT delete anything. Set this up by submitting jobs to multiple schedds using -n
, --schedd-for-testing
flags for 2 schedds.)All tests pass:
$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab
This will delete all of your tokens on the following schedds: schedd04.domain, schedd05.domain, schedd01.domain, schedd02.domain, schedd03.domain.
Are you sure you want to proceed (Y/n)? n
Not deleting tokens.
$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab
This will delete all of your tokens on the following schedds: schedd04.domain, schedd05.domain, schedd01.domain, schedd02.domain, schedd03.domain.
Are you sure you want to proceed (Y/n)? Y
Schedds to clean: ['schedd04.domain', 'schedd05.domain', 'schedd01.domain', 'schedd02.domain', 'schedd03.domain']
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
credentials on schedd02.domain:
credentials on schedd03.domain:
fermilab.top = 1727294118
fermilab.use = 1727464408
Running: _condor_CREDD_HOST=schedd03.domain condor_store_cred delete-oauth -s fermilab
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
After:
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
credentials on schedd02.domain:
credentials on schedd03.domain:
Done.
Setup: pushed hypotpro managed token to dev machine, then got bearer token with that.
$ jobsub_lite/bin/jobsub_cleanup_cred -G hypot --role production
This will delete all of your tokens on the following schedds: schedd04.domain, schedd05.domain, schedd01.domain, schedd02.domain, schedd03.domain.
Are you sure you want to proceed (Y/[n])? Y
Schedds to clean: ['schedd04.domain', 'schedd05.domain', 'schedd01.domain', 'schedd02.domain', 'schedd03.domain']
credentials on schedd04.domain:
hypot_production.top = 1727409512
hypot_production.use = 1727465182
hypot_production_af81385931.top = 1726319073
hypot_production_af81385931.use = 1727465490
Running: _condor_CREDD_HOST=schedd04.domain condor_store_cred delete-oauth -s hypot_production -H af81385931
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
Running: _condor_CREDD_HOST=schedd04.domain condor_store_cred delete-oauth -s hypot -H production
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
credentials on schedd05.domain:
hypot_production.top = 1727409512
hypot_production.use = 1727464294
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s hypot -H production
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
credentials on schedd01.domain:
hypot_production.top = 1727370751
hypot_production.use = 1727465254
Running: _condor_CREDD_HOST=schedd01.domain condor_store_cred delete-oauth -s hypot -H production
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
credentials on schedd02.domain:
hypot_production.top = 1727409510
hypot_production.use = 1727464295
Running: _condor_CREDD_HOST=schedd02.domain condor_store_cred delete-oauth -s hypot -H production
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
credentials on schedd03.domain:
hypot_production.top = 1727409511
hypot_production.use = 1727464657
Running: _condor_CREDD_HOST=schedd03.domain condor_store_cred delete-oauth -s hypot -H production
Account: <current> (hypotpro)
CredType: oauth
Operation succeeded.
After:
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
credentials on schedd02.domain:
credentials on schedd03.domain:
Done.
$
--force
(should not prompt for deletion, then delete) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab --force
Schedds to clean: ['schedd04.domain', 'schedd05.domain', 'schedd01.domain', 'schedd02.domain', 'schedd03.domain']
credentials on schedd04.domain:
credentials on schedd05.domain:
fermilab.top = 1727465661
fermilab.use = 1727465662
fermilab_941320c798.top = 1727465661
fermilab_941320c798.use = 1727465662
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
credentials on schedd01.domain:
credentials on schedd02.domain:
credentials on schedd03.domain:
After:
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
credentials on schedd02.domain:
credentials on schedd03.domain:
Done.
--no-delete
(should not prompt for deletion, and should not delete) - PASS - mods made$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab --no-delete
Schedds to clean: ['schedd04.domain', 'schedd05.domain', 'schedd01.domain', 'schedd02.domain', 'schedd03.domain']
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
fermilab.top = 1727465805
fermilab.use = 1727465805
fermilab_941320c798.top = 1727465805
fermilab_941320c798.use = 1727465805
I would run: _condor_CREDD_HOST=schedd01.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
I would run: _condor_CREDD_HOST=schedd01.domain condor_store_cred delete-oauth -s fermilab
credentials on schedd02.domain:
credentials on schedd03.domain:
--no-delete was specified, so no credentials were deleted. Done.
--force
and --no-delete
(same as (4)) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab --no-delete --force
Schedds to clean: ['schedd04.domain', 'schedd05.domain', 'schedd01.domain', 'schedd02.domain', 'schedd03.domain']
credentials on schedd04.domain:
credentials on schedd05.domain:
credentials on schedd01.domain:
fermilab.top = 1727465805
fermilab.use = 1727465805
fermilab_941320c798.top = 1727465805
fermilab_941320c798.use = 1727465805
I would run: _condor_CREDD_HOST=schedd01.domain condor_store_cred delete-oauth -s fermilab
I would run: _condor_CREDD_HOST=schedd01.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
credentials on schedd02.domain:
credentials on schedd03.domain:
--no-delete was specified, so no credentials were deleted. Done.
-name
) (should prompt, ONLY delete on specified schedd. Set this up by submitting jobs to multiple schedds using --schedd-for-testing
flags for 2 schedds.) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab -name schedd05.domain
This will delete all of your tokens on the following schedds: schedd05.domain.
Are you sure you want to proceed (Y/[n])? Y
Schedds to clean: ['schedd05.domain']
credentials on schedd05.domain:
fermilab.top = 1727466325
fermilab.use = 1727466325
fermilab_941320c798.top = 1727466325
fermilab_941320c798.use = 1727466327
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
After:
credentials on schedd05.domain:
Done.
-name
), --no-delete
(should prompt, NOT delete anything. Set this up by submitting jobs to multiple schedds using --schedd-for-testing
flags for 2 schedds.) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab -name schedd05.domain --no-delete
Schedds to clean: ['schedd05.domain']
credentials on schedd05.domain:
fermilab.top = 1727466374
fermilab.use = 1727466375
fermilab_941320c798.top = 1727466374
I would run: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab
I would run: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
--no-delete was specified, so no credentials were deleted. Done.
-name
), --force
(should not prompt, ONLY delete on specified schedd. Set this up by submitting jobs to multiple schedds using --schedd-for-testing
flags for 2 schedds.) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab -name schedd05.domain --force
Schedds to clean: ['schedd05.domain']
credentials on schedd05.domain:
fermilab.top = 1727466374
fermilab.use = 1727466375
fermilab_941320c798.top = 1727466374
fermilab_941320c798.use = 1727466379
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
Running: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab
Account: <current> (<user>)
CredType: oauth
Operation succeeded.
After:
credentials on schedd05.domain:
Done.
Had credds on schedd01, and they were left alone.
-name
), --force
, --no-delete
(should not prompt, NOT delete anything. Set this up by submitting jobs to multiple schedds using --schedd-for-testing
flags for 2 schedds.) - PASS$ jobsub_lite/bin/jobsub_cleanup_cred -G fermilab -name schedd05.domain --force --no-delete
Schedds to clean: ['schedd05.domain']
credentials on schedd05.domain:
fermilab.top = 1727466516
fermilab.use = 1727466516
fermilab_941320c798.top = 1727466516
fermilab_941320c798.use = 1727466517
I would run: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab -H 941320c798
I would run: _condor_CREDD_HOST=schedd05.domain condor_store_cred delete-oauth -s fermilab
--no-delete was specified, so no credentials were deleted. Done.
I made a few UX modifications after tests, but it looks fine. Ready for PR.
@kherner reported this issue. He was trying to remove DUNE production credentials from the jobsub schedds, and got this error. This is a known issue, and I thought we had a bug open for it, but it looks like we don't. Here was the stderr: