{"id":15710455,"url":"https://github.com/aws/sagemaker-chainer-container","last_synced_at":"2025-03-17T15:31:10.952Z","repository":{"id":37664125,"uuid":"123468942","full_name":"aws/sagemaker-chainer-container","owner":"aws","description":"Docker container for running Chainer scripts to train and host Chainer models on SageMaker","archived":false,"fork":false,"pushed_at":"2023-04-10T08:53:09.000Z","size":18001,"stargazers_count":18,"open_issues_count":2,"forks_count":23,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-15T23:44:17.471Z","etag":null,"topics":["aws","chainer","docker","sagemaker"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-01T17:30:26.000Z","updated_at":"2024-04-28T18:59:25.000Z","dependencies_parsed_at":"2024-10-27T15:16:05.864Z","dependency_job_id":"f050ec31-cbae-40a2-946c-01228e3422c0","html_url":"https://github.com/aws/sagemaker-chainer-container","commit_stats":{"total_commits":129,"total_committers":18,"mean_commits":7.166666666666667,"dds":0.813953488372093,"last_synced_commit":"9691299317362cb9943a2542fb910b333c597812"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fsagemaker-chainer-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fsagemaker-chainer-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fsagemaker-chainer-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Fsagemaker-chainer-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws","download_url":"https://codeload.github.com/aws/sagemaker-chainer-container/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243865657,"owners_count":20360480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","chainer","docker","sagemaker"],"created_at":"2024-10-03T21:08:10.697Z","updated_at":"2025-03-17T15:31:09.621Z","avatar_url":"https://github.com/aws.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==========================\nSageMaker Chainer Containers\n==========================\n\nSageMaker Chainer Containers is an open source library for making the\nChainer framework run on Amazon SageMaker.\n\nThis repository also contains Dockerfiles which install this library, Chainer, and dependencies\nfor building SageMaker Chainer images.\n\nFor information on running Chainer jobs on SageMaker: `Python\nSDK \u003chttps://github.com/aws/sagemaker-python-sdk#chainer-sagemaker-estimators\u003e`__.\n\nFor notebook examples: `SageMaker Notebook\nExamples \u003chttps://github.com/awslabs/amazon-sagemaker-examples\u003e`__.\n\nTable of Contents\n-----------------\n\n#. `Getting Started \u003c#getting-started\u003e`__\n#. `Building your Image \u003c#building-your-image\u003e`__\n#. `Running the tests \u003c#running-the-tests\u003e`__\n\nGetting Started\n---------------\n\nPrerequisites\n~~~~~~~~~~~~~\n\nMake sure you have installed all of the following prerequisites on your\ndevelopment machine:\n\n- `Docker \u003chttps://www.docker.com/\u003e`__\n\nFor Testing on GPU\n^^^^^^^^^^^^^^^^^^\n\n-  `Nvidia-Docker \u003chttps://github.com/NVIDIA/nvidia-docker\u003e`__\n\nRecommended\n^^^^^^^^^^^\n\n-  A python environment management tool. (e.g.\n   `PyEnv \u003chttps://github.com/pyenv/pyenv\u003e`__,\n   `VirtualEnv \u003chttps://virtualenv.pypa.io/en/stable/\u003e`__)\n\nBuilding your image\n-------------------\n\n`Amazon SageMaker \u003chttps://aws.amazon.com/documentation/sagemaker/\u003e`__\nutilizes Docker containers to run all training jobs \u0026 inference endpoints.\n\nThe Docker images are built from the Dockerfiles specified in\n`Docker/ \u003chttps://github.com/aws/sagemaker-chainer-container/tree/master/docker\u003e`__.\n\nThe Docker files are grouped based on Chainer version and separated\nbased on Python version and processor type.\n\nThe Docker images, used to run training \u0026 inference jobs, are built from\nboth corresponding \"base\" and \"final\" Dockerfiles.\n\nBase Images\n~~~~~~~~~~~\n\nThe \"base\" Dockerfile encompass the installation of the framework and all of the dependencies\nneeded.\n\nTagging scheme is based on \u003cChainer_version\u003e-\u003cprocessor\u003e-\u003cpython_version\u003e. (e.g. 4.1.0-cpu-py3)\n\nAll \"final\" Dockerfiles build images using base images that use the tagging scheme\nabove.\n\nIf you want to build your base docker image, then use:\n\n::\n\n    # You need to build the base image from the same directory as the dockerfile\n    cd sagemaker-chainer-container/docker/base\n\n    # CPU\n    docker build -t chainer-base:\u003cChainer_version\u003e-cpu-\u003cpython_version\u003e -f Dockerfile.cpu .\n\n    # GPU\n    docker build -t chainer-base:\u003cChainer_version\u003e-gpu-\u003cpython_version\u003e -f Dockerfile.gpu .\n\n::\n\n    # Example\n\n    # CPU\n    docker build -t chainer-base:4.1.0-cpu-py3 -f Dockerfile.cpu .\n\n    # GPU\n    docker build -t chainer-base:4.1.0-gpu-py3 -f Dockerfile.gpu .\n\nFinal Images\n~~~~~~~~~~~~\n\nThe \"final\" Dockerfiles encompass the installation of the SageMaker specific support code.\n\nAll \"final\" Dockerfiles use `base images for building \u003chttps://github\n.com/aws/sagemaker-chainer-container/blob/master/docker/4.1.0/final/py3/Dockerfile.cpu#L1\u003e`__.\n\nThese \"base\" images are specified with the naming convention of\nchainer-base:\u003cChainer_version\u003e-\u003cprocessor\u003e-\u003cpython_version\u003e.\n\nBefore building \"final\" images:\n\nBuild your \"base\" image. Make sure it is named and tagged in accordance with your \"final\"\nDockerfile.\n\n\n::\n\n    # Create the SageMaker Chainer Container Python package.\n    cd sagemaker-chainer-container\n    python setup.py bdist_wheel\n\nIf you want to build \"final\" Docker images, then use:\n\n::\n\n    # This build instruction assumes you're building from the repository root directory\n\n    # CPU\n    docker build -t \u003cimage_name\u003e:\u003ctag\u003e -f docker/\u003cChainer_version\u003e/final/\u003cpython_version\u003e/Dockerfile.cpu .\n\n    # GPU\n    docker build -t \u003cimage_name\u003e:\u003ctag\u003e -f docker/\u003cChainer_version\u003e/final/\u003cpython_version\u003e/Dockerfile.gpu .\n\n::\n\n    # Example\n\n    # CPU\n    docker build -t preprod-chainer:4.1.0-cpu-py3 -f docker/4.1.0/final/py3/Dockerfile.cpu .\n\n    # GPU\n    docker build -t preprod-chainer:4.1.0-gpu-py3 -f docker/4.1.0/final/py3/Dockerfile.gpu .\n\n\nRunning the tests\n-----------------\n\nRunning the tests requires installation of the SageMaker Chainer Container code and its test\ndependencies.\n\n::\n\n    git clone https://github.com/aws/sagemaker-chainer-container.git\n    cd sagemaker-chainer-container\n    pip install -e .[test]\n\nTests are defined in\n`test/ \u003chttps://github.com/aws/sagemaker-chainer-container/tree/master/test\u003e`__\nand include unit, local integration, and SageMaker integration tests.\n\nUnit Tests\n~~~~~~~~~~\n\nIf you want to run unit tests, then use:\n\n::\n\n    # All test instructions should be run from the top level directory\n\n    pytest test/unit\n\nLocal Integration Tests\n~~~~~~~~~~~~~~~~~~~~~~~\n\nRunning local integration tests require `Docker \u003chttps://www.docker.com/\u003e`__ and `AWS\ncredentials \u003chttps://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html\u003e`__,\nas the local integration tests make calls to a couple AWS services. The local integration tests and\nSageMaker integration tests require configurations specified within their respective\n`conftest.py \u003chttps://github.com/aws/sagemaker-chainer-container/blob/master/test/conftest.py\u003e`__.\n\nLocal integration tests on GPU require `Nvidia-Docker \u003chttps://github.com/NVIDIA/nvidia-docker\u003e`__.\n\nBefore running local integration tests:\n\n#. Build your Docker image.\n#. Pass in the correct pytest arguments to run tests against your Docker image.\n\nIf you want to run local integration tests, then use:\n\n::\n\n    # Required arguments for integration tests are found in test/conftest.py\n\n    pytest test/integration/local --docker-base-name \u003cyour_docker_image\u003e \\\n                      --tag \u003cyour_docker_image_tag\u003e \\\n                      --py-version \u003c2_or_3\u003e \\\n                      --framework-version \u003cChainer_version\u003e \\\n                      --processor \u003ccpu_or_gpu\u003e\n\n::\n\n    # Example\n    pytest test/integration/local --docker-base-name preprod-chainer \\\n                      --tag 1.0 \\\n                      --py-version 3 \\\n                      --framework-version 4.1.0 \\\n                      --processor cpu\n\nSageMaker Integration Tests\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSageMaker integration tests require your Docker image to be within an `Amazon ECR repository \u003chttps://docs\n.aws.amazon.com/AmazonECS/latest/developerguide/ECS_Console_Repositories.html\u003e`__.\n\nThe Docker-base-name is your `ECR repository namespace \u003chttps://docs.aws.amazon\n.com/AmazonECR/latest/userguide/Repositories.html\u003e`__.\n\nThe instance-type is your specified `Amazon SageMaker Instance Type\n\u003chttps://aws.amazon.com/sagemaker/pricing/instance-types/\u003e`__ that the SageMaker integration test will run on.\n\nBefore running SageMaker integration tests:\n\n#. Build your Docker image.\n#. Push the image to your ECR repository.\n#. Pass in the correct pytest arguments to run tests on SageMaker against the image within your ECR repository.\n\nIf you want to run a SageMaker integration end to end test on `Amazon\nSageMaker \u003chttps://aws.amazon.com/sagemaker/\u003e`__, then use:\n\n::\n\n    # Required arguments for integration tests are found in test/conftest.py\n\n    pytest test/integration/sagemaker --aws-id \u003cyour_aws_id\u003e \\\n                           --docker-base-name \u003cyour_docker_image\u003e \\\n                           --instance-type \u003camazon_sagemaker_instance_type\u003e \\\n                           --tag \u003cyour_docker_image_tag\u003e \\\n\n::\n\n    # Example\n    pytest test/integration/sagemaker --aws-id 12345678910 \\\n                           --docker-base-name preprod-chainer \\\n                           --instance-type ml.m4.xlarge \\\n                           --tag 1.0\n\nContributing\n------------\n\nPlease read\n`CONTRIBUTING.md \u003chttps://github.com/aws/sagemaker-chainer-container/blob/master/CONTRIBUTING.md\u003e`__\nfor details on our code of conduct, and the process for submitting pull\nrequests to us.\n\nLicense\n-------\n\nSageMaker Chainer Containers is licensed under the Apache 2.0 License. It is copyright 2018 Amazon\n.com, Inc. or its affiliates. All Rights Reserved. The license is available at:\nhttp://aws.amazon.com/apache2.0/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Fsagemaker-chainer-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws%2Fsagemaker-chainer-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Fsagemaker-chainer-container/lists"}