diff --git a/Dockerfile b/Dockerfile index 24b33a666..63473a4fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,7 +120,7 @@ COPY ./rastervision_aws_s3/requirements.txt /opt/src/s3-requirements.txt COPY ./rastervision_core/requirements.txt /opt/src/core-requirements.txt COPY ./rastervision_gdal_vsi/requirements.txt /opt/src/gdal-requirements.txt COPY ./rastervision_pipeline/requirements.txt /opt/src/pipeline-requirements.txt -COPY ./rastervision_sagemaker/requirements.txt /opt/src/sagemaker-requirements.txt +COPY ./rastervision_aws_sagemaker/requirements.txt /opt/src/sagemaker-requirements.txt COPY ./requirements-dev.txt /opt/src/requirements-dev.txt RUN --mount=type=cache,target=/root/.cache/pip cat batch-requirements.txt s3-requirements.txt core-requirements.txt gdal-requirements.txt pipeline-requirements.txt sagemaker-requirements.txt requirements-dev.txt | sort | uniq > all-requirements.txt && \ pip install $(grep -ivE "^\s*$|^#|rastervision_*" all-requirements.txt) && \ @@ -146,7 +146,7 @@ ENV PYTHONPATH=/opt/src/rastervision_aws_s3/:$PYTHONPATH ENV PYTHONPATH=/opt/src/rastervision_core/:$PYTHONPATH ENV PYTHONPATH=/opt/src/rastervision_gdal_vsi/:$PYTHONPATH ENV PYTHONPATH=/opt/src/rastervision_pipeline/:$PYTHONPATH -ENV PYTHONPATH=/opt/src/rastervision_sagemaker/:$PYTHONPATH +ENV PYTHONPATH=/opt/src/rastervision_aws_sagemaker/:$PYTHONPATH ENV PYTHONPATH=/opt/src/rastervision_pytorch_backend/:$PYTHONPATH ENV PYTHONPATH=/opt/src/rastervision_pytorch_learner/:$PYTHONPATH @@ -162,7 +162,7 @@ COPY ./rastervision_aws_s3/ /opt/src/rastervision_aws_s3/ COPY ./rastervision_core/ /opt/src/rastervision_core/ COPY ./rastervision_gdal_vsi/ /opt/src/rastervision_gdal_vsi/ COPY ./rastervision_pipeline/ /opt/src/rastervision_pipeline/ -COPY ./rastervision_sagemaker/ /opt/src/rastervision_sagemaker/ +COPY ./rastervision_aws_sagemaker/ /opt/src/rastervision_aws_sagemaker/ COPY ./rastervision_pytorch_backend/ /opt/src/rastervision_pytorch_backend/ COPY ./rastervision_pytorch_learner/ /opt/src/rastervision_pytorch_learner/ diff --git a/rastervision_sagemaker/MANIFEST.in b/rastervision_aws_sagemaker/MANIFEST.in similarity index 100% rename from rastervision_sagemaker/MANIFEST.in rename to rastervision_aws_sagemaker/MANIFEST.in diff --git a/rastervision_aws_sagemaker/rastervision/aws_sagemaker/__init__.py b/rastervision_aws_sagemaker/rastervision/aws_sagemaker/__init__.py new file mode 100644 index 000000000..ed29df887 --- /dev/null +++ b/rastervision_aws_sagemaker/rastervision/aws_sagemaker/__init__.py @@ -0,0 +1,24 @@ +# flake8: noqa + + +def register_plugin(registry): + from rastervision.aws_sagemaker.aws_sagemaker_runner import ( + AWS_SAGEMAKER, AWSSageMakerRunner) + registry.set_plugin_version('rastervision.aws_sagemaker', 0) + registry.add_runner(AWS_SAGEMAKER, AWSSageMakerRunner) + registry.add_rv_config_schema(AWS_SAGEMAKER, [ + 'exec_role', + 'cpu_image', + 'cpu_inst_type', + 'gpu_image', + 'gpu_inst_type', + ]) + + +import rastervision.pipeline +from rastervision.aws_sagemaker.aws_sagemaker_runner import * + +__all__ = [ + 'AWS_SAGEMAKER', + AWSSageMakerRunner.__name__, +] diff --git a/rastervision_sagemaker/rastervision/sagemaker/sagemaker_runner.py b/rastervision_aws_sagemaker/rastervision/aws_sagemaker/aws_sagemaker_runner.py similarity index 97% rename from rastervision_sagemaker/rastervision/sagemaker/sagemaker_runner.py rename to rastervision_aws_sagemaker/rastervision/aws_sagemaker/aws_sagemaker_runner.py index 0e86f3944..4362419f1 100644 --- a/rastervision_sagemaker/rastervision/sagemaker/sagemaker_runner.py +++ b/rastervision_aws_sagemaker/rastervision/aws_sagemaker/aws_sagemaker_runner.py @@ -16,7 +16,8 @@ from sagemaker.workflow.pipeline_context import _JobStepArguments log = logging.getLogger(__name__) -SAGEMAKER = 'sagemaker' + +AWS_SAGEMAKER = 'sagemaker' def make_step(step_name: str, cmd: List[str], role: str, image_uri: str, @@ -57,7 +58,7 @@ def make_step(step_name: str, cmd: List[str], role: str, image_uri: str, return step -class SageMakerRunner(Runner): +class AWSSageMakerRunner(Runner): """Runs pipelines remotely using AWS SageMaker. Requires Everett configuration of form: @@ -80,7 +81,7 @@ def run(self, num_splits: int = 1, pipeline_run_name: str = 'raster-vision'): - config = rv_config.get_namespace_config(SAGEMAKER) + config = rv_config.get_namespace_config(AWS_SAGEMAKER) exec_role = config('exec_role') cpu_image = config('cpu_image') cpu_inst_type = config('cpu_inst_type') diff --git a/rastervision_sagemaker/requirements.txt b/rastervision_aws_sagemaker/requirements.txt similarity index 100% rename from rastervision_sagemaker/requirements.txt rename to rastervision_aws_sagemaker/requirements.txt diff --git a/rastervision_sagemaker/setup.py b/rastervision_aws_sagemaker/setup.py similarity index 89% rename from rastervision_sagemaker/setup.py rename to rastervision_aws_sagemaker/setup.py index 590eab7b3..c73ba4b1e 100644 --- a/rastervision_sagemaker/setup.py +++ b/rastervision_aws_sagemaker/setup.py @@ -9,9 +9,9 @@ all_reqs = f.read().split('\n') install_requires = [x.strip() for x in all_reqs if 'git+' not in x] -name = 'rastervision_sagemaker' +name = 'rastervision_aws_sagemaker' version = '0.21' -description = 'A rastervision plugin that adds a SageMaker pipeline runner' +description = 'A rastervision plugin that adds an AWS SageMaker pipeline runner' setup( name=name, diff --git a/rastervision_sagemaker/rastervision/sagemaker/__init__.py b/rastervision_sagemaker/rastervision/sagemaker/__init__.py deleted file mode 100644 index 0353fc3d2..000000000 --- a/rastervision_sagemaker/rastervision/sagemaker/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# flake8: noqa - - -def register_plugin(registry): - from rastervision.sagemaker.sagemaker_runner import (SAGEMAKER, - SageMakerRunner) - registry.set_plugin_version('rastervision.sagemaker', 0) - registry.add_runner(SAGEMAKER, SageMakerRunner) - registry.add_rv_config_schema(SAGEMAKER, [ - 'exec_role', - 'cpu_image', - 'cpu_inst_type', - 'gpu_image', - 'gpu_inst_type', - ]) - - -import rastervision.pipeline -from rastervision.sagemaker.sagemaker_runner import * - -__all__ = [ - 'SAGEMAKER', - SageMakerRunner.__name__, - # submit_job.__name__, -]