Skip to content

Commit 87c50be

Browse files
committed
add python 3.13 runtime
Signed-off-by: Luke Roy <luke.roy@ibm.com>
1 parent 9a873ec commit 87c50be

7 files changed

Lines changed: 170 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
./gradlew :core:python311Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
9999
./gradlew :core:python312Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
100100
./gradlew :core:python312Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
101+
./gradlew :core:python313Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
102+
./gradlew :core:python313Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
101103
- name: Push Release Images
102104
if: ${{ env.PUSH_RELEASE == 'true' }}
103105
working-directory: runtime
@@ -112,5 +114,7 @@ jobs:
112114
RUNTIME="python311Action"
113115
elif [ ${RUNTIME_VERSION} == "312" ]; then
114116
RUNTIME="python312Action"
117+
elif [ ${RUNTIME_VERSION} == "313" ]; then
118+
RUNTIME="python313Action"
115119
fi
116120
./gradlew :core:$RUNTIME:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$IMAGE_TAG

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following Python runtime versions (with kind & image labels) are generated b
2929
- Python 3.10 (python:3.10 & openwhisk/action-python-v3.10)
3030
- Python 3.11 (python:3.11 & openwhisk/action-python-v3.11)
3131
- Python 3.12 (python:3.12 & openwhisk/action-python-v3.12)
32+
- Python 3.13 (python:3.13 & openwhisk/action-python-v3.13)
3233

3334
This README documents the build, customization and testing of these runtime images.
3435

core/python313Action/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# build go proxy from source
19+
FROM golang:1.24 AS builder_source
20+
ARG GO_PROXY_GITHUB_USER=apache
21+
ARG GO_PROXY_GITHUB_BRANCH=master
22+
RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
23+
https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go /src ;\
24+
cd /src ; env GO111MODULE=on CGO_ENABLED=0 go build main/proxy.go && \
25+
mv proxy /bin/proxy
26+
27+
# or build it from a release
28+
FROM golang:1.24 AS builder_release
29+
ARG GO_PROXY_RELEASE_VERSION=1.23@1.25.0
30+
ARG GO_PROXY_GITHUB_USER=apache
31+
RUN curl -sL \
32+
https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
33+
| tar xzf -\
34+
&& cd openwhisk-runtime-go-*/main\
35+
&& GO111MODULE=on CGO_ENABLED=0 go build -o /bin/proxy
36+
37+
FROM python:3.13-bookworm
38+
39+
# select the builder to use
40+
ARG GO_PROXY_BUILD_FROM=release
41+
42+
# install zip
43+
RUN apt-get update && apt-get install -y zip gcc \
44+
&& rm -rf /var/lib/apt/lists/*
45+
46+
# Install common modules for python
47+
COPY requirements_common.txt requirements_common.txt
48+
COPY requirements.txt requirements.txt
49+
RUN pip3 install --upgrade pip six wheel &&\
50+
pip3 install --no-cache-dir -r requirements.txt
51+
52+
RUN mkdir -p /action
53+
WORKDIR /
54+
55+
COPY --from=builder_source /bin/proxy /bin/proxy_source
56+
COPY --from=builder_release /bin/proxy /bin/proxy_release
57+
RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
58+
59+
ADD bin/compile /bin/compile
60+
ADD lib/launcher.py /lib/launcher.py
61+
62+
# log initialization errors
63+
ENV OW_LOG_INIT_ERROR=1
64+
# the launcher must wait for an ack
65+
ENV OW_WAIT_FOR_ACK=1
66+
# using the runtime name to identify the execution environment
67+
ENV OW_EXECUTION_ENV=openwhisk/action-python-v3.12
68+
# compiler script
69+
ENV OW_COMPILER=/bin/compile
70+
71+
ENTRYPOINT ["/bin/proxy"]

core/python313Action/build.gradle

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
ext.dockerImageName = 'action-python-v3.13'
19+
apply from: '../../gradle/docker.gradle'
20+
21+
distDocker.dependsOn 'copyLib'
22+
distDocker.dependsOn 'copyBin'
23+
distDocker.dependsOn 'copyReqrCommon'
24+
distDocker.finalizedBy('cleanup')
25+
26+
task copyLib(type: Copy) {
27+
from '../python3Action/lib'
28+
into './lib'
29+
}
30+
31+
task copyBin(type: Copy) {
32+
from '../python3Action/bin'
33+
into './bin'
34+
}
35+
36+
task copyReqrCommon(type: Copy) {
37+
from '../requirements_common.txt'
38+
into './'
39+
}
40+
41+
task cleanup(type: Delete) {
42+
delete 'bin'
43+
delete 'lib'
44+
delete 'requirements_common.txt'
45+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# default packages available for action-python-v3.12
2+
#-r requirements_common.txt
3+
beautifulsoup4==4.12.3
4+
httplib2==0.22.0
5+
kafka_python==2.0.2
6+
lxml==5.1.0
7+
python-dateutil==2.8.2
8+
requests==2.31.0
9+
scrapy==2.11.2
10+
simplejson==3.19.2
11+
virtualenv==20.25.0
12+
twisted==24.7.0
13+
netifaces==0.11.0
14+
# fix issue: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools
15+
setuptools == 70.0.0

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ include 'core:python39Action'
2121
include 'core:python310Action'
2222
include 'core:python311Action'
2323
include 'core:python312Action'
24+
include 'core:python313Action'
2425

2526
rootProject.name = 'runtime-python'
2627

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package runtime.actionContainers
19+
20+
import org.junit.runner.RunWith
21+
import org.scalatest.junit.JUnitRunner
22+
23+
@RunWith(classOf[JUnitRunner])
24+
class Python313Tests extends Python3Tests {
25+
26+
override lazy val imageName = "action-python-v3.13"
27+
28+
override lazy val zipPrefix = "python-v3.13"
29+
30+
override lazy val errorCodeOnRun = false
31+
32+
override val testNoSource = TestConfig("", hasCodeStub = false)
33+
}

0 commit comments

Comments
 (0)