Ignore files when creating snapshot
It is good to exclude some files (e.g. __pycache__) when creating the component snapshot. Put an .amlignore or .gitignore file to to base folder of the component source folder to ignore the uneeded files. Refer to the AzureML doc for detailed introduction of .amlignore.
Ignore files in subdirectory
Similar to git ignore logic, ignore file in subdirectory is also supported. Component CLI will look from each subdirectory up to code directory for ignore files.
If we have the following project structure:
...
src/
...
.amlignore
.amlignore
Both .amlignore and src/.amlignore works when building the component snapshot.
Sample component
Refer to here to see an example usage of .amlignore file.
In src/component_entry/component_sepc.yaml we set code directory to .., so src/ will be the project’s root directory.
Both src/.amlignore and src/library1/.amlignore works, see src/.build for whole built snapshot.