Skip to content

Commit 71ffd83

Browse files
code247Sagar Manohar
andauthored
Updates to readme and packages (#117)
Co-authored-by: Sagar Manohar <Sagar.Mohan.Manohar@ibm.com>
1 parent fd0a7ce commit 71ffd83

File tree

12 files changed

+416
-376
lines changed

12 files changed

+416
-376
lines changed

README.md

Lines changed: 23 additions & 317 deletions
Large diffs are not rendered by default.

core/python36AiAction/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
5555
# PyTorch
5656
# persistent as it fails often
5757
RUN while ! pip list | grep torch ;\
58-
do pip install torch ; done ;\
58+
do pip --no-cache-dir install torch ; done ;\
5959
while ! pip list | grep torchvision ;\
6060
do pip install torchvision ; done
6161

@@ -64,6 +64,7 @@ RUN curl -L https://downloads.rclone.org/rclone-current-linux-amd64.deb -o rclon
6464
&& dpkg -i rclone.deb \
6565
&& rm rclone.deb
6666

67+
COPY requirements_common.txt requirements_common.txt
6768
COPY requirements.txt requirements.txt
6869
RUN pip3 install --upgrade pip six wheel &&\
6970
pip3 install --no-cache-dir -r requirements.txt &&\
@@ -89,4 +90,5 @@ ENV OW_EXECUTION_ENV=openwhisk/action-python-v3.6-ai
8990
ENV OW_COMPILER=/bin/compile
9091
# use utf-8
9192
ENV PYTHONIOENCODING=UTF-8
93+
9294
ENTRYPOINT ["/bin/proxy"]

core/python36AiAction/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ apply from: '../../gradle/docker.gradle'
2020

2121
distDocker.dependsOn 'copyLib'
2222
distDocker.dependsOn 'copyBin'
23+
distDocker.dependsOn 'copyReqrCommon'
2324
distDocker.finalizedBy('cleanup')
2425

2526
task copyLib(type: Copy) {
@@ -32,7 +33,13 @@ task copyBin(type: Copy) {
3233
into './bin'
3334
}
3435

36+
task copyReqrCommon(type: Copy) {
37+
from '../requirements_common.txt'
38+
into './'
39+
}
40+
3541
task cleanup(type: Delete) {
3642
delete 'bin'
3743
delete 'lib'
44+
delete 'requirements_common.txt'
3845
}
Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,32 @@
1-
# default available packages for python3action
2-
beautifulsoup4 == 4.8.2
3-
httplib2 == 0.17.0
4-
kafka_python == 1.4.7
5-
lxml == 4.5.0
6-
python-dateutil == 2.8.1
7-
requests == 2.22.0
8-
scrapy == 1.8.0
9-
simplejson == 3.17.0
10-
virtualenv == 16.7.9
11-
twisted == 19.10.0
12-
netifaces == 0.10.9
1+
# default packages available for action-python-v3.6-ai
2+
-r requirements_common.txt
133

144
# package to sync from a variety of cloud blob storage
155
python-rclone == 0.0.2
166

177
# more ML/DL packages
18-
keras == 2.3.1
19-
opencv-contrib-python == 4.2.0.32
20-
Cython == 0.29.14
21-
tools == 0.1.9
22-
scikit-image == 0.16.2
23-
24-
nltk == 3.4.5
25-
26-
PyJWT == 1.7.1
8+
keras==2.6.0
9+
opencv-contrib-python==4.5.3.56
10+
Cython==0.29.24
11+
tools==0.1.9
12+
scikit-image==0.17.2
13+
nltk==3.6.2
2714

2815
# packages for numerics
29-
numpy == 1.18.1
30-
scikit-learn == 0.22.1
31-
scipy == 1.4.1
32-
pandas == 1.0.1
16+
numpy==1.19.5
17+
scikit-learn==0.24.2
18+
scipy==1.5.4
19+
pandas==1.1.5
3320

3421
# packages for image processing
35-
Pillow == 7.0.0
22+
Pillow==8.3.2
3623

3724
# Etc
38-
pymongo == 3.10.1
39-
redis == 3.4.1
40-
pika == 1.1.0
41-
elasticsearch == 7.5.1
42-
cassandra-driver == 3.21.0
43-
etcd3 == 0.11.1
44-
twilio == 6.35.4
25+
PyJWT==1.7.1
26+
pymongo==3.12.0
27+
redis==3.5.3
28+
pika==1.2.0
29+
elasticsearch==7.14.1
30+
cassandra-driver==3.25.0
31+
etcd3==0.12.0
32+
twilio==6.63.2

core/python39Action/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ FROM python:3.9-buster
3939
ARG GO_PROXY_BUILD_FROM=release
4040

4141
# Install common modules for python
42+
COPY requirements_common.txt requirements_common.txt
4243
COPY requirements.txt requirements.txt
43-
RUN pip install --no-cache-dir -r requirements.txt
44+
RUN pip3 install --upgrade pip six wheel &&\
45+
pip3 install --no-cache-dir -r requirements.txt
4446

4547
RUN mkdir -p /action
4648
WORKDIR /
49+
4750
COPY --from=builder_source /bin/proxy /bin/proxy_source
4851
COPY --from=builder_release /bin/proxy /bin/proxy_release
4952
RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
53+
5054
ADD bin/compile /bin/compile
5155
ADD lib/launcher.py /lib/launcher.py
5256

core/python39Action/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ apply from: '../../gradle/docker.gradle'
2020

2121
distDocker.dependsOn 'copyLib'
2222
distDocker.dependsOn 'copyBin'
23+
distDocker.dependsOn 'copyReqrCommon'
2324
distDocker.finalizedBy('cleanup')
2425

2526
task copyLib(type: Copy) {
@@ -32,7 +33,13 @@ task copyBin(type: Copy) {
3233
into './bin'
3334
}
3435

36+
task copyReqrCommon(type: Copy) {
37+
from '../requirements_common.txt'
38+
into './'
39+
}
40+
3541
task cleanup(type: Delete) {
3642
delete 'bin'
3743
delete 'lib'
44+
delete 'requirements_common.txt'
3845
}
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
# default available packages for action-python-v39
2-
beautifulsoup4 == 4.9.3
3-
httplib2 == 0.19.1
4-
kafka_python == 1.4.7
5-
lxml == 4.6.3
6-
python-dateutil == 2.8.1
7-
requests == 2.25.1
8-
scrapy == 1.8.0
9-
simplejson == 3.17.2
10-
virtualenv == 20.4.7
11-
twisted == 21.2.0
12-
netifaces == 0.11.0
1+
# default packages available for action-python-v3.9
2+
-r requirements_common.txt

core/python3Action/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ FROM python:3.7-buster
3939
ARG GO_PROXY_BUILD_FROM=release
4040

4141
# Install common modules for python
42+
COPY requirements_common.txt requirements_common.txt
4243
COPY requirements.txt requirements.txt
43-
RUN pip install --no-cache-dir -r requirements.txt
44+
RUN pip3 install --upgrade pip six wheel &&\
45+
pip3 install --no-cache-dir -r requirements.txt
4446

4547
RUN mkdir -p /action
4648
WORKDIR /
49+
4750
COPY --from=builder_source /bin/proxy /bin/proxy_source
4851
COPY --from=builder_release /bin/proxy /bin/proxy_release
4952
RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
53+
5054
ADD bin/compile /bin/compile
5155
ADD lib/launcher.py /lib/launcher.py
5256

core/python3Action/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@
1717

1818
ext.dockerImageName = 'action-python-v3.7'
1919
apply from: '../../gradle/docker.gradle'
20+
21+
distDocker.dependsOn 'copyReqrCommon'
22+
distDocker.finalizedBy('cleanup')
23+
24+
task copyReqrCommon(type: Copy) {
25+
from '../requirements_common.txt'
26+
into './'
27+
}
28+
29+
task cleanup(type: Delete) {
30+
delete 'requirements_common.txt'
31+
}
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
# default available packages for python3action
2-
beautifulsoup4 == 4.6.3
3-
httplib2 == 0.11.3
4-
kafka_python == 1.4.3
5-
lxml == 4.2.5
6-
python-dateutil == 2.7.3
7-
requests == 2.19.1
8-
scrapy == 1.5.1
9-
simplejson == 3.16.0
10-
virtualenv == 16.0.0
11-
twisted == 18.7.0
1+
# default packages available for action-python-v3.7
2+
-r requirements_common.txt

0 commit comments

Comments
 (0)