Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Update release scripts #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions release/demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
app_export
bake_demo_stage.sh
1 change: 1 addition & 0 deletions release/demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM ${ROOT}

ADD ./app_export /var/lib/deepomatic

ENV INIT_SYSTEM none
ENV AUTOSTART_WORKER true
ENV DEEPOMATIC_STORAGE_DIR /var/lib/deepomatic/services/worker-nn
ENV WORKFLOWS_PATH /var/lib/deepomatic/services/worker-nn/resources/workflows.json
20 changes: 14 additions & 6 deletions release/demo/bake_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@

set -e

DEMO_IMAGE_NAME=deepomatic/nutanix-app-demo:0.1.0-gesture
DEMO_IMAGE_NAME=${DEMO_IMAGE_NAME:-deepomatic/nutanix-app-demo:0.1.0-gesture}
echo "Docker image ${DEMO_IMAGE_NAME}"

ROOT=`pwd`/$(dirname $0)
EXPORT_DIR=${ROOT}/app_export
source ${ROOT}/../scripts/common.sh

echo "Exporting resources to ${EXPORT_DIR}"
rm -rf ${EXPORT_DIR}

CID=$(docker run --rm -d \
CMD="docker run --rm -d \
-v ${EXPORT_DIR}:/app \
-e DOWNLOAD_ON_STARTUP=1 \
-e INIT_SYSTEM=circus \
-e DEEPOMATIC_APP_ID=${NUTANIX_RUNTIME_APP_ID} \
-e DEEPOMATIC_API_KEY=${NUTANIX_RUNTIME_API_KEY} \
-e DEEPOMATIC_SITE_ID=${NUTANIX_RUNTIME_SITE_ID} \
${RESOURCE_SERVER_VERSION})

while [ ! `docker exec ${CID} ls /tmp/resource-server-ready` ]; do
echo "not ready"
${RESOURCE_SERVER_VERSION}"
echo "Runing $CMD"
CID=$($CMD)

DONE="0"
while [ "$DONE" = "0" ]; do
DONE=$(docker logs $CID 2>&1 | grep "Sending start to service worker-nn" | wc -l | sed "s/ *//g")
sleep 1
echo "Waiting until download resource complete"
done
docker stop $CID

docker build -t ${DEMO_IMAGE_NAME} --build-arg ROOT=${NEURAL_WORKER_VERSION} .

Expand Down
4 changes: 2 additions & 2 deletions release/demo/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
value: "1"
- name: PROCESS_EACH_N_FRAMES
value: "30"
- name: CROP_ASPECT_RATIO
value: "1.33333" # 4 / 3
# - name: CROP_ASPECT_RATIO
# value: "1.33333" # 4 / 3

- name: neural-worker
image: deepomatic/nutanix-app-demo:0.1.0-gesture
Expand Down
49 changes: 49 additions & 0 deletions release/demo/stage-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${DEPLOYMENT_NAME}
labels:
app: ${DEPLOYMENT_NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ${DEPLOYMENT_NAME}
template:
metadata:
labels:
app: ${DEPLOYMENT_NAME}
spec:
restartPolicy: Always

containers:
- name: runtime
image: ${DOCKER_IMAGE_NAME}
imagePullPolicy: Always
env:
- name: AMQP_URL
value: amqp://user:password@localhost:5672/nutanix
- name: DRAW_DEMO
value: "1"
- name: PROCESS_EACH_N_FRAMES
value: "30"

- name: neural-worker
image: deepomatic/nutanix-app-demo:0.1.0-stage
imagePullPolicy: Always
env:
- name: ALLOW_NO_GPU
value: "1"
- name: AMQP_URL
value: amqp://user:password@localhost:5672/nutanix

- name: rabbitmq
image: rabbitmq:3.6
imagePullPolicy: Always
env:
- name: RABBITMQ_DEFAULT_USER
value: user
- name: RABBITMQ_DEFAULT_PASS
value: password
- name: RABBITMQ_DEFAULT_VHOST
value: nutanix
2 changes: 1 addition & 1 deletion release/runtime/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
- name: AMQP_URL
value: amqp://user:password@localhost:5672/nutanix
- name: PROCESS_EACH_N_FRAMES
value: "50"
value: "30"
# [PRODUCTION] For production: remove the 'DRAW_DEMO' line below.
# The data forwarded by deepomatic App will then be a JSON dump of the recognition output.
# Refer to the documentation for a specification of the output:
Expand Down
4 changes: 4 additions & 0 deletions release/scripts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all:
./make_nutanix_manifest.sh deepomatic-demo-app ../demo/manifest.yml ../generated/deepomatic-demo-manifest.yml
./make_nutanix_manifest.sh deepomatic-demo-app ../demo/stage-manifest.yml ../generated/deepomatic-stage-manifest.yml
./make_nutanix_manifest.sh deepomatic-runtime-app ../runtime/manifest.yml ../generated/deepomatic-app-manifest.yml
5 changes: 3 additions & 2 deletions release/scripts/make_nutanix_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set -e

source $(dirname $0)/common.sh

TEMPLATE=$1
OUTPUT=$2
export DEPLOYMENT_NAME=$1
TEMPLATE=$2
OUTPUT=$3

eval "cat <<EOF
$(<${TEMPLATE})
Expand Down