Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ jobs:
./gradlew :core:python311Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
./gradlew :core:python312Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:python312Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
./gradlew :core:python313Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
./gradlew :core:python313Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
- name: Push Release Images
if: ${{ env.PUSH_RELEASE == 'true' }}
working-directory: runtime
Expand All @@ -112,5 +114,7 @@ jobs:
RUNTIME="python311Action"
elif [ ${RUNTIME_VERSION} == "312" ]; then
RUNTIME="python312Action"
elif [ ${RUNTIME_VERSION} == "313" ]; then
RUNTIME="python313Action"
fi
./gradlew :core:$RUNTIME:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$IMAGE_TAG
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The following Python runtime versions (with kind & image labels) are generated b
- Python 3.10 (python:3.10 & openwhisk/action-python-v3.10)
- Python 3.11 (python:3.11 & openwhisk/action-python-v3.11)
- Python 3.12 (python:3.12 & openwhisk/action-python-v3.12)
- Python 3.13 (python:3.13 & openwhisk/action-python-v3.13)

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

Expand Down
4 changes: 4 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

# Python 3 OpenWhisk Runtime Container

## Next
- add Python 3.13
- update Python 3.9 base image to bookworm

## 1.20.0
- Dependabot Fixes (#159)
- Update virtualenv for python:3.9 to fix tests. (#161)
Expand Down
71 changes: 71 additions & 0 deletions core/python313Action/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# 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.
#

# build go proxy from source
FROM golang:1.24 AS builder_source
ARG GO_PROXY_GITHUB_USER=apache
ARG GO_PROXY_GITHUB_BRANCH=master
RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go /src ;\
cd /src ; env GO111MODULE=on CGO_ENABLED=0 go build main/proxy.go && \
mv proxy /bin/proxy

# or build it from a release
FROM golang:1.24 AS builder_release
ARG GO_PROXY_RELEASE_VERSION=1.23@1.25.0
ARG GO_PROXY_GITHUB_USER=apache
RUN curl -sL \
https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
| tar xzf -\
&& cd openwhisk-runtime-go-*/main\
&& GO111MODULE=on CGO_ENABLED=0 go build -o /bin/proxy

FROM python:3.13-bookworm

# select the builder to use
ARG GO_PROXY_BUILD_FROM=release

# install zip
RUN apt-get update && apt-get install -y zip gcc \
&& rm -rf /var/lib/apt/lists/*

# Install common modules for python
COPY requirements_common.txt requirements_common.txt
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip six wheel &&\
pip3 install --no-cache-dir -r requirements.txt

RUN mkdir -p /action
WORKDIR /

COPY --from=builder_source /bin/proxy /bin/proxy_source
COPY --from=builder_release /bin/proxy /bin/proxy_release
RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy

ADD bin/compile /bin/compile
ADD lib/launcher.py /lib/launcher.py

# log initialization errors
ENV OW_LOG_INIT_ERROR=1
# the launcher must wait for an ack
ENV OW_WAIT_FOR_ACK=1
# using the runtime name to identify the execution environment
ENV OW_EXECUTION_ENV=openwhisk/action-python-v3.12
# compiler script
ENV OW_COMPILER=/bin/compile

ENTRYPOINT ["/bin/proxy"]
45 changes: 45 additions & 0 deletions core/python313Action/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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.
*/

ext.dockerImageName = 'action-python-v3.13'
apply from: '../../gradle/docker.gradle'

distDocker.dependsOn 'copyLib'
distDocker.dependsOn 'copyBin'
distDocker.dependsOn 'copyReqrCommon'
distDocker.finalizedBy('cleanup')

task copyLib(type: Copy) {
from '../python3Action/lib'
into './lib'
}

task copyBin(type: Copy) {
from '../python3Action/bin'
into './bin'
}

task copyReqrCommon(type: Copy) {
from '../requirements_common.txt'
into './'
}

task cleanup(type: Delete) {
delete 'bin'
delete 'lib'
delete 'requirements_common.txt'
}
15 changes: 15 additions & 0 deletions core/python313Action/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# default packages available for action-python-v3.12
#-r requirements_common.txt
beautifulsoup4==4.12.3
httplib2==0.22.0
kafka_python==2.0.2
lxml==5.1.0
python-dateutil==2.8.2
requests==2.31.0
scrapy==2.11.2
simplejson==3.19.2
virtualenv==20.25.0
twisted==24.7.0
netifaces==0.11.0
# fix issue: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools
setuptools == 70.0.0
2 changes: 1 addition & 1 deletion core/python39Action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN curl -sL \
&& cd openwhisk-runtime-go-*/main\
&& GO111MODULE=on CGO_ENABLED=0 go build -o /bin/proxy

FROM python:3.9-buster
FROM python:3.9-bookworm

# select the builder to use
ARG GO_PROXY_BUILD_FROM=release
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include 'core:python39Action'
include 'core:python310Action'
include 'core:python311Action'
include 'core:python312Action'
include 'core:python313Action'

rootProject.name = 'runtime-python'

Expand Down
33 changes: 33 additions & 0 deletions tests/src/test/scala/runtime/actionContainers/Python313Tests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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.
*/

package runtime.actionContainers

import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class Python313Tests extends Python3Tests {

override lazy val imageName = "action-python-v3.13"

override lazy val zipPrefix = "python-v3.13"

override lazy val errorCodeOnRun = false

override val testNoSource = TestConfig("", hasCodeStub = false)
}
Loading