Skip to content

Commit

Permalink
Merge branch 'master' into support_old_torch
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim authored Apr 15, 2022
2 parents 1c2e365 + 0244694 commit 5eda5d7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/docker-nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Push Docker Nightly

on:
# run every day at 11:15am
schedule:
- cron: '15 11 * * *'
jobs:
nightly:
runs-on: ubuntu-18.04
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Checkout TorchServe
uses: actions/checkout@v2
- name: Login to Docker
env:
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: docker login --username pytorchbot --password "$DOCKER_PASSWORD"
- name: Push Docker Nightly
run: |
cd docker
python docker_nightly.py
12 changes: 12 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 0.5.3 | :white_check_mark: |


## Reporting a Vulnerability

If you find a serious vulnerability please report it to opensource@fb.com and torchserve@amazon.com
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ RUN TORCH_VER=$(curl --silent --location https://pypi.org/pypi/torch/json | pyth
else \
python -m pip install --no-cache-dir torch torchvision; \
fi; \
python -m pip install --no-cache-dir -r https://raw.githubusercontent.com/pytorch/serve/master/requirements/common.txt
python -m pip install --no-cache-dir -r https://raw.githubusercontent.com/pytorch/serve/master/requirements/common.txt \
# Install the CPU binary
else \
python -m pip install --no-cache-dir torch==$TORCH_VER+cpu torchvision==$TORCH_VISION_VER+cpu -f https://download.pytorch.org/whl/torch_stable.html; \
Expand Down
26 changes: 26 additions & 0 deletions docker/docker_nightly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from datetime import date
import os

def get_nightly_version():
today = date.today()
return today.strftime("%Y.%m.%d")

if __name__ == "__main__":
project = "torchserve-nightly"
cpu_version = f"{project}:cpu-{get_nightly_version()}"
gpu_version = f"{project}:gpu-{get_nightly_version()}"

# Build Nightly images and append the date in the name
os.system(f"./build_image.sh -bt dev -t pytorch/{cpu_version}")
os.system(f"./build_image.sh -bt dev -g -cv cu102 -t pytorch/{gpu_version}")

# Push Nightly images to official PyTorch Dockerhub account
for version in [cpu_version, gpu_version]:
os.system(f"docker push pytorch/{version}")

# Tag images with latest and push those as well
os.system(f"docker tag pytorch/{cpu_version} pytorch/{project}:latest-cpu")
os.system(f"docker tag pytorch/{gpu_version} pytorch/{project}:latest-gpu")

for version in ["latest-cpu", "latest-gpu"]:
os.system(f"docker push pytorch/{project}:{version}")

0 comments on commit 5eda5d7

Please sign in to comment.