Skip to content

feature: Add release to PyPI. Change package name to sagemaker-pytorch-inference. #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
recursive-include src/sagemaker_pytorch_serving_container *

include VERSION
include LICENSE
include README.rst

prune test

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
9 changes: 9 additions & 0 deletions buildspec-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 0.2

phases:
build:
commands:
- PACKAGE_FILE="$CODEBUILD_SRC_DIR_ARTIFACT_1/sagemaker_pytorch_inference-*.tar.gz"

# publish to pypi
- publish-pypi-package $PACKAGE_FILE
34 changes: 34 additions & 0 deletions buildspec-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 0.2

phases:
build:
commands:
# prepare the release (update versions, changelog etc.)
- git-release --prepare

# run linters
- tox -e flake8,twine

# run unit tests
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
tox -e py27,py36 -- test/unit

# run local integ tests
#- $(aws ecr get-login --no-include-email --region us-west-2)
#- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/local

# run sagemaker integ tests
#- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/sagemaker

# generate the distribution package
- python3 setup.py sdist

# publish the release to github
- git-release --publish

artifacts:
files:
- dist/sagemaker_pytorch_inference-*.tar.gz
name: ARTIFACT_1
discard-paths: yes
12 changes: 6 additions & 6 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ phases:
# run unit tests
- pytest test/unit

# create wheel in dist/
- python3 setup.py bdist_wheel
- whl_name=$(ls dist/sagemaker_pytorch_serving_container*.whl)
- cp $whl_name sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
# create tar in dist/
- python3 setup.py sdist
- tar_name=$(ls dist/sagemaker_pytorch_inference-*.tar.gz)
- cp $tar_name sagemaker_pytorch_inference.tar.gz

- cpu_dockerfile="Dockerfile.cpu"
- gpu_dockerfile="Dockerfile.gpu"

# build py2 images
- build_dir="docker/$FRAMEWORK_VERSION/py$CPU_PY2_VERSION"
- cp sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl $build_dir/
- cp sagemaker_pytorch_inference.tar.gz $build_dir/
- cp -r docker/build_artifacts/* $build_dir/
- CPU_PY2_TAG="$FRAMEWORK_VERSION-cpu-py2-$BUILD_ID"
- GPU_PY2_TAG="$FRAMEWORK_VERSION-gpu-py2-$BUILD_ID"
Expand All @@ -56,7 +56,7 @@ phases:

# build py3 image
- build_dir="docker/$FRAMEWORK_VERSION/py$GPU_PY3_VERSION"
- cp sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl $build_dir/
- cp sagemaker_pytorch_inference.tar.gz $build_dir/
- cp -r docker/build_artifacts/* $build_dir/
- CPU_PY3_TAG="$FRAMEWORK_VERSION-cpu-py3-$BUILD_ID"
- GPU_PY3_TAG="$FRAMEWORK_VERSION-gpu-py3-$BUILD_ID"
Expand Down
6 changes: 3 additions & 3 deletions docker/1.3.1/py2/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ COPY config.properties /home/model-server

RUN chmod +x /usr/local/bin/dockerd-entrypoint.py

COPY sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
COPY sagemaker_pytorch_inference.tar.gz /sagemaker_pytorch_inference.tar.gz
RUN pip install --no-cache-dir \
/sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl \
&& rm /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
/sagemaker_pytorch_inference.tar.gz \
&& rm /sagemaker_pytorch_inference.tar.gz

RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt

Expand Down
6 changes: 3 additions & 3 deletions docker/1.3.1/py2/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ RUN apt-get install -y --no-install-recommends \

# RUN pip install --no-cache-dir 'opencv-python>=4.0,<4.1'

COPY sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
COPY sagemaker_pytorch_inference.tar.gz /sagemaker_pytorch_inference.tar.gz
RUN pip install --no-cache-dir \
/sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl \
&& rm /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
/sagemaker_pytorch_inference.tar.gz \
&& rm /sagemaker_pytorch_inference.tar.gz

RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt

Expand Down
6 changes: 3 additions & 3 deletions docker/1.3.1/py3/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ COPY config.properties /home/model-server

RUN chmod +x /usr/local/bin/dockerd-entrypoint.py

COPY sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
COPY sagemaker_pytorch_inference.tar.gz /sagemaker_pytorch_inference.tar.gz
RUN pip install --no-cache-dir \
/sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl \
&& rm /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
/sagemaker_pytorch_inference.tar.gz \
&& rm /sagemaker_pytorch_inference.tar.gz

RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt

Expand Down
6 changes: 3 additions & 3 deletions docker/1.3.1/py3/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ COPY config.properties /home/model-server

RUN chmod +x /usr/local/bin/dockerd-entrypoint.py

COPY sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
COPY sagemaker_pytorch_inference.tar.gz /sagemaker_pytorch_inference.tar.gz
RUN pip install --no-cache-dir \
/sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl \
&& rm /sagemaker_pytorch_serving_container-1.3-py2.py3-none-any.whl
/sagemaker_pytorch_inference.tar.gz \
&& rm /sagemaker_pytorch_inference.tar.gz

RUN curl https://aws-dlc-licenses.s3.amazonaws.com/pytorch/license.txt -o /license.txt

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read(fname):


setup(
name='sagemaker_pytorch_serving_container',
name='sagemaker_pytorch_inference',
version='1.3',
description='Open source library for creating PyTorch containers to run on Amazon SageMaker.',

Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,13 @@ deps =
flake8
flake8-future-import
commands = flake8

[testenv:twine]
basepython = python3
# https://github.com/pypa/twine/blob/master/docs/changelog.rst
deps =
twine>=1.12.0
# https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup
commands =
python setup.py sdist
twine check dist/*.tar.gz