Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

PAI quota management #1021

Merged
merged 98 commits into from
May 27, 2019
Merged

PAI quota management #1021

merged 98 commits into from
May 27, 2019

Conversation

SparkSnail
Copy link
Contributor

@SparkSnail SparkSnail commented Apr 25, 2019

Manage hdfs of PAI using nnictl, support listing files, downloading files and deleting files in hdfs.
#1050

Shinai Yang (FA TALENT) added 2 commits May 6, 2019 15:17
@SparkSnail SparkSnail changed the title Manage hdfs files in nnictl PAI quota management May 6, 2019
docs/en_US/NNICTLDOC.md Outdated Show resolved Hide resolved
* __nnictl hdfs set__
* Description

set the host and userName of hdfs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please give simple example about what is the format of hdfs host

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given an example in the grid.


* Description

Clean up all files created by nni in hdfs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to make it more clear: Clean up the code files that nni automatically copied to hdfs. This command deletes all such files under the user_name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, changed to use Clean up the code files that nni automatically copied to hdfs. This command deletes all such files under the user_name.

return json.load(file)
except Exception:
return {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the meaning of return {}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return a None type or an empty dict if got error, changed to use None, more easy to understand.

return json.load(file)
except Exception:
return None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exception should be logged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

if hdfs_client.delete(full_path, recursive=True):
print_normal('delete success!')
else:
print_normal('delete failed!')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to show why failed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use <root_path>/* ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use <root_path>/* ?

Yes, but we want to show the details of deleting process, so we do not delete root_path directly, instead we traverse the paths under root_path, and show the paths to users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to show why failed?

No, this function return false if delete failed, but do not give error message and do not throw any exception.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@SparkSnail SparkSnail merged commit 966041b into microsoft:master May 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants