Skip to content

Commit a301d22

Browse files
praveennhiremathprhirema
andauthored
Foodwinepairing Build Optimization (#311)
* Added the print statement to check the execution flow. * Changes for Food and Wine Pairing Module * New Python Project for Food Wine Pairing - AI/ML Added a service for Food Wine pairing. Calling service from InventoryServiceOrderEventConsumer. Service finds the suitable wines for the Food item and send the recommendedWines to user. * Added sk-learn library and changed python to 3.7 * Given permission to sh files before commiting and deleted unnecessary files. * added sh files of 777 permissions from Paul. * install python 3.7 - Docker file updated * install python using apt * removed rm yum * Added RUN each line to know the exact line errors * removed sudo in Docker file and added apt-get update * changed python3.7 to python. * changed python version to initial one 3.6 * removed python-oci-sdk * updated with python 3.7 workaround * removed FROM oraclelinux:7-slim, added FROM ubuntu:18.04, to resolve apt issue * set python 3.7 as defaukt * fetched the latest code and updated foodwinepairing deployment yaml file * returned no wines suggested * initialized client with client builder * added kubectl apply in deploy.sh * changed hostname to localhost * reverted url. * cleared DB related stuffs in deployment yaml file * cleared non-required configs from deployment yaml file * added cx_oracle * imported WineFoodPairings file in app.py * added install pandas and numpy * added nltk * added matplotlib * added ipython * Assigned input to test food * Fixed the issues which were there in 1st working version * Added foodwinepairing-python in undeploy.sh * Added the config for calling foodwinepairing service * Added isSuggestiveSaleAIEnabled config in inventory-helidon deployment yaml * corrected indentation of isSuggestiveSaleAIEnabled value * added the same content from main branch to resolve conflicts * added foodwinepairing-python * removed foodwinepairing-python * Added foodwinepairing-python after resolving conflict * removed the sysout statements * removed foodwinepairing-python from grabdish/deploy.sh * Stopwords and Tokenizers config kept only for English. Removed for other languages. * Revert "Stopwords and Tokenizers config kept only for English. Removed for other languages." This reverts commit 4b203c1. * Removed the non-english stopwords and tokenizers which are used during model creation * Optimized the food wine pairing build. Using the oraclelinux:7-slim, python 3.6 Removed redundant software installtion like numpy(comes in gensim only) Co-authored-by: prhirema <prhirema@PRHIREMA-IN.oradev.oraclecorp.com>
1 parent be0c156 commit a301d22

File tree

3 files changed

+20
-35
lines changed

3 files changed

+20
-35
lines changed

grabdish/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
#MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon inventory-springboot"
6-
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
6+
MS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon foodwinepairing-python"
77
for s in $MS; do
88
echo ________________________________________
99
echo "Deploying $s..."

grabdish/foodwinepairing-python/Dockerfile

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,29 @@
1-
FROM ubuntu:18.04
1+
FROM oraclelinux:7-slim
22

33
ARG release=19
44
ARG update=9
55

6+
RUN yum -y install oracle-release-el7 && \
7+
yum-config-manager --enable ol7_oracle_instantclient && \
8+
yum -y install oracle-instantclient${release}.${update}-basiclite && \
9+
yum install -y oracle-epel-release-el7
10+
611
WORKDIR /app
712
COPY foodwinepairing/requirements.txt .
813

9-
# Update apt packages
10-
RUN apt update
11-
RUN apt upgrade -y
12-
13-
# Install python 3.7
14-
RUN apt install software-properties-common -y
15-
RUN add-apt-repository ppa:deadsnakes/ppa
16-
RUN apt install python3.7 -y
17-
18-
# Make python 3.7 the default
19-
RUN echo "alias python=python3.7" >> ~/.bashrc
20-
RUN export PATH=${PATH}:/usr/bin/python3.7
21-
RUN /bin/bash -c "source ~/.bashrc"
22-
23-
# Add 3.7 to the available alternatives
24-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
25-
26-
# Set python3.7 as the default python
27-
RUN update-alternatives --set python /usr/bin/python3.7
28-
29-
# Install pip
30-
RUN apt install python3-pip -y
31-
RUN python -m pip install --upgrade pip
14+
RUN yum install -y tar && \
15+
yum install -y python36 && \
16+
rm -rf /var/cache/yum && \
17+
python3.6 -m pip install -U pip setuptools
3218

3319
#wine-pairing dependencies
34-
RUN python -m pip install -U gensim
35-
RUN python -m pip install -U scikit-learn
36-
RUN python -m pip install -U pandas
37-
RUN python -m pip install -U numpy
38-
RUN python -m pip install -U nltk
39-
RUN python -m pip install -U matplotlib
40-
RUN python -m pip install -U ipython
41-
RUN python -m pip install -r requirements.txt
20+
RUN python3.6 -m pip install -U gensim && \
21+
python3.6 -m pip install -U scikit-learn && \
22+
python3.6 -m pip install -U pandas && \
23+
python3.6 -m pip install -U nltk && \
24+
python3.6 -m pip install -U matplotlib && \
25+
python3.6 -m pip install -U ipython && \
26+
python3.6 -m pip install -r requirements.txt
4227

4328
#to locate if/where gunicorn is
4429
RUN find / -name "gunicorn"

workshops/dcms-oci/source.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ mkdir -p $DCMS_STATE_STORE $DCMS_STATE $DCMS_VAULT $DCMS_BACKGROUND_BUILDS $DCMS
9191
# Setup background build lists
9292
export LABS_WITH_BUILDS="Lab2 Lab3 Lab7"
9393
export LAB2_JAVA_BUILDS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
94-
export LAB2_NON_JAVA_BUILDS=""
95-
#export LAB2_NON_JAVA_BUILDS="foodwinepairing-python"
94+
#export LAB2_NON_JAVA_BUILDS=""
95+
export LAB2_NON_JAVA_BUILDS="foodwinepairing-python"
9696
export LAB3_JAVA_BUILDS="inventory-helidon-se inventory-micronaut inventory-quarkus"
9797
export LAB3_NON_JAVA_BUILDS="inventory-python inventory-nodejs inventory-dotnet inventory-go inventory-plsql"
9898
export LAB7_JAVA_BUILDS="order-mongodb-kafka inventory-postgres-kafka"

0 commit comments

Comments
 (0)