Skip to content

Commit

Permalink
move code to src and add webapp files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pei-Yun Sun committed Oct 19, 2020
1 parent d3d3343 commit 3b4241f
Show file tree
Hide file tree
Showing 177 changed files with 523 additions and 185 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
105 changes: 105 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#! groovy

pipeline {

agent { label 'MeG' }

environment {
DOCKER_PULL_REPO='repo.eresearch.unimelb.edu.au:8000'
DOCKER_PUSH_REPO='repo.eresearch.unimelb.edu.au:8001'
DOCKER_IMAGE_NAME="happypet/webapp"
GPU_DOCKER_IMAGE_NAME="happypet/webapp-gpu"
BASE_IMAGE_NAME="happypet/tensorflow"
BASE_IMAGE_TAG="1.15.2-py3"
GPU_BASE_IMAGE_TAG="1.15.2-gpu-py3"
}

stages {
stage('Pull base image'){
steps {
ansiColor('xterm') {
script {
docker.withRegistry("https://${env.DOCKER_PULL_REPO}",'repo-credentials') {
script {
docker.image("${env.BASE_IMAGE_NAME}:${env.BASE_IMAGE_TAG}").pull()
docker.image("${env.BASE_IMAGE_NAME}:${env.GPU_BASE_IMAGE_TAG}").pull()
}
}
}
}
}
}

stage('Build only'){
when {
not {
anyOf {
branch 'master'
branch 'develop'
branch 'release'
}
}
}
steps {
ansiColor('xterm') {
script {
def version = sh(returnStdout: true, script:'git describe --tags --always').trim()
docker.withRegistry("https://${env.DOCKER_PUSH_REPO}",'repo-credentials') {
script {
docker.build("${env.DOCKER_IMAGE_NAME}:${version}",'-f docker/release/Dockerfile .')
docker.build("${env.GPU_DOCKER_IMAGE_NAME}:${version}",'-f docker/release_gpu/Dockerfile .')
}
}
}
}
}
}

stage('Build and Push'){
when {
anyOf {
branch 'master'
branch 'develop'
branch 'release'
}
}
steps {
ansiColor('xterm') {
script {
def version = sh(returnStdout: true, script:'git describe --tags --always').trim()
docker.withRegistry("https://${env.DOCKER_PUSH_REPO}",'repo-credentials') {
script {
docker.build("${env.DOCKER_IMAGE_NAME}:${version}",'-f docker/release/Dockerfile .')
.push()
docker.build("${env.DOCKER_IMAGE_NAME}:latest",'-f docker/release/Dockerfile .')
.push()
docker.build("${env.GPU_DOCKER_IMAGE_NAME}:${version}",'-f docker/release_gpu/Dockerfile .')
.push()
docker.build("${env.GPU_DOCKER_IMAGE_NAME}:latest",'-f docker/release_gpu/Dockerfile .')
.push()
}
}
}
}
}
}

stage('Deploy'){
when {
anyOf {
branch 'master'
branch 'develop'
}
}
steps {
ansiColor('xterm') {
script {
sshagent (credentials: ['960a6936-d2d3-4d24-b9bb-c19e33f467ed']) {
sh "ssh -o StrictHostKeyChecking=no happypet-real-dev.eresearch.unimelb.edu.au"
}
}
}
}
}
}
}
226 changes: 51 additions & 175 deletions README.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions build-base-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

DOCKER_BUILDKIT=1 docker build -t repo.eresearch.unimelb.edu.au:8001/happypet/tensorflow:1.15.2-py3 \
-t repo.eresearch.unimelb.edu.au:8000/happypet/tensorflow:1.15.2-py3 \
-f docker/base_image/Dockerfile .

DOCKER_BUILDKIT=1 docker build -t repo.eresearch.unimelb.edu.au:8001/happypet/tensorflow:1.15.2-gpu-py3 \
-t repo.eresearch.unimelb.edu.au:8000/happypet/tensorflow:1.15.2-gpu-py3 \
-f docker/base_image_gpu/Dockerfile .
15 changes: 15 additions & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

GIT_VERSION=$(git describe --tags --always --long)

docker build -t repo.eresearch.unimelb.edu.au:8001/happypet/webapp:$GIT_VERSION \
-t repo.eresearch.unimelb.edu.au:8000/happypet/webapp:$GIT_VERSION \
-t repo.eresearch.unimelb.edu.au:8001/happypet/webapp:latest \
-t repo.eresearch.unimelb.edu.au:8000/happypet/webapp:latest \
-f docker/release/Dockerfile .

docker build -t repo.eresearch.unimelb.edu.au:8001/happypet/webapp-gpu:$GIT_VERSION \
-t repo.eresearch.unimelb.edu.au:8000/happypet/webapp-gpu:$GIT_VERSION \
-t repo.eresearch.unimelb.edu.au:8001/happypet/webapp-gpu:latest \
-t repo.eresearch.unimelb.edu.au:8000/happypet/webapp-gpu:latest \
-f docker/release_gpu/Dockerfile .
12 changes: 12 additions & 0 deletions docker/base_image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM tensorflow/tensorflow:1.15.2-py3

RUN apt-get update; \
apt-get install -qy libsm6 libxext6 libxrender-dev; \
pip install --upgrade pip; \
pip install --no-cache-dir cmake; \
pip install --no-cache-dir opencv-python; \
pip install --no-cache-dir dlib==19.19.0; \
pip install --no-cache-dir pandas==1.0.0; \
rm -rf /var/lib/apt/lists/*

ENV TZ=Australia/Melbourne
1 change: 1 addition & 0 deletions docker/base_image/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
12 changes: 12 additions & 0 deletions docker/base_image_gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM tensorflow/tensorflow:1.15.2-gpu-py3

RUN apt-get update; \
apt-get install -qy libsm6 libxext6 libxrender-dev; \
pip install --upgrade pip; \
pip install --no-cache-dir cmake; \
pip install --no-cache-dir opencv-python; \
pip install --no-cache-dir dlib==19.19.0; \
pip install --no-cache-dir pandas==1.0.0; \
rm -rf /var/lib/apt/lists/*

ENV TZ=Australia/Melbourne
1 change: 1 addition & 0 deletions docker/base_image_gpu/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
11 changes: 11 additions & 0 deletions docker/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM repo.eresearch.unimelb.edu.au:8000/happypet/tensorflow:1.15.2-py3

WORKDIR /app

COPY ["./src", "requirements.txt", "./"]

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000

CMD ["python", "app.py"]
11 changes: 11 additions & 0 deletions docker/release_gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM repo.eresearch.unimelb.edu.au:8000/happypet/tensorflow:1.15.2-gpu-py3

WORKDIR /app

COPY ["./src", "requirements.txt", "./"]

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 5000

CMD ["python", "app.py"]
78 changes: 68 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,68 @@
numpy>=1.14.0
pandas>=0.23.4
gdown>=3.10.1
tqdm>=4.30.0
Pillow>=5.2.0
opencv-python>=3.4.4
tensorflow>=1.9.0
keras>=2.2.0
Flask>=1.1.2
mtcnn>=0.1.0
absl-py==0.9.0
astor==0.8.1
astunparse==1.6.3
cachetools==4.1.0
certifi==2020.4.5.1
chardet==3.0.4
Click==7.0
cycler==0.10.0
decorator==4.4.1
dlib==19.19.0
dnspython==2.0.0
face-recognition==1.2.3
face-recognition-models==0.3.0
Flask==1.1.1
flask-mongoengine==0.9.5
flask-restplus==0.13.0
gast==0.2.2
google-auth==1.14.1
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
grpcio==1.26.0
gunicorn==20.0.4
h5py==2.10.0
idna==2.9
imageio==2.6.1
imutils==0.5.3
itsdangerous==1.1.0
Jinja2==2.11.1
joblib==0.14.1
Keras==2.1.5
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.2
networkx==2.4
numpy==1.18.1
oauthlib==3.1.0
opencv-python==4.1.2.30
opt-einsum==3.1.0
pandas==1.0.0
Pillow==7.0.0
protobuf==3.11.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==2.4.6
python-dateutil==2.8.1
pytz==2019.3
PyWavelets==1.1.1
PyYAML==5.3
requests==2.23.0
requests-oauthlib==1.3.0
rsa==4.0
scikit-image==0.16.2
scikit-learn==0.22.1
scipy==1.4.1
six==1.14.0
sklearn==0.0
tensorboard==1.15.0
tensorboard-plugin-wit==1.6.0.post3
tensorflow==1.15.0
tensorflow-estimator==1.15.1
termcolor==1.1.0
urllib3==1.25.9
Werkzeug==0.16.1
wrapt==1.11.2
wikipedia==1.4.0
File renamed without changes.
Loading

0 comments on commit 3b4241f

Please sign in to comment.