Skip to content

Something like a .sagemakerignore file option to allow for skipping of certain directories when creating source tar #4187

@njbrake

Description

@njbrake

Describe the feature you'd like
Similar to how in Docker there is a .dockerignore file which works like a .gitignore file, It would be great if there was a .sagemakerignore file so that any directories listed in that file would be skipped when making the tar file. I believe it would be a simple change here:

def _list_files_to_compress(script, directory):

Basically adding a few lines that check for the existence of a .sagemakerignore file in the directory of the directory variable, if it exists, and then skipping anything listed out in that file.

How would this feature be used? Please describe.
This would be useful to reduce the size of the source tar file which would allow a person to speed up sagemaker build creation without the need to restructure their code, if they have big files in the source directory that they don't commit to other things like git and docker, so they don't want it put into the sagemaker tarball

Describe alternatives you've considered
An alternative is not doing it

Additional context
I don't mind writing the code to do this but wanted to check in that this was something that would be accepted if I make a PR for it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions