Giter VIP home page Giter VIP logo

code-for-kubeflow-medium-article's Introduction

Kubeflow pipelines MNIST example

For further information about this repository, refer to the corresponding Medium article.

Prerequisites

Tested with:

  • Python: 3.8.16
  • Docker: 20.10.22
  • Kind 0.17.0

How to run

Setup Kubeflow pipelines

For information refer to the official documentation.

To summarize the steps:

kind create cluster

export PIPELINE_VERSION=1.8.5
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/platform-agnostic-pns?ref=$PIPELINE_VERSION"

# Wait a couple of minutes.
kubectl config set-context --current --namespace=kubeflow

# Port forwading for the UI
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80

Kubeflow UI will be at http://localhost:8080.

Setup venv

Local environment is set up by using make tool.

make

Build custom component

The task train_model involves component specification and docker registry. For further details refer to the official documentation or the Medium article.

Setup docker registry

kubectl -n kubeflow create secret docker-registry registry-secret \
--docker-server=https://index.docker.io/v1/ \
--docker-username=<username> \
--docker-password=<access-key> \
--docker-email=<email>

Build and push image

source venv/bin/activate
cd custom_components/train_model_component
kfp components build . --component-filepattern train_model.py
docker tag test_kubeflow_train_model:latest <username>/kubeflow:latest
docker push <username>/kubeflow:latest

Run

Make sure that the component metadata image name is correct, otherwise update it with the tag used to push the image into the Docker registry in the previous step.

source venv/bin/activate
python pipeline.py

Tear down environment

kind delete cluster

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Apache License 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.