Skip to content

Commit 86efc1f

Browse files
committed
remove keras dependency and separate base image
Signed-off-by: Sunyanan Choochotkaew <[email protected]>
1 parent e04e863 commit 86efc1f

File tree

8 files changed

+18
-92
lines changed

8 files changed

+18
-92
lines changed

.github/workflows/docker-base-image.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- dockerfiles/requirements.txt
99
- dockerfiles/Dockerfile.base
1010

11+
env:
12+
IMAGE_VERSION: '0.6'
13+
1114
jobs:
1215
build:
1316

@@ -18,7 +21,7 @@ jobs:
1821

1922
- name: Build image
2023
run: |
21-
docker build -t quay.io/sustainable_computing_io/kepler_model_server_base:latest dockerfiles -f dockerfiles/Dockerfile.base
24+
docker build -t quay.io/sustainable_computing_io/kepler_model_server_base:v${{env.IMAGE_VERSION}} dockerfiles -f dockerfiles/Dockerfile.base
2225
2326
- name: Login to Quay
2427
if: ${{ (github.repository_owner == 'sustainable-computing-io') && (github.ref == 'refs/heads/main') }}
@@ -30,4 +33,5 @@ jobs:
3033

3134
- name: Push to quay
3235
if: ${{ (github.repository_owner == 'sustainable-computing-io') && (github.ref == 'refs/heads/main') }}
33-
run: docker push quay.io/sustainable_computing_io/kepler_model_server_base:latest
36+
run: |
37+
docker push quay.io/sustainable_computing_io/kepler_model_server_base:v${{env.IMAGE_VERSION}}

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 quay.io/sustainable_computing_io/kepler_model_server_base:latest
1+
FROM --platform=linux/amd64 quay.io/sustainable_computing_io/kepler_model_server_base:v0.6
22

33
WORKDIR /usr/local
44

dockerfiles/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 quay.io/sustainable_computing_io/kepler_model_server_base:latest
1+
FROM --platform=linux/amd64 quay.io/sustainable_computing_io/kepler_model_server_base:v0.6
22

33
WORKDIR /usr/local
44

dockerfiles/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
flask==2.1.2
2-
tensorflow==2.9.1
3-
keras==2.9.0
42
protobuf==3.19.4
53
pandas==1.4.4
64
numpy==1.22.4

src/estimate/model/estimate_common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
cpu_info = cpuinfo.get_cpu_info()
55

6-
if 'flags' in cpu_info and 'avx' in cpu_info['flags']:
7-
import keras
8-
from keras import backend as K
9-
else:
10-
print("AVX instructions are not available.")
11-
keras_enabled = False
6+
# if 'flags' in cpu_info and 'avx' in cpu_info['flags']:
7+
# import keras
8+
# from keras import backend as K
9+
# else:
10+
# print("AVX instructions are not available.")
11+
# keras_enabled = False
1212

1313
from sklearn.metrics import mean_squared_error, mean_absolute_error
1414

src/estimate/model/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
from prom_types import TIMESTAMP_COL, valid_container_query
1515

1616
from scikit_model import ScikitModel
17-
from keras_model import KerasModel
17+
# from keras_model import KerasModel
1818

1919
# model wrapper
2020
MODELCLASS = {
21-
'scikit': ScikitModel,
22-
'keras': KerasModel,
21+
'scikit': ScikitModel
22+
# 'keras': KerasModel,
2323
}
2424

2525
def default_predicted_col_func(energy_component):

tests/e2e_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ get_server_log() {
4545

4646
wait_for_kepler() {
4747
kubectl rollout status ds kepler-exporter -n kepler --timeout 5m
48-
kubectl get po -n kepler
4948
}
5049

5150
wait_for_server() {
@@ -63,6 +62,7 @@ wait_for_keyword() {
6362
if grep -q "$keyword" <<< $(get_${component}_log); then
6463
return
6564
fi
65+
kubectl get po -n kepler -oyaml
6666
sleep 2
6767
done
6868
echo "timeout ${num_iterations}s waiting for '${keyword}' from ${component} log"

tests/train_test.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)