Comments (6)
@rupertnash sorry for the slow response on this -- do you mean that you want the ability to specify a different account for the coordination commandline and the normal commandline?
If all you want is to control both, you can use CloudTask.UserIdentity
to do it. See the documentation here for C#
from azure-batch-samples.
@matthchr - sorry Matt, I'm afraid I don't follow (possibly as I've never used C#) how that allows me to set the coordination command to run as a different user.
AFAIK, you set the multi-instance settings on an instance of azure.batch.models.MultiInstanceSettings
- allowed attributes are: coordination_command_line, number_of_instances, common_resource_files (note nothing about which user account to use).
Then you give this to the multi_instance_settings
attribute of your azure.batch.models.TaskAddParameter
, along with a suitable user_identity
object.
For now I am just running my tasks an administrator and prefacing the task's command line with sudo -u _azbatch
, which is pretty disgusting.
from azure-batch-samples.
Hey @rupertnash - Sorry, I didn't realize you were using Python (I would've given snippets in that language if I had).
In Python, to configure the user the task runs under, you need to set:
azure.batch.models.TaskAddParameter.user_identity
- you can read more about this parameter on readthedocs.
So basically you would set both the multi_instance_settings
attribute of TaskAddParameter
and the user_identity
attribute as well. user_identity
applies to the whole task and will run both the multi_instance_settings.coordination_command_line
and the command_line
in the user you request (or if you don't want to name a user/etc you can use an AutoUser
which basically means we generate a user for you but with the criteria you specify.
from azure-batch-samples.
Hi Matt,
So basically you would set both the multi_instance_settings attribute of TaskAddParameter and the user_identity attribute as well. user_identity applies to the whole task and will run both the multi_instance_settings.coordination_command_line and the command_line in the user you request (or if you don't want to name a user/etc you can use an AutoUser which basically means we generate a user for you but with the criteria you specify.
Yes, this is what I said. I'm well aware that Batch will run both commands as the user specified - this is my problem.
I want to run my task as the default non-privileged user (_azbatch
) and the coordination command as a user with admin rights. The reason is that I have a trusted coordination command (necessary to arrange the shared filesystem) and an untrusted user command.
from azure-batch-samples.
I see - in that case we don't currently support that scenario other than by having you manually sudo like you're doing in the coordination command.
I'll ask around and see if we have any plans to implement this and get back to you.
from azure-batch-samples.
I've moved this issue to Azure/Batch#12.
from azure-batch-samples.
Related Issues (20)
- "TypeError" exception when running sample1_helloword.py. HOT 1
- Cannot run CSharp/GettingStarted/01HelloWorld.csproj
- Java sample code fails to get batchUrl HOT 4
- C++ samples
- Access Linked Storage Account HOT 1
- add sample for Docker
- Azure batch -python running flask app in node and hitting it via flask
- How to upload applicationPackage to be installed on each node of the pool HOT 2
- 'BatchServiceClientConfiguration' object has no attribute 'signed_session'
- accountsettings null HOT 2
- Python Batch samples - please update to azure.storage.blob v12+ HOT 1
- CSharp/GettingStarted/02_PoolsAndResourceFiles throws NotFound for stdout.txt when run a 2nd time
- Hello world is insanely complex for a hello world
- How to use ILogger for AppInsights logs with azure batch
- Support for dotnet-sdk 3.1
- Loading mpi modules in Azure Batch with Ubuntu-hpc image
- Update samples to use VirtualMachineConfiguration
- BatchManagementClient example uses ADAL, which is out of support in December 2022 HOT 1
- OnAllTasksComplete.TerminateJob inconsistent
- Microsoft.Azure.Management.Batch - Deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-batch-samples.