Skip to content

Commit

Permalink
Merge pull request #59 from zooniverse/zoobot-upgrade-testing
Browse files Browse the repository at this point in the history
add user_identity to task for elivated permissions
  • Loading branch information
Tooyosi authored Dec 16, 2024
2 parents c17d99c + 0a751f0 commit ef44d00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bajor/batch/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ def create_batch_job(job_id, manifest_url, pool_id, checkpoint_target='ZOOBOT_CH
job.job_preparation_task = batchmodels.JobPreparationTask(
command_line=f'/bin/bash -c \"set -ex; {create_results_dir}; {copy_code_to_shared_dir}\"',
constraints=batchmodels.TaskConstraints(max_task_retry_count=3),
user_identity = batchmodels.UserIdentity(
auto_user=batchmodels.AutoUserSpecification(
scope=batchmodels.AutoUserScope.task,
elevation_level=batchmodels.ElevationLevel.non_admin
)
),
#
# A busted preparation task means the main task won't launch...ever!
# and leave the node in a scaled state costing $$ ££
Expand Down
6 changes: 6 additions & 0 deletions bajor/batch/train_finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ def create_batch_job(job_id, manifest_container_path, pool_id, checkpoint_target
job.job_preparation_task = batchmodels.JobPreparationTask(
command_line=f'/bin/bash -c \"set -ex; {setup_pytorch_kernel_cache_dir}; {create_results_dir}; {copy_code_to_shared_dir}\"',
constraints=batchmodels.TaskConstraints(max_task_retry_count=3),
user_identity = batchmodels.UserIdentity(
auto_user=batchmodels.AutoUserSpecification(
scope=batchmodels.AutoUserScope.task,
elevation_level=batchmodels.ElevationLevel.non_admin
)
),
#
# A busted preparation task means the main task won't launch...ever!
# and leave the node in a scaled state costing $$ ££
Expand Down

0 comments on commit ef44d00

Please sign in to comment.