You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@liminal.apache.org by as...@apache.org on 2022/06/06 18:25:31 UTC
[incubator-liminal] 01/01: sagemaker example - working containers
This is an automated email from the ASF dual-hosted git repository.
assafpinhasi pushed a commit to branch sagemaker_example
in repository https://gitbox.apache.org/repos/asf/incubator-liminal.git
commit cf0fe8b3a320e58f5bf0b13b9ec2c8a8ca1588fa
Author: assafpin <as...@gmail.com>
AuthorDate: Mon Jun 6 21:25:13 2022 +0300
sagemaker example - working containers
---
.../sagemaker_example/archetype/liminal.yaml | 29 ++++-
.../sagemaker_example/data_preparation/__init__.py | 0
.../data_preparation/data_preparation.py | 58 ++++++++++
.../data_preparation/data_uploader.py | 67 +++++++++++
examples/sagemaker_example/inference.py | 68 +++++++++++
examples/sagemaker_example/liminal.yaml | 72 ++++++++++++
examples/sagemaker_example/liminal_sm.py | 56 ++++++++++
examples/sagemaker_example/requirements.txt | 4 +
examples/sagemaker_example/sm_ops.py | 124 +++++++++++++++++++++
examples/sagemaker_example/train/__init__.py | 0
examples/sagemaker_example/train/train.py | 87 +++++++++++++++
liminal/build/image/python/Dockerfile | 8 +-
.../python_server/python_server_requirements.txt | 2 +-
13 files changed, 568 insertions(+), 7 deletions(-)
diff --git a/liminal/build/image/python_server/python_server_requirements.txt b/examples/sagemaker_example/archetype/liminal.yaml
similarity index 59%
copy from liminal/build/image/python_server/python_server_requirements.txt
copy to examples/sagemaker_example/archetype/liminal.yaml
index f27ab17..9923464 100644
--- a/liminal/build/image/python_server/python_server_requirements.txt
+++ b/examples/sagemaker_example/archetype/liminal.yaml
@@ -1,4 +1,3 @@
-#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -16,5 +15,29 @@
# specific language governing permissions and limitations
# under the License.
-Flask==1.1.1
-pyyaml
+---
+
+# superliminal for local development
+name: InfraSageMaker
+owner: Bosco Albert Baracus
+type: super
+executors:
+ - executor: k8s
+ type: kubernetes
+variables:
+ output_root_dir: /mnt/smvolume
+ input_root_dir: ''
+ sagemaker_role: arn:aws:iam::468326661668:role/AWSSageMakerExecutionRole
+images:
+ - image: my_sm_image
+ source: .
+ type: python
+ no_cache: true
+task_defaults:
+ python:
+ executor: k8s
+ application_source: '{{application}}'
+ mounts:
+ - mount: mymount
+ volume: smvolume
+ path: /mnt/smvolume
\ No newline at end of file
diff --git a/examples/sagemaker_example/data_preparation/__init__.py b/examples/sagemaker_example/data_preparation/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/examples/sagemaker_example/data_preparation/data_preparation.py b/examples/sagemaker_example/data_preparation/data_preparation.py
new file mode 100644
index 0000000..9ff9eff
--- /dev/null
+++ b/examples/sagemaker_example/data_preparation/data_preparation.py
@@ -0,0 +1,58 @@
+import argparse
+import os
+import pandas as pd
+from sklearn.model_selection import train_test_split
+from data_preparation.data_uploader import get_uploader
+from pathlib import Path
+
+TEST_CSV = "diamonds_test.csv"
+
+TRAIN_CSV = "diamonds_train.csv"
+
+LABEL_COLUMN = 'price'
+
+DATASET_PUBLIC_URL="https://www.openml.org/data/get_csv/21792853/dataset"
+
+def transform(data):
+ X = data.drop(columns=LABEL_COLUMN)
+ y = data[LABEL_COLUMN]
+
+ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3,
+ random_state=42)
+ train = X_train.copy()
+ train[LABEL_COLUMN] = y_train
+
+ test = X_test.copy()
+ test[LABEL_COLUMN] = y_test
+ return train, test
+
+
+def extract(input_uri):
+ return pd.read_csv(input_uri)
+
+
+def load(train, test, output_uri_base, data_uploader):
+ train.to_csv(TRAIN_CSV)
+ test.to_csv(TEST_CSV)
+ train_path = data_uploader.upload(TRAIN_CSV, os.path.join(output_uri_base, "train"))
+ test_path = data_uploader.upload(TEST_CSV, os.path.join(output_uri_base, "test"))
+ return train_path, test_path
+
+
+def data_pipeline(input_uri, output_uri_base, data_uploader):
+ data = extract(input_uri)
+ train, test = transform(data)
+ return load(train, test, output_uri_base, data_uploader)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--input_uri",
+ default=DATASET_PUBLIC_URL)
+ parser.add_argument("--output_uri_base",
+ default=f"file://{Path(__file__).parent.parent.absolute().joinpath('data')}",
+ help="a uri starting with 's3', 'file' or a relative path "
+ "which will be treated as sagemaker prefix")
+ args = parser.parse_args()
+ data_uploader = get_uploader(args.output_uri_base)
+ data_pipeline(args.input_uri, args.output_uri_base, data_uploader)
diff --git a/examples/sagemaker_example/data_preparation/data_uploader.py b/examples/sagemaker_example/data_preparation/data_uploader.py
new file mode 100644
index 0000000..7a23119
--- /dev/null
+++ b/examples/sagemaker_example/data_preparation/data_uploader.py
@@ -0,0 +1,67 @@
+import os
+from abc import ABC, abstractmethod
+from urllib.parse import urlparse
+import sagemaker
+import boto3
+
+import shutil
+
+
+def get_uploader(output_uri_base):
+ o = urlparse(output_uri_base)
+ if o.scheme == 's3':
+ return S3DataUploader()
+ elif o.scheme == "file":
+ return LocalDataUploader()
+ return SagemakerDataUploader()
+
+
+class DataUploader(ABC):
+
+ def __init__(self):
+ pass
+
+ @abstractmethod
+ def upload(self, local_path, output_uri_base):
+ pass
+
+
+class LocalDataUploader(DataUploader):
+ s3_client = None
+
+ def upload(self, local_path, output_uri_base):
+ o = urlparse(output_uri_base)
+ os.makedirs(o.path, exist_ok=True)
+ shutil.copy2(local_path, o.path)
+ return o.path
+
+class S3DataUploader(DataUploader):
+ s3_client = None
+
+ def __init__(self):
+ self.s3_client = boto3.client('s3')
+
+ def upload(self, local_path, output_uri_base):
+ o = urlparse(output_uri_base)
+ response = self.s3_client.upload_file(local_path, o.netloc, o.path)
+
+
+class SagemakerDataUploader(DataUploader):
+ sm_client = None
+ sm_session = None
+ region = None
+ default_bucket = None
+
+ def __init__(self):
+ self.sm_client = boto3.client("sagemaker")
+ self.sm_session = sagemaker.Session()
+ self.region = self.sm_session.boto_session.region_name
+ self.default_bucket = self.sm_session.default_bucket()
+
+ def upload(self, local_path, output_uri_base):
+ o = urlparse(output_uri_base)
+ bucket = o.netloc or self.default_bucket
+ return self.sm_session.upload_data(
+ path=local_path, bucket=bucket, key_prefix=o.path
+ )
+
diff --git a/examples/sagemaker_example/inference.py b/examples/sagemaker_example/inference.py
new file mode 100644
index 0000000..9b766d3
--- /dev/null
+++ b/examples/sagemaker_example/inference.py
@@ -0,0 +1,68 @@
+import argparse
+import os
+from io import BytesIO
+import pandas as pd
+import numpy as np
+
+import joblib
+
+
+feature_column_names = [
+ 'carat',
+ 'cut',
+ 'color',
+ 'clarity',
+ 'depth',
+ 'table',
+ 'x',
+ 'y',
+ 'z'
+]
+
+
+categorical_cols = ['cut', 'clarity', 'color']
+
+MODEL_JOBLIB_FILENAME = "model.joblib"
+
+
+def model_fn(model_dir):
+ clf = joblib.load(os.path.join(model_dir, MODEL_JOBLIB_FILENAME))
+ return clf
+
+
+def input_fn(input_data, content_type):
+ if content_type == "application/x-npy":
+ load_bytes = BytesIO(input_data)
+ input_np = np.load(load_bytes, allow_pickle=True)
+ df = pd.DataFrame(data=input_np, columns=feature_column_names)
+ return df
+ else:
+ raise ValueError(f"content type {content_type} is not supported by this inference endpoint. Please send a legal application/x-npy payload")
+
+
+def predict_fn(input_data, model):
+ prediction = model.predict(input_data[feature_column_names])
+ return prediction
+
+
+def df_to_inference_input():
+ X_train = df[feature_column_names]
+ rows = X_train.head(10)
+ inference_input = rows.to_numpy()
+ np_bytes = BytesIO()
+ np.save(np_bytes, inference_input, allow_pickle=True)
+ input_data = input_fn(np_bytes.getvalue(), "application/x-npy")
+ return input_data
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--model-dir", type=str, default=os.getenv("SM_MODEL_DIR", "../data"))
+ parser.add_argument("--data-path", type=str, default=f"../data/test/diamonds_test.csv")
+ args = parser.parse_args()
+ model = model_fn(args.model_dir)
+ df = pd.read_csv(args.data_path)
+ input_data = df_to_inference_input()
+ predictions = predict_fn(input_data, model)
+ print(predictions)
+
diff --git a/examples/sagemaker_example/liminal.yaml b/examples/sagemaker_example/liminal.yaml
new file mode 100644
index 0000000..bd3f254
--- /dev/null
+++ b/examples/sagemaker_example/liminal.yaml
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+---
+name: SageMakerExample
+super: InfraSageMaker
+owner: Bosco Albert Baracus
+images:
+ - image: my_sm_image
+ python_version: 3.8
+ source: .
+ type: python
+ no_cache: true
+task_defaults:
+ python:
+ mounts:
+ - mount: mymount
+ volume: smvolume
+ path: /mnt/smvolume
+pipelines:
+ - pipeline: sagemaker_diamonds_train_and_inference
+ start_date: 1970-01-01
+ timeout_minutes: 45
+ schedule: 0 * 1 * *
+ tasks:
+ - task: data_preprocessing
+ type: python
+ description: prepare the data for training
+ cmd: python -u liminal_sm.py --action train data_prep --output_uri_base liminal-sm-example/data
+ env:
+ COMM_PATH: /mnt/smvolume
+ SM_ROLE: '{{sagemaker_role}}'
+ - task: train
+ type: python
+ description: train model
+ cmd: python -u liminal_sm.py --action train --base_job_name liminal-base_training_job --train_instance_type ml.m5.large --n_jobs 5
+ env:
+ COMM_PATH: /mnt/smvolume
+ SM_ROLE: '{{sagemaker_role}}'
+ - task: deploy
+ type: python
+ description: Deploy model
+ cmd: python -u liminal_sm.py --action deploy --model_name liminal-sm-diamonds-model --deploy_instance_type ml.m5.large
+ env:
+ COMM_PATH: /mnt/smvolume
+ SM_ROLE: '{{sagemaker_role}}'
+ - task: validate
+ type: python
+ description: validate model post deployment
+ cmd: python -u liminal_sm.py --action validate
+ env:
+ COMM_PATH: /mnt/smvolume
+ SM_ROLE: '{{sagemaker_role}}'
+volumes:
+ - volume: smvolume
+ claim_name: smvolume-pvc
+ local:
+ path: .
diff --git a/examples/sagemaker_example/liminal_sm.py b/examples/sagemaker_example/liminal_sm.py
new file mode 100644
index 0000000..17ff614
--- /dev/null
+++ b/examples/sagemaker_example/liminal_sm.py
@@ -0,0 +1,56 @@
+import os
+
+from sagemaker.deserializers import NumpyDeserializer
+from sagemaker.predictor import Predictor
+from sagemaker.serializers import NumpySerializer
+
+from sm_ops import (sm_data_prep, sm_train, sm_deploy,
+ sm_validate, create_sm_args_parser)
+import tempfile
+
+COMM_PATH = os.getenv("COMM_PATH", tempfile.mkdtemp())
+os.makedirs(COMM_PATH, exist_ok=True)
+
+
+def read_message(name):
+ with open(os.path.join(COMM_PATH, name)) as f:
+ lines = f.readlines()
+ return [x.strip() for x in lines]
+
+
+def forward_message(name, lines):
+ if not isinstance(lines, list):
+ lines = [lines]
+ lines = '\n'.join(lines) + '\n'
+ with open(os.path.join(COMM_PATH, name), 'w') as f:
+ f.writelines(lines)
+
+
+if __name__ == '__main__':
+ choices = ['data_prep', 'train', 'deploy', 'validate', 'all']
+ parser = create_sm_args_parser()
+ parser.add_argument("--action", choices=choices, default='all')
+ args = parser.parse_args()
+ steps = [args.action]
+ if args.action == 'all':
+ steps = choices [:-1]
+ for step in steps:
+ if step == 'data_prep':
+ train, test = sm_data_prep(args.input_uri, args.output_uri_base)
+ forward_message('data_prep', [train, test])
+ elif step == 'train':
+ lines = read_message('data_prep')
+ train, test = lines[0], lines[1]
+ artifact = sm_train(train, test, base_job_name=args.base_job_name, instance_type=args.train_instance_type, n_jobs=args.n_jobs)
+ forward_message('train', artifact)
+ elif step == 'deploy':
+ artifact = read_message('train')[0]
+ predictor = sm_deploy(artifact=artifact, model_name=args.model_name, instance_type=args.deploy_instance_type)
+ forward_message('deploy', predictor.endpoint)
+ else:
+ endpoint = read_message('deploy')[0]
+ train, test = read_message('data_prep')
+ predictor = Predictor(endpoint_name=endpoint, serializer=NumpySerializer(), deserializer=NumpyDeserializer())
+ result = sm_validate(predictor, test)
+ print(f"avg abs error:{result}")
+
diff --git a/examples/sagemaker_example/requirements.txt b/examples/sagemaker_example/requirements.txt
new file mode 100644
index 0000000..3a0ea64
--- /dev/null
+++ b/examples/sagemaker_example/requirements.txt
@@ -0,0 +1,4 @@
+sagemaker==2.57.0
+scikit-learn==0.23.2
+s3fs==2022.5.0
+
diff --git a/examples/sagemaker_example/sm_ops.py b/examples/sagemaker_example/sm_ops.py
new file mode 100644
index 0000000..d932dd6
--- /dev/null
+++ b/examples/sagemaker_example/sm_ops.py
@@ -0,0 +1,124 @@
+
+import argparse
+import os
+import time
+
+import boto3
+import numpy as np
+import pandas as pd
+import sagemaker
+#from sagemaker.deserializers import NumpyDeserializer
+#from sagemaker.predictor import Predictor
+#from sagemaker.serializers import NumpySerializer
+from sagemaker.sklearn.estimator import SKLearn
+from sagemaker.sklearn.model import SKLearnModel
+
+from data_preparation.data_preparation import (data_pipeline,
+ DATASET_PUBLIC_URL,
+ LABEL_COLUMN)
+from data_preparation.data_uploader import SagemakerDataUploader
+from train.train import feature_column_names
+
+FRAMEWORK_VERSION = "0.23-1"
+
+sm_boto3 = boto3.client("sagemaker")
+
+sess = sagemaker.Session()
+
+
+def get_role():
+ try:
+ role = sagemaker.get_execution_role()
+ except ValueError:
+ role = os.getenv("SM_ROLE")
+ return role
+
+
+def sm_train(train_path, test_path, base_job_name="Liminal-sm-training-job", instance_type="ml.m5.large", n_jobs=1):
+ sklearn_estimator = SKLearn(
+ entry_point="train/train.py",
+ source_dir="./",
+ role=get_role(),
+ instance_count=1,
+ instance_type=instance_type,
+ framework_version=FRAMEWORK_VERSION,
+ base_job_name=base_job_name,
+ hyperparameters={
+ "n-jobs": n_jobs,
+ }
+ )
+ sklearn_estimator.fit({"train": train_path, "test": test_path})
+ artifact = sm_boto3.describe_training_job(
+ TrainingJobName=sklearn_estimator.latest_training_job.name
+ )["ModelArtifacts"]["S3ModelArtifacts"]
+
+ print("Model artifact persisted at " + artifact)
+ return artifact
+
+
+def sm_deploy(artifact, model_name="Liminal-sm-demo-model", instance_type="ml.m5.large"):
+
+ timestamp = time.strftime("-%Y-%m-%d-%H-%M-%S", time.gmtime())
+ model = SKLearnModel(
+ name=f"{model_name}-{timestamp}",
+ entry_point="inference.py",
+ model_data=artifact,
+ role=get_role(),
+ framework_version=FRAMEWORK_VERSION,
+ )
+
+ predictor = model.deploy(instance_type=instance_type, initial_instance_count=1, wait=True)
+ return predictor
+
+
+def sm_validate(predictor, test_path):
+ if not test_path.startswith("s3"):
+ test_path = f"s3://{test_path}"
+
+ df = pd.read_csv(test_path)
+ X_test_inference = df[feature_column_names].to_numpy()
+ predictions = predictor.predict(data=X_test_inference)
+ print("validating model")
+ avg_err = np.average(np.abs(predictions - df[LABEL_COLUMN]))
+ print(f"average abs error:{avg_err}")
+ print(predictions)
+ return avg_err
+
+
+def sm_data_prep(input_uri, output_uri_base):
+ return data_pipeline(input_uri=input_uri or DATASET_PUBLIC_URL, output_uri_base=output_uri_base,
+ data_uploader=SagemakerDataUploader())
+
+
+def sm_main(args):
+ test_path = 'sagemaker-us-east-1-468326661668/liminal-sm-example/test/diamonds_test.csv'
+ train_path, test_path = sm_data_prep(args.input_uri, args.output_uri_base)
+ artifact = sm_train(train_path, test_path, base_job_name=args.base_job_name, instance_type=args.train_instance_type, n_jobs=args.n_jobs)
+ #artifact = 's3://sagemaker-us-east-1-468326661668/Liminal-sm-training-job-2022-06-06-14-30-39-827/output/model.tar.gz'
+ predictor = sm_deploy(artifact, model_name=args.model_name, instance_type=args.deploy_instance_type)
+ #predictor = Predictor(endpoint_name="Liminal-sm-demo-model-2022-06-06-14-35-48-079", serializer=NumpySerializer(), deserializer=NumpyDeserializer())
+ sm_validate(predictor, test_path)
+
+
+def create_sm_args_parser():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--input_uri",
+ default=DATASET_PUBLIC_URL)
+ parser.add_argument("--output_uri_base",
+ default="liminal-sm-example")
+ parser.add_argument("--base_job_name",
+ default="Liminal-sm-training-job")
+ parser.add_argument("--train_instance_type", default="ml.m5.large")
+ parser.add_argument("--n_jobs", default=1)
+ parser.add_argument("--model_name",
+ default="Liminal-sm-demo-model")
+ parser.add_argument("--deploy_instance_type", default="ml.m5.large")
+ return parser
+
+
+if __name__ == '__main__':
+ parser = create_sm_args_parser()
+ args = parser.parse_args()
+ sm_main(args)
+
+
diff --git a/examples/sagemaker_example/train/__init__.py b/examples/sagemaker_example/train/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/examples/sagemaker_example/train/train.py b/examples/sagemaker_example/train/train.py
new file mode 100644
index 0000000..4c2a09b
--- /dev/null
+++ b/examples/sagemaker_example/train/train.py
@@ -0,0 +1,87 @@
+from pathlib import Path
+
+import joblib
+from sklearn.linear_model import LinearRegression
+from sklearn.pipeline import Pipeline
+import numpy as np
+from sklearn.compose import ColumnTransformer
+from sklearn.preprocessing import OneHotEncoder
+from data_preparation.data_preparation import LABEL_COLUMN, TRAIN_CSV, TEST_CSV
+import os
+import argparse
+import pandas as pd
+
+
+feature_column_names = [
+ 'carat',
+ 'cut',
+ 'color',
+ 'clarity',
+ 'depth',
+ 'table',
+ 'x',
+ 'y',
+ 'z'
+]
+
+
+categorical_cols = ['cut', 'clarity', 'color']
+
+# inference functions
+MODEL_JOBLIB_FILENAME = "model.joblib"
+
+preprocessor = ColumnTransformer(
+ transformers=[
+ ('categorical', OneHotEncoder(), categorical_cols)
+ ], remainder='passthrough')
+
+
+def train(train_df, test_df, n_jobs, model_dir):
+ X_train = train_df[feature_column_names]
+ y_train = train_df[LABEL_COLUMN]
+
+ print(X_train.head(3))
+ X_test = test_df[feature_column_names]
+ y_test = test_df[LABEL_COLUMN]
+
+ # train
+
+ diamond_price_model=LinearRegression(n_jobs=n_jobs)
+
+ my_pipeline = Pipeline(steps=[
+ ('preprocessor', preprocessor),
+ ('model', diamond_price_model)
+ ])
+
+ my_pipeline.fit(X_train, y_train)
+
+ train_predictions = my_pipeline.predict(X_train)
+ print(train_predictions)
+
+ print("validating model")
+ abs_err = np.abs(my_pipeline.predict(X_test) - y_test)
+ print(f"Test prediction error:{abs_err} ")
+
+ # persist model
+ path = os.path.join(model_dir, MODEL_JOBLIB_FILENAME)
+ joblib.dump(my_pipeline, path)
+ print("model persisted at " + path)
+ return path
+
+
+if __name__ == '__main__':
+ data_path = Path(__file__).parent.parent.absolute().joinpath('data')
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--model-dir', type=str, default=os.getenv('SM_MODEL_DIR', f"file://{data_path}"))
+ parser.add_argument('--n-jobs', default=2)
+ parser.add_argument("--train", type=str, default=os.getenv("SM_CHANNEL_TRAIN", f"file://{data_path.joinpath('train')}"))
+ parser.add_argument("--test", type=str, default=os.getenv("SM_CHANNEL_TEST", f"file://{data_path.joinpath('test')}"))
+ parser.add_argument("--train-file", type=str, default=TRAIN_CSV)
+ parser.add_argument("--test-file", type=str, default=TEST_CSV)
+
+ args = parser.parse_args()
+
+ train_df = pd.read_csv(os.path.join(args.train, args.train_file))
+ test_df = pd.read_csv(os.path.join(args.test, args.test_file))
+
+ train(train_df=train_df, test_df=test_df, n_jobs=args.n_jobs, model_dir=args.model_dir)
diff --git a/liminal/build/image/python/Dockerfile b/liminal/build/image/python/Dockerfile
index 67d8462..0d84428 100644
--- a/liminal/build/image/python/Dockerfile
+++ b/liminal/build/image/python/Dockerfile
@@ -20,7 +20,9 @@
FROM {{python}}
# Install aptitude build-essential
-#RUN apt-get install -y --reinstall build-essential
+RUN apt-get update && apt-get install -y --reinstall build-essential \
+ make \
+ gcc
# Set the working directory to /app
WORKDIR /app
@@ -32,8 +34,8 @@ WORKDIR /app
COPY ./requirements.txt /app/
# mount the secret in the correct location, then run pip install
-RUN pip install --upgrade pip
-RUN {{mount}} pip install -r requirements.txt
+RUN python3 -m pip install --upgrade pip
+RUN {{mount}} pip3 install -r requirements.txt
# Copy the current directory contents into the container at /app
RUN echo "Copying source code.."
diff --git a/liminal/build/image/python_server/python_server_requirements.txt b/liminal/build/image/python_server/python_server_requirements.txt
index f27ab17..9bdbb4b 100644
--- a/liminal/build/image/python_server/python_server_requirements.txt
+++ b/liminal/build/image/python_server/python_server_requirements.txt
@@ -16,5 +16,5 @@
# specific language governing permissions and limitations
# under the License.
-Flask==1.1.1
+Flask
pyyaml