Coder Social home page Coder Social logo

lstm-project's Introduction

lstm-project in Seoul

This is sample workflow for lstm-project

AWS S3 Bucket to Azure Blob Storage

Azure Function S3 to Blob project.

LSTM model

Set up DSVM - Linux Ubuntu, execute jupyter notebook on it
https://docs.microsoft.com/en-us/azure/machine-learning/data-science-virtual-machine/dsvm-ubuntu-intro

https://<VM DNS name or IP Address>:8000/
# remind "https"

Test Jupyter notebook version info.

import sys
sys.version

To execute LSTM model, clone and execute python file.

git clone https://github.com/CloudBreadPaPa/lstm-project.git
# setup conda env or python3.x
python lstm.py

Check lstm.py file and execute on DSVM or local python virtual env.

(Optional) Install azure ml service and workbench
https://docs.microsoft.com/en-us/azure/machine-learning/preview/quickstart-installation

Prepare K8S dhackfest

az aks install-cli

Azure Container Registry

  • Create Resource group
az group create --name myResourceGroup --location eastus
  • Create a container registry
az acr create --resource-group myResourceGroup --name myContainerRegistry007 --sku Basic
  • Login to ACR
az acr login --name <acrName>
  • Pull test docker image
docker pull microsoft/aci-helloworld
  • Get ACR Server info
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
  • Tag docker image and push
docker tag microsoft/aci-helloworld <acrLoginServer>/aci-helloworld:v1
docker push <acrLoginServer>/aci-helloworld:v1
  • List repo in Registry
az acr repository list --name <acrName> --output table

Azure Kubernetes Service - AKS

  • Check az cli version
az --version

2.0.21 or higher

  • Enable AKS preview
az provider register -n Microsoft.ContainerService
  • Create resource group
az group create --name myResourceGroup --location eastus
  • Create AKS cluster
az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 1 --generate-ssh-keys
  • Install kubectl for Azure cli
az aks install-cli
  • Get kubernetes cluster credential and config
az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
  • List kube node
kubectl get nodes
  • Create Azure Vote YAML
    apiVersion: apps/v1beta1
    kind: Deployment
    metadata:
      name: azure-vote-back
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            app: azure-vote-back
        spec:
          containers:
          - name: azure-vote-back
            image: redis
            ports:
            - containerPort: 6379
              name: redis
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: azure-vote-back
    spec:
      ports:
      - port: 6379
      selector:
        app: azure-vote-back
    ---
    apiVersion: apps/v1beta1
    kind: Deployment
    metadata:
      name: azure-vote-front
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            app: azure-vote-front
        spec:
          containers:
          - name: azure-vote-front
            image: microsoft/azure-vote-front:v1
            ports:
            - containerPort: 80
            env:
            - name: REDIS
              value: "azure-vote-back"
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: azure-vote-front
    spec:
      type: LoadBalancer
      ports:
      - port: 80
      selector:
        app: azure-vote-front
  • Run application
kubectl create -f azure-vote.yaml
  • Get service status
kubectl get service azure-vote-front --watch
  • Monitor
kubectl proxy
  • Delete cluster
az group delete --name myResourceGroup --yes --no-wait
  • Scale AKS node
az aks scale --resource-group=myResourceGroup --name=myAKSCluster --node-count 3
  • Manually scale pods
kubectl get pods
kubectl scale --replicas=5 deployment/azure-vote-front
kubectl get pods
  • Autoscale pods

Helm

helm init
  • Find helm chart
helm search
  • Helm repo update
helm repo update
  • Install from Helm
helm install stable/nginx-ingress

Jenkins Deployment

ssh -L 127.0.0.1:8080:localhost:8080 [email protected]
  • Login to Dashboard localhost:8080
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  • Error handle
unix /var/run/docker.sock: connect: permission denied Build step 'Execute shell' marked build as failure Finished: FAILURE
sudo usermod -a -G root jenkins
sudo service jenkins restart
sudo chmod 664 /var/run/docker.sock

How to create a development infrastructure on a Linux VM in Azure with Jenkins, GitHub, and Docker

Continuous deployment with Jenkins and Azure Container Service

https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-kubernetes-jenkins

ACS Engine

Config ACS Engine to deply GPU on cluster node
Microsoft Azure Container Service Engine - Kubernetes

az login
az account list -o table
acs-engine deploy --subscription-id <SUBSCRIPTION_ID> --dns-prefix <DNS_NAME> --location eastus --auto-suffix --api-model examples/kubernetes.json

acs-engine Kubernetes workthrough

Monitoring - Datadog

Persistent Volumn

Azure file or Azure Disk Reference link : https://kubernetes.io/docs/concepts/storage/persistent-volumes/

  • Create PVC
kubectl create -f deployment-storage.yaml
  • Get PVC
kubectl get pvc
  • Deploy MySQL w/ PVC
kubectl create -f deployment-mysql.yaml
  • Deploy Wordpress w/ PVC
kubectl create -f deployment-wordpress.yaml
  • Login to Wordpress and set data

  • Delete Pod and Services

kubectl delete pod wordpress
kubectl delete pod wordpress-mysql
kubectl delete services wordpress
kubectl delete services wordpress-mysql
kubectl delete deployment wordpress
kubectl delete deployment wordpress-mysql
  • Re-deploy and check the PV data

flask Machine Learning inference application

sample flask application using keras
https://blog.keras.io/building-a-simple-keras-deep-learning-rest-api.html

lstm-project's People

Contributors

cloudbreadpapa avatar

Watchers

James Cloos avatar  avatar

Forkers

taeyo

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.