Skip to content

Commit

Permalink
Merge pull request #2 from berndverst/master
Browse files Browse the repository at this point in the history
A few changes to use PVC, new container registry
  • Loading branch information
aronchick authored May 16, 2019
2 parents 7454253 + f12225b commit 6910846
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
28 changes: 15 additions & 13 deletions code/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
)
def dogsandcats_train(
persistent_volume_name='azure',
persistent_volume_path='/mnt/azure'
persistent_volume_path='/mnt/azure',
base_path='/mnt/azure',
epochs=5,
batch=32,
Expand All @@ -20,7 +20,7 @@ def dogsandcats_train(
# preprocess data
operations['preprocess'] = dsl.ContainerOp(
name='preprocess',
image='tlaloc.azurecr.io/kubeflow/preprocess',
image='kubeflowregistry.azurecr.io/kubeflow/preprocess',
command=['python'],
arguments=[
'/scripts/data.py',
Expand All @@ -35,7 +35,7 @@ def dogsandcats_train(
# train
operations['train'] = dsl.ContainerOp(
name='train',
image='tlaloc.azurecr.io/kubeflow/train',
image='kubeflowregistry.azurecr.io/kubeflow/train',
command=['python'],
arguments=[
'/scripts/train.py',
Expand All @@ -54,7 +54,7 @@ def dogsandcats_train(
# score
operations['score'] = dsl.ContainerOp(
name='score',
image='tlaloc.azurecr.io/kubeflow/score',
image='kubeflowregistry.azurecr.io/kubeflow/score',
command=['python'],
arguments=[
'/scripts/score.py',
Expand All @@ -67,7 +67,7 @@ def dogsandcats_train(
#release
operations['release'] = dsl.ContainerOp(
name='release',
image='tlaloc.azurecr.io/kubeflow/release',
image='kubeflowregistry.azurecr.io/kubeflow/release',
command=['python'],
arguments=[
'/scripts/release.py',
Expand All @@ -80,15 +80,17 @@ def dogsandcats_train(

for _, op in operations.items():
op.add_volume(
k8s_client.V1Volume(
host_path=k8s_client.V1HostPathVolumeSource(
path=persistent_volume_path),
name=persistent_volume_name)
) \
.add_volume_mount(k8s_client.V1VolumeMount(
k8s_client.V1Volume(
name=persistent_volume_name,
persistent_volume_claim=k8s_client.V1PersistentVolumeClaimVolumeSource(
claim_name='azure-managed-disk')
)
).add_volume_mount(k8s_client.V1VolumeMount(
mount_path=persistent_volume_path,
name=persistent_volume_name))
name=persistent_volume_name)
)


if __name__ == '__main__':
import kfp.compiler as compiler
compiler.Compiler().compile(dogsandcats_train, __file__ + '.tar.gz')
compiler.Compiler().compile(dogsandcats_train, __file__ + '.tar.gz')
4 changes: 2 additions & 2 deletions code/preprocess/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
IMAGE=tlaloc.azurecr.io/kubeflow/preprocess
docker build -t $IMAGE . && docker run -it $IMAGE
IMAGE=kubeflowregistry.azurecr.io/kubeflow/preprocess
docker build -t $IMAGE . && docker run -it $IMAGE
4 changes: 2 additions & 2 deletions code/release/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
IMAGE=tlaloc.azurecr.io/kubeflow/release
docker build -t $IMAGE . && docker run -it --privileged --env-file aml.env $IMAGE
IMAGE=kubeflowregistry.azurecr.io/kubeflow/release
docker build -t $IMAGE . && docker run -it --privileged --env-file aml.env $IMAGE
4 changes: 2 additions & 2 deletions code/scoring/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
IMAGE=tlaloc.azurecr.io/kubeflow/score
docker build -t $IMAGE . && docker run -it $IMAGE
IMAGE=kubeflowregistry.azurecr.io/kubeflow/score
docker build -t $IMAGE . && docker run -it $IMAGE
4 changes: 2 additions & 2 deletions code/training/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
IMAGE=tlaloc.azurecr.io/kubeflow/train
docker build -t $IMAGE . && docker run -it --privileged --env-file blob.env $IMAGE
IMAGE=kubeflowregistry.azurecr.io/kubeflow/train
docker build -t $IMAGE . && docker run -it --privileged --env-file blob.env $IMAGE
11 changes: 11 additions & 0 deletions kubernetes/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: azure-managed-disk
spec:
accessModes:
- ReadWriteOnce
storageClassName: managed-premium
resources:
requests:
storage: 300Gi

0 comments on commit 6910846

Please sign in to comment.