File tree Expand file tree Collapse file tree 5 files changed +48
-16
lines changed Expand file tree Collapse file tree 5 files changed +48
-16
lines changed Original file line number Diff line number Diff line change 1- name : Docker Container
1+ name : Publish Docker Containers
22
33on :
44 push :
@@ -10,18 +10,33 @@ jobs:
1010 build :
1111 runs-on : ubuntu-18.04
1212 steps :
13+ - name : Setup Python
14+ uses : actions/setup-python@v2
15+ with :
16+ python-version : 3.8
17+ architecture : x64
1318 - name : Checkout TorchX
1419 uses : actions/checkout@v2
20+ - name : Get TorchX version
21+ run : |
22+ set -eux
23+ python setup.py install
24+ echo "VERSION=$(python -c 'import torchx; print(torchx.__version__)')" >> $GITHUB_ENV
1525 - name : Configure Docker
16- env :
17- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
18- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1926 run : |
2027 set -eux
21- aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 495572122715.dkr.ecr.us-west-2.amazonaws.com
22- - name : Build container
23- run : torchx/runtime/container/build.sh
24- - name : Tag container
25- run : docker tag torchx ${{secrets.TORCHX_CONTAINER_REPO}}:latest
26- - name : Push container
27- run : docker push ${{secrets.TORCHX_CONTAINER_REPO}}:latest
28+ echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
29+ - name : Build torchx container
30+ run : |
31+ set -eux
32+ torchx/runtime/container/build.sh
33+ docker tag torchx "ghcr.io/pytorch/torchx:$VERSION"
34+ - name : Build examples container
35+ run : |
36+ set -eux
37+ docker build -t "ghcr.io/pytorch/torchx-examples:$VERSION" examples/apps/
38+ - name : Push containers
39+ run : |
40+ set -eux
41+ docker push "ghcr.io/pytorch/torchx-examples:$VERSION"
42+ docker push "ghcr.io/pytorch/torchx:$VERSION"
Original file line number Diff line number Diff line change 3232# docker containers. We have one container for the example apps and one for
3333# the standard built in apps. If you modify the torchx example code you'll
3434# need to rebuild the container before launching it on KFP
35+
36+ from torchx .version import TORCHX_IMAGE , EXAMPLES_IMAGE
37+
3538parser .add_argument (
3639 "--image" ,
3740 type = str ,
38- help = "docker image to use" ,
39- default = "495572122715.dkr.ecr.us-west-2.amazonaws.com/torchx/examples:latest" ,
41+ help = "docker image to use for the examples apps " ,
42+ default = EXAMPLES_IMAGE ,
4043)
4144parser .add_argument (
4245 "--torchx_image" ,
4346 type = str ,
44- help = "docker image to use" ,
45- default = "495572122715.dkr.ecr.us-west-2.amazonaws.com/torchx:latest" ,
47+ help = "docker image to use for the builtin torchx apps " ,
48+ default = TORCHX_IMAGE ,
4649)
4750
4851# %%
Original file line number Diff line number Diff line change 77from typing import Dict , Optional
88
99import torchx .specs as specs
10+ from torchx .version import TORCHX_IMAGE
1011
1112
1213def torchserve (
1314 model_path : str ,
1415 management_api : str ,
15- image : str = "495572122715.dkr.ecr.us-west-2.amazonaws.com/torchx:latest" ,
16+ image : str = TORCHX_IMAGE ,
1617 params : Optional [Dict [str , object ]] = None ,
1718) -> specs .AppDef :
1819 """Deploys the provided model to the given torchserve management API
Original file line number Diff line number Diff line change @@ -13,3 +13,11 @@ def test_can_get_version(self) -> None:
1313 import torchx
1414
1515 self .assertIsNotNone (torchx .__version__ )
16+
17+ def test_images (self ) -> None :
18+ from torchx .version import __version__ , TORCHX_IMAGE , EXAMPLES_IMAGE
19+
20+ self .assertEqual (TORCHX_IMAGE , f"ghcr.io/pytorch/torchx:{ __version__ } " )
21+ self .assertEqual (
22+ EXAMPLES_IMAGE , f"ghcr.io/pytorch/torchx-examples:{ __version__ } "
23+ )
Original file line number Diff line number Diff line change 1515# 0.1.0rcN # Release Candidate
1616# 0.1.0 # Final release
1717__version__ = "0.1.0.dev0"
18+
19+ # Use the github container registry images corresponding to the current package
20+ # version.
21+ TORCHX_IMAGE = f"ghcr.io/pytorch/torchx:{ __version__ } "
22+ EXAMPLES_IMAGE = f"ghcr.io/pytorch/torchx-examples:{ __version__ } "
You can’t perform that action at this time.
0 commit comments