NSS
NSS

Reputation: 2022

Azure batch Application package not getting copied to Working Directory of Task

I have created Azure Batch pool with Linux Machine and specified Application Package for the Pool.

My command line is

command='python $AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py',
python3: can't open file '$AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py': 
[Errno 2] No such file or directory

when i connect to node and look at working directory non of the Application Package files are present there.

How do i make sure that files from Application Package are available in working directory or I can invoke/execute files under Application Package from command line ?

Upvotes: 2

Views: 2529

Answers (2)

A. Scobie
A. Scobie

Reputation: 13

On Linux, the application package with version string is formatted as:

AZ_BATCH_APP_PACKAGE_{0}_{1}

On Windows it is formatted as:

AZ_BATCH_APP_PACKAGE_APPLICATIONID#version

Where 0 is the application name and 1 is the version.

$AZ_BATCH_APP_PACKAGE_scriptv1_1 will take you to the root folder where the application was unzipped.

Does this "exact" path exist in that location?

tasks/XXX/get_XXXXX_data.py

You can see more information here:

https://learn.microsoft.com/en-us/azure/batch/batch-application-packages

Edit: Just saw this question: "or can I invoke/execute files under Application Package from command line"

Yes you can invoke and execute files from the application package directory with the environment variable above.

If you type env on the node you will see the environment variables that have been set.

Upvotes: 1

Tats_innit
Tats_innit

Reputation: 34107

Make sure that your async operation have proper await in place before you start using the package in your code.

Also please share your design \ pseudo-code scenario and how you are approaching it as a design?

Further to add:

Seems like this one is pool level package.

  • The error seems like that the application env variable is either incorrectly used or there is some other user level issue. Please checkout linmk below and specially the section where use of env variable is mentioned.

This seems like user level issue because In case of downloading the package resource, if there will be an error it will be visible to you via exception handler or at the tool level is you are using batch explorer \ Batch-labs or code level exception handling.

Reason \ Rationale:

I once created a small sample to help peeps around so this resource might help you to checkeout the use here.

Hope rest helps.

Upvotes: 1

Related Questions