From f623b17232ef4179fbd8507df4538ad9f255132f Mon Sep 17 00:00:00 2001
From: Byungheon Jeong <byungheon.jeong@gmail.com>
Date: Wed, 3 Jun 2020 16:53:55 -0700
Subject: [PATCH] initial

---
 .gitlab-ci.yml        | 14 ++++++++++++
 Dockerfile.dockerfile | 50 +++++++++++++++++++++++++++++++++++++++++++
 mxnetDeployment.yaml  | 46 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100755 .gitlab-ci.yml
 create mode 100755 Dockerfile.dockerfile
 create mode 100755 mxnetDeployment.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100755
index 0000000..bd58638
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,14 @@
+image: gcr.io/kaniko-project/executor:debug-v0.16.0
+   
+stages:
+  - build-and-push
+   
+build-and-push-job:
+  stage: build-and-push
+  except:
+    changes:
+      - "**/*.yaml"
+      - "README.md"
+  script:
+    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:8} --destination $CI_REGISTRY_IMAGE:latest
diff --git a/Dockerfile.dockerfile b/Dockerfile.dockerfile
new file mode 100755
index 0000000..2416acd
--- /dev/null
+++ b/Dockerfile.dockerfile
@@ -0,0 +1,50 @@
+FROM mxnet/python
+
+WORKDIR /userdata/kerasData/mxnet
+
+# Install system packages
+RUN apt-get update && apt-get install -y --no-install-recommends \
+      bzip2 \
+      g++ \
+      git \
+      graphviz \
+      libgl1-mesa-glx \
+      libhdf5-dev \
+      sudo\
+      openmpi-bin \
+      xvfb \
+      screen \
+      wget && \
+    rm -rf /var/lib/apt/lists/*
+
+
+# Install conda
+ENV CONDA_DIR /opt/conda
+ENV PATH $CONDA_DIR/bin:$PATH
+
+RUN wget --quiet --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \
+    echo "c59b3dd3cad550ac7596e0d599b91e75d88826db132e4146030ef471bb434e9a *Miniconda3-4.2.12-Linux-x86_64.sh" | sha256sum -c - && \
+    /bin/bash /Miniconda3-4.2.12-Linux-x86_64.sh -f -b -p $CONDA_DIR && \
+    rm Miniconda3-4.2.12-Linux-x86_64.sh && \
+    echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh
+
+ARG python_version=3.5.2
+
+RUN conda config --append channels conda-forge
+
+RUN conda install \
+      bcolz \
+      h5py \
+      matplotlib \
+      mkl \
+      nose \
+      notebook \
+      Pillow \
+      pandas \
+      pydot \
+      pygpu \
+      pyyaml \
+      scikit-learn \
+      six \
+      theano \
+      mkdocs \
diff --git a/mxnetDeployment.yaml b/mxnetDeployment.yaml
new file mode 100755
index 0000000..6641aee
--- /dev/null
+++ b/mxnetDeployment.yaml
@@ -0,0 +1,46 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: MXNET-gpu
+  namespace: digits
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      k8s-app: MXNET-gpu
+  template:
+    metadata:
+      labels:
+        k8s-app: MXNET-gpu
+    spec:
+      tolerations:
+      - key: "region"
+        operator: "Equal"
+        value: "allow"
+        effect: "NoSchedule"
+      containers:
+      - name: MXNET-gpu
+        image: gitlab-registry.nautilus.optiputer.net/ar-noc/MXNET:latest
+        securityContext:
+          capabilities:
+            add:
+              - NET_ADMIN
+        command: ["/bin/sh", "-c"]
+        args: ["sleep infinity"]
+        resources:
+          limits:
+            nvidia.com/gpu: 1
+            memory: "64Gi"
+            cpu: "8"
+          requests:
+            memory: "10Gi"
+            cpu: "2"
+
+        volumeMounts:
+        - mountPath: /userdata/kerasData
+          name: modeltraining
+      volumes:
+        - name: modeltraining
+          persistentVolumeClaim:
+            claimName: modeltraining
+            
-- 
GitLab